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
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
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, property_filter_file=None, smarts_filter_file=None, descriptors='')