pdom.Molecule¶
-
class
pdom.Molecule(identifier, properties, save=True)¶ This class should not be initialised directly. Use one of the following class methods instead:
from_chem_id(),from_folder(),from_inchi(),from_inchi_key(),from_iupac_name(),from_name()Parameters: - identifier (dict) –
namecommon nameiupac_nameIUPAC name (can be the same as common name)chem_idcompound ID from PubCheminchiIUPAC International Chemical Identifier (human readable)inchi_keyIUPAC International Chemical Identifier (hash)
- properties (dict) –
chem_formulachemical formula e.g. ‘C10H22’chem_formdicchemical formula as dictmol_weightmolecular weight in g/molmol_volumemolecular volume in cm^3/molmol_surfacelargest projected surface area m^2/moleculeexcess_bondsnumber of bonds in excess of a simple carbon chainstructure_3datom position list
- save (bool) – save data to the user cache
-
classmethod
from_chem_id(chem_id, name=None, inchi_key=None)¶ Create
Moleculeinstance identified by a chemID from PubChem data.Note: if molecule is cached in
Molecule.db_folderload from thereParameters: - chem_id (int) –
compound ID from PubChem
- name (str, optional) – overwrite compound name
- inchi_key (str, optional) – IUPAC International Chemical Identifier (to check cache quickly)
Returns: Moleculeinstance- chem_id (int) –
-
classmethod
from_folder(folder)¶ create
Moleculeinstance from a folder created bysaveParameters: folder (str, folder) – molecule folder Returns: Moleculeinstance
-
classmethod
from_name(name)¶ Create
Moleculeinstance identified by a name if uniqueNote: queries chem_idand callsfrom_chem_id()Parameters: name (str) – unique compound name Returns: Moleculeinstance
-
save(folder=None, name=None)¶ saves the molecule information to disk, can be loaded with
from_folder()Note: If called without parameters the molecule is saved in an appropriate cache folder
Molecule.db_folder.Parameters: - folder (str, Path) – parent folder
- name (str) – molecule folder name (default INCHI key)
-
structure_3d(rotated=True)¶ Returned 3d structure of the molecule
Parameters: rotated (bool) – if Truethe structure is rotated to cover the maximum surface in the xy spaceReturns: 3D structure (symbol, x, y, z) Return type: list
- identifier (dict) –