schrodinger.application.pathfinder.filtering module¶
PathFinder functions for filtering and for computing descriptors, including similarity metrics.
-
schrodinger.application.pathfinder.filtering.NumChiralCenters(mol)¶ Wrapper for Chem.FindMolChiralCenters, so we can include it in DESCRIPTORS_DICT and pretend it’s an RDKit descriptor.
- Return type
int
-
schrodinger.application.pathfinder.filtering.TPSAIncludeSandP(mol)¶ The TPSA including S and P.
- Return type
float
-
schrodinger.application.pathfinder.filtering.MVCorrMW(mol)¶ The Molecular weight corrected for McGowan Volume, so it can be added to the DESCRIPTORS_DICT and pretend it is an RDKit descriptor.
- Return type
float
-
schrodinger.application.pathfinder.filtering.LongestConsecutiveRBCount(mol)¶ The maximum number of consecutive rotatable bonds in the molecule.
- Return type
int
-
schrodinger.application.pathfinder.filtering.MeanConsecutiveRBCount(mol)¶ The mean value of consecutive rotatable bonds in the molecule.
- Return type
int
-
schrodinger.application.pathfinder.filtering.LargestRingAtomCount(mol)¶ The size of the largest ring in mol.
- Return type
int
-
schrodinger.application.pathfinder.filtering.AlogP(mol)¶ The AlogP for the molecule as computed by canvas.
The canvas calculation is based on J. Phys. Chem A 1998, 102, 3762-3772. Prediction of Hydrophobic (Lipophilic) Properties of Small Organic Molecules. Using Fragmental Methods: An Analysis of ALOGP and CLOGP Methods. A. K. Ghose et al.
- Return type
float
-
schrodinger.application.pathfinder.filtering.NumSAtoms(mol)¶ The number of S atoms in the molecule.
- Return type
int
-
schrodinger.application.pathfinder.filtering.NumAlkyne(mol)¶ The number of alkynes in the molecule.
- Return type
int
-
schrodinger.application.pathfinder.filtering.FractionAromatic(mol)¶ The fraction of heavy atoms in the molecule that are aromatic atoms.
- Return type
float
-
schrodinger.application.pathfinder.filtering.logS(mol)¶ Calculate ESOL based on descriptors in the Delaney paper, coefficient refit for RDKit.
- Return type
float
-
schrodinger.application.pathfinder.filtering.NumNonSpiroCR4(mol)¶ The number of non spiro quaternary carbons attached to C, N, O or S.
- Return type
int
-
schrodinger.application.pathfinder.filtering.NumFiveFiveRings(mol)¶ The number of edge fused 5 atom ring pairs.
- Returns
int
-
class
schrodinger.application.pathfinder.filtering.JSONFilterAdapter(filename)¶ Bases:
objectAn adapter to make a schrodinger.ui.qt.filter_dialog_dir.filter_core.Filter look like a schrodinger.structutils.filter.Filter.
-
__init__(filename)¶ Create a filter object given a JSON filename.
-
filter(mols)¶ A generator that yields only the mols that pass the filter conditions.
-
getPropertyNames()¶ Return the set of properties used by all the filters in this object.
- Return type
set of str
-
-
class
schrodinger.application.pathfinder.filtering.ComparableMol(mol, prop, reverse=False)¶ Bases:
objectA simple wrapper for a Mol object, adding the __lt__ operator so the mols can be put in a heap or sorted. Any double property may be used as the key.
-
__init__(mol, prop, reverse=False)¶ - Parameters
mol (rdkit.Chem.rdchem.Mol) – molecule
prop (str) – key property name
reverse (bool) – if true, invert the the comparison (use > instead of <)
-
-
schrodinger.application.pathfinder.filtering.keep_top_n(products, nkeep, nsample, prop, reverse=False)¶ A generator that yields only the best
nkeepmolecules out of the firstnsamplemolecules inproducts, compared byprop. By default, the highest values ofpropare kept; whenreverseis true, the lowest values are kept instead.NOTE: this function holds all
nkeepmolecules in memory at once.- Parameters
products (iterator of rdkit.Chem.Mol) – molecules to filter
nkeep (int) – maximum number of molecules to yield
nsample (int) – maximum number of molecules to consume from
productsprop (str) – key property name
reverse (bool) – if true, keep the lowest instead of the highest values
- Returns
filtered/sorted products
- Return type
generator of rdkit.Chem.Mol
-
schrodinger.application.pathfinder.filtering.get_filter(filename, smarts_filter=False)¶ Factory function to generate a Filter-like object from a filename. Supports JSON and propfilter-like property filters files as well as canvasSearch-like SMARTS filter files.
- Parameters
filename (str) – filename
smarts_filter (bool) – is this a SMARTS filter file?
- Returns
filter object
- Return type
-
schrodinger.application.pathfinder.filtering.get_fingerprint(mol)¶ A cached version of RDKit’s FingerprintMol, so if it’s called again with a recently used molecule, we’ll save the recalculation of the fingerprint.
- Parameters
mol (rdkit.Chem.rdchem.Mol) – molecule
- Returns
fingerprint
- Return type
rdkit.DataStructs.cDataStructs.ExplicitBitVect
-
schrodinger.application.pathfinder.filtering.compute_similarity(mol1, mol2)¶ Compute the Tanimoto similarity between the RDKit fingerprints of two molecules.
- Parameters
mol1 (rdkit.Chem.rdchem.Mol) – molecule
mol2 (rdkit.Chem.rdchem.Mol) – molecule
- Returns
similarity
- Return type
float
-
schrodinger.application.pathfinder.filtering.add_descriptors(mol, descriptor_names, refs)¶ Compute the requested RDKit descriptors and store them as properties of the Mol object.
- Parameters
refs (sequence of Mol) – list of reference molecules (only used if similarity descriptors are requested)
- Returns
input mol (modified in place)
- Return type
Mol
-
schrodinger.application.pathfinder.filtering.add_descriptors_gen(mols, descriptors, refs=None)¶ Given a generator of Mol, return a generator of Mol with descriptors added. The original Mol objects are modified.
- Parameters
descriptors (sequence of str) – names of the descriptors to add
refs (sequence of Mol) – list of reference molecules (only used if similarity descriptors are requested)
-
schrodinger.application.pathfinder.filtering.add_filters(products, ref_mols_file=None, ref_mols=None, property_filter_file=None, smarts_filter_file=None, descriptors='')¶