mispr.common package¶
Submodules¶
mispr.common.pubchem module¶
Implement a core class PubChemRunner for retrieving molecules from the PubChem database using a molecule name as a query criteria.
-
class mispr.common.pubchem.PubChemRunner(abbreviation, working_dir=
None
)[source]¶ Bases:
object
Wrapper for retrieving molecules from PubChem database.
- Parameters:¶
- convert_sdf_to_mol(save_to_file, fmt)[source]¶
Convert an SDF file to a pymatgen
Molecule
object.
- download_sdf(name)[source]¶
Download an SDF file from PubChem using a common name for the molecule as an identifier.
-
get_mol(name, save_to_file=
True
, fmt='pdb'
, cleanup=True
)[source]¶ Wrapper function that searches for a molecule in the PubChem database, downloads it in the form of an SDF file, and converts the file to a pymatgen
Molecule
object.- Parameters:¶
- name : str¶
Name of the molecule to use for searching PubChem.
- save_to_file : bool, optional¶
Whether to save the
Molecule
object to a file. Defaults toTrue
.- fmt : str, optional¶
Molecule file format if
save_to_file
isTrue
; defaults to “pdb”.- cleanup : bool, optional¶
Whether to remove the intermediate sdf file.
- Returns:¶
pymatgen
Molecule
object.- Return type:¶
Molecule