get rdkit object

get_rdkit_object module.

instantiate_mol_object(identifier: str | Mol, identifier_type: str = 'name') Mol[source]

Instantiate a RDKit Mol object from molecule’s name, SMILES or mol.

In case that the input its already a RDKit Mol object, the function will return the input object.

Parameters:
  • identifier (str or rdkit.Chem.rdchem.Mol) – Identifier of a molecule (name, SMILES or rdkit.Chem.rdchem.Mol). Example: hexane or CCCCCC for name or SMILES respectively.

  • identifier_type (str, optional) – Use ‘name’ to search a molecule by name, ‘smiles’ to provide the molecule SMILES representation or ‘mol’ to provide a rdkit.Chem.rdchem.Mol object, by default “name”.

Returns:

RDKit Mol object.

Return type:

rdkit.Chem.rdchem.Mol

instantiate_mol_from_name(name: str) Mol[source]

Instantiate a RDKit Mol object from molecule’s name.

The funcion uses pubchempy to get the molecule’s SMILES representation from the molecule’s name and then instantiate a RDKit Mol object.

Parameters:

name (str) – Name of the molecule.

Returns:

RDKit Mol object.

Return type:

rdkit.Chem.rdchem.Mol