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.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.LargestRingAtomCount(mol)

The size of the largest ring in mol.

Return type:int
schrodinger.application.pathfinder.filtering.AlogP

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
class schrodinger.application.pathfinder.filtering.JSONFilterAdapter(filename)

Bases: object

An 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: object

A 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 nkeep molecules out of the first nsample molecules in products, compared by prop. By default, the highest values of prop are kept; when reverse is true, the lowest values are kept instead.

NOTE: this function holds all nkeep molecules 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 products
  • prop (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.structutils.filter.Filter

schrodinger.application.pathfinder.filtering.get_fingerprint

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='')