Fingerprints and Descriptors

mol2morgan_fp(mol, radius=2, nBits=2048)[source]

Convert an RDKit molecule to a Morgan fingerprint

Parameters:
  • mol (Mol) – RDKit molecule

  • radius (int) – fingerprint radius

  • nBits (int) – number of fingerprint bits

Return type:

ExplicitBitVect

Returns:

RDKit Morgan fingerprint

smi2morgan_fp(smi, radius=2, nBits=2048)[source]

Convert a SMILES to a Morgan fingerprint

Parameters:
  • smi (str) – SMILES

  • radius (int) – fingerprint radius

  • nBits (int) – number of fingerprint bits

Return type:

Optional[ExplicitBitVect]

Returns:

RDKit Morgan fingerprint

mol2numpy_fp(mol, radius=2, n_bits=2048)[source]

Convert an RDKit molecule to a numpy array with Morgan fingerprint bits Borrowed from https://iwatobipen.wordpress.com/2019/02/08/convert-fingerprint-to-numpy-array-and-conver-numpy-array-to-fingerprint-rdkit-memorandum/

Parameters:
  • mol (Mol) – RDKit molecule

  • radius (int) – fingerprint radius

  • n_bits (int) – number of fingerprint bits

Return type:

ndarray

Returns:

numpy array with RDKit fingerprint bits

smi2numpy_fp(smi, radius=2, nBits=2048)[source]

Convert a SMILES to a numpy array with Morgan fingerprint bits

Parameters:
  • smi (str) – SMILES string

  • radius (int) – fingerprint radius

  • nBits (int) – number of fingerprint bits

Return type:

ndarray

Returns:

numpy array with RDKit fingerprint bits

apply_func(name, mol)[source]

Apply an RDKit descriptor calculation to a molecule

Parameters:
  • name – descriptor name

  • mol – RDKit molecule

Returns:

class RDKitDescriptors[source]

Calculate RDKit descriptors

Initialize the RDKitDescriptors class.

Parameters:

self (RDKitDescriptors) – An instance of the RDKitDescriptors class

Returns:

None

Return type:

None

calc_mol(mol)[source]

Calculate descriptors for an RDKit molecule

Parameters:

mol (Mol) – RDKit molecule

Return type:

ndarray

Returns:

a numpy array with descriptors

calc_smiles(smiles)[source]

Calculate descriptors for a SMILES string

Parameters:

smiles (str) – SMILES string

Return type:

ndarray

Returns:

a numpy array with properties

pandas_smiles(smiles_list)[source]

Calculate descriptors for a list of SMILES strings and return them as a pandas DataFrame.

Parameters:

smiles_list (List[str]) – List of SMILES strings

Return type:

DataFrame

Returns:

DataFrame with calculated descriptors. Each row corresponds to a SMILES string and each column to a descriptor.

pandas_mols(mol_list)[source]

Calculate descriptors for a list of RDKit molecules and return them as a pandas DataFrame.

Parameters:

mol_list (List[Mol]) – List of RDKit molecules

Return type:

DataFrame

Returns:

DataFrame with calculated descriptors. Each row corresponds to a molecule and each column to a descriptor.

class RDKitProperties[source]

Calculate RDKit properties

calc_mol(mol)[source]

Calculate properties for an RDKit molecule

Parameters:

mol (Mol) – RDKit molecule

Return type:

ndarray

Returns:

a numpy array with properties

calc_smiles(smi)[source]

Calculate properties for a SMILES string

Parameters:

smi (str) – SMILES string

Return type:

Optional[ndarray]

Returns:

a numpy array with properties

pandas_smiles(smi_list)[source]

Calculates properties for a list of SMILES strings and returns them as a pandas DataFrame.

Parameters:

smi_list (List[str]) – List of SMILES strings

Returns:

DataFrame with calculated properties. Each row corresponds to a SMILES string and each column to a property.

Return type:

pd.DataFrame

pandas_mols(mol_list)[source]

Calculates properties for a list of RDKit molecules and returns them as a pandas DataFrame.

Parameters:

mol_list (List[Mol]) – List of RDKit molecules

Returns:

DataFrame with calculated properties. Each row corresponds to a molecule and each column to a property.

Return type:

pd.DataFrame

class Ro5Calculator[source]

A class used to calculate Lipinski’s Rule of Five properties for a given molecule.

Attributes

namesList[str]

A list of names of the properties to be calculated.

functionsList[Callable[[Mol], float]]

A list of functions used to calculate the properties.

Methods

calc_mol(mol: Mol) -> np.ndarray

Calculates properties for a RDKit molecule.

calc_smiles(smi: str) -> Optional[np.ndarray]

Calculates properties for a SMILES string.

pandas_smiles(smiles_list: List[str]) -> pd.DataFrame

Calculates properties for a list of SMILES strings and returns them as a pandas DataFrame.

pandas_mols(mol_list: List[Mol]) -> pd.DataFrame

Calculates properties for a list of RDKit molecules and returns them as a pandas DataFrame.

Initialize the Ro5Calculator class.

type self:

Ro5Calculator

param self:

An instance of the Ro5Calculator class

type self:

Ro5Calculator

return:

None

rtype:

None

calc_mol(mol)[source]

Calculate properties for a RDKit molecule

Parameters:

mol (Mol) – RDKit molecule

Returns:

a numpy array with properties

Return type:

np.ndarray

calc_smiles(smi)[source]

Calculate properties for a SMILES string

Parameters:

smi (str) – SMILES string

Returns:

a numpy array with properties

Return type:

Optional[np.ndarray]

pandas_smiles(smiles_list)[source]

Calculates properties for a list of SMILES strings and returns them as a pandas DataFrame.

Parameters:

smiles_list (List[str]) – List of SMILES strings

Returns:

DataFrame with calculated properties. Each row corresponds to a SMILES string and each column to a property.

Return type:

pd.DataFrame

pandas_mols(mol_list)[source]

Calculates properties for a list of RDKit molecules and returns them as a pandas DataFrame.

Parameters:

mol_list (List[Mol]) – List of RDKit molecules

Returns:

DataFrame with calculated properties. Each row corresponds to a molecule and each column to a property.

Return type:

pd.DataFrame