4.2. smiles

pharmaforge.labeling.smiles.assign_smiles(molecule_name, failed_mols)[source]

Assigns SMILES notation to a molecule using RDKit.

Parameters:
  • molecule_name (str) – The name of the molecule for which to generate SMILES.

  • failed_mols (list) – A list to keep track of failed molecules.

Returns:

smiles – The SMILES notation for the molecule, or None if generation failed.

Return type:

str

pharmaforge.labeling.smiles.count_molecules(smiles)[source]

Counts the number of molecules in a SMILES string.

Parameters:

smiles (str) – The SMILES notation for the molecule.

pharmaforge.labeling.smiles.count_water_molecules(smiles, mol_smile='[H]O[H]')[source]

Counts the number of water molecules in a SMILES string.

Parameters:
  • smiles (str) – The SMILES notation for the molecule.

  • mol_smile (str) – The SMILES notation for the molecule to count (default is water).

pharmaforge.labeling.smiles.new_hdf5_file_with_smiles(original_file: str, new_file: str, db) None[source]

Creates a new hdf5 file with smiles strings

Parameters:
  • original_file (str) – The name of the original HDF5 file to read from.

  • new_file (str) – The name of the new HDF5 file to create.

  • db (DataBase) – The database instance containing molecule data.

pharmaforge.labeling.smiles.save_molecule_to_xyz(db, db_name, mol)[source]

Saves the molecular structure to an XYZ file.

Parameters:
  • db (DataBase) – The database instance containing molecule data.

  • db_name (str) – The name of the database to connect to.

  • mol (str) – The name of the molecule to save.