MolecularDiffusion.utils.shepherd_score.pharm_utils.pharmacophore

Generate pharmacophores from a RDKit conformer.

Parts of code adapted from Francois Berenger / Tsuda Lab and RDKit.

References:

Attributes

Functions

find_hydrophobes(mol[, cluster_hydrophobic])

Find hydrophobes and cluster them.

get_pharmacophores(→ Tuple[numpy.ndarray, ...)

Get the identity, anchor positions, and relative unit vectors for each pharmacophore.

get_pharmacophores_dict(→ Dict)

Get the positions of pharmacophore anchors and their associated unit vectors.

pattern_of_smarts(s)

Module Contents

MolecularDiffusion.utils.shepherd_score.pharm_utils.pharmacophore.find_hydrophobes(mol: rdkit.Chem.rdchem.Mol, cluster_hydrophobic: bool = True)

Find hydrophobes and cluster them.

Parameters:
  • mol (rdkit Mol object with a conformer.)

  • cluster_hydrophobic (bool (default=True) to cluster hydrophobic atoms if they fall within 2A.)

Return type:

list of tuples containing coordinates for the locations for each hydrophobe.

MolecularDiffusion.utils.shepherd_score.pharm_utils.pharmacophore.get_pharmacophores(mol: rdkit.Chem.rdchem.Mol, multi_vector: bool = True, exclude: List[int] = [], check_access: bool = False, scale: float = 1.0) Tuple[numpy.ndarray, numpy.ndarray, numpy.ndarray]

Get the identity, anchor positions, and relative unit vectors for each pharmacophore.

Pharmacophore ordering for indexing: (‘Acceptor’, ‘Donor’, ‘Aromatic’, ‘Hydrophobe’, ‘Cation’, ‘Anion’, ‘ZnBinder’)

Notes

The check_access parameter is currently based on whether interaction points sampled from a sphere’s surface with a radius of 1.8A from the acceptor/donor atom falls outside the solvent accessible surface defined by the vdW radius + 0.8A of the neighboring atoms. This works for buried acceptors/donors, but may be prone to false positives. For example, CN(C)C would have its sole HBA rejected. Other approaches such as buried volume should be considered in the future.

Parameters:
  • mol (rdkit.Chem.Mol) – RDKit Mol object with conformer.

  • multi_vector (bool, optional) – Whether to represent pharmacophores with multiple vectors. Default is True.

  • exclude (list, optional) – List of hydrogen indices to not include as a HBD. Default is [].

  • check_access (bool, optional) – Check if HBD/HBA are accessible to the molecular surface. Default is False.

  • scale (float, optional) – Length of a pharmacophore vector in Angstroms. Default is 1.0.

Returns:

  • X (np.ndarray) – Identity of pharmacophore corresponding to the indexing order, shape (N,).

  • P (np.ndarray) – Anchor positions of each pharmacophore, shape (N, 3).

  • V (np.ndarray) – Unit vectors in a relative position to the anchor positions, shape (N, 3). Adding P and V results in the position of the vector’s extended point.

MolecularDiffusion.utils.shepherd_score.pharm_utils.pharmacophore.get_pharmacophores_dict(mol: rdkit.Chem.rdchem.Mol, multi_vector: bool = True, exclude: List[int] = [], check_access: bool = False, scale: float = 1.0) Dict

Get the positions of pharmacophore anchors and their associated unit vectors.

Returns a dictionary. Adapted from rdkit.Chem.Features.ShowFeats.ShowMolFeats.

Parameters:
  • mol (rdkit.Chem.Mol) – RDKit Mol object with a conformer.

  • multi_vector (bool, optional) – Whether to represent pharmacophores with multiple vectors. Default is True.

  • exclude (list, optional) – List of atom indices to not include as a HBD. Default is [].

  • check_access (bool, optional) – Check if HBD/HBA are accessible to the molecular surface. Default is False.

  • scale (float, optional) – Length of the vector in Angstroms. Default is 1.0.

Returns:

Dictionary with format {'FeatureName': {'P': [(anchor coord), ...], 'V': [(rel. vec), ...]}}.

Return type:

dict

MolecularDiffusion.utils.shepherd_score.pharm_utils.pharmacophore.pattern_of_smarts(s)
MolecularDiffusion.utils.shepherd_score.pharm_utils.pharmacophore.PT
MolecularDiffusion.utils.shepherd_score.pharm_utils.pharmacophore.feature_colors