schrodinger.application.steps.filters module

Filter steps that take input Mols and only outputs Mols that meet certain criteria.

class schrodinger.application.steps.filters.InMemoryUniqueRandomSampleFilter(*args, **kwargs)

Bases: schrodinger.stepper.stepper.Chain

class Settings(*args, _param_type=<object object>, **kwargs)

Bases: schrodinger.models.parameters.CompoundParam

n: int

A parameter of the class.

seed: int

A parameter of the class.

nChanged

A pyqtSignal emitted by instances of the class.

nReplaced

A pyqtSignal emitted by instances of the class.

seedChanged

A pyqtSignal emitted by instances of the class.

seedReplaced

A pyqtSignal emitted by instances of the class.

buildChain()

This method must be implemented by subclasses to build the chain. The chain is built by modifying self.steps. The chain’s composition may be dependent on self.settings.

class schrodinger.application.steps.filters.InMemoryUniqueSmilesFilter(*args, **kwargs)

Bases: schrodinger.application.steps.basesteps.MolReduceStep

Only allow molecules through whose canonical SMILES was not previously encountered.

reduceFunction(mols)

The main computation for this step. This function should take in a iterable of inputs and return an iterable of outputs.

Example:

def reduceFunction(self, words):
    # Find all unique words
    seen_words = set()
    for word in words:
        if word not in seen_words:
            seen_words.add(word)
            yield word
class schrodinger.application.steps.filters.InMemoryRandomSampleFilter(*args, **kwargs)

Bases: schrodinger.application.steps.basesteps.MolReduceStep

A filter that takes a random subsample of molecules. The sample size can be set through the step’s settings n.

Implementation of Algorithm R, but without knowing the size of sequence to sample from. See https://en.wikipedia.org/wiki/Reservoir_sampling

class Settings(*args, _param_type=<object object>, **kwargs)

Bases: schrodinger.models.parameters.CompoundParam

n: int

A parameter of the class.

seed: int

A parameter of the class.

nChanged

A pyqtSignal emitted by instances of the class.

nReplaced

A pyqtSignal emitted by instances of the class.

seedChanged

A pyqtSignal emitted by instances of the class.

seedReplaced

A pyqtSignal emitted by instances of the class.

validateSettings()

Check whether the step settings are valid and return a list of SettingsError and SettingsWarning to report any invalid settings. Default implementation checks that all stepper files are set to valid file paths.

Return type

list[TaskError or TaskWarning]

reduceFunction(mols)

The main computation for this step. This function should take in a iterable of inputs and return an iterable of outputs.

Example:

def reduceFunction(self, words):
    # Find all unique words
    seen_words = set()
    for word in words:
        if word not in seen_words:
            seen_words.add(word)
            yield word
class schrodinger.application.steps.filters.MaeUniqueSmilesFilter(*args, **kwargs)

Bases: schrodinger.application.steps.basesteps.MaeMapStep

Filter structures based on unique seen SMILES.

setUp()

Hook for adding any type of work that needs to happen before any outputs are created.

mapFunction(st)
class schrodinger.application.steps.filters.SmartsFilter(*args, **kwargs)

Bases: schrodinger.application.steps.basesteps.MolMapStep

Only allow molecules that have a SMARTS substructure defined in settings.

class Settings(*args, _param_type=<object object>, **kwargs)

Bases: schrodinger.models.parameters.CompoundParam

core_smarts: str

A parameter of the class.

core_smartsChanged

A pyqtSignal emitted by instances of the class.

core_smartsReplaced

A pyqtSignal emitted by instances of the class.

validateSettings()

Check whether the step settings are valid and return a list of SettingsError and SettingsWarning to report any invalid settings. Default implementation checks that all stepper files are set to valid file paths.

Return type

list[TaskError or TaskWarning]

setUp()

Hook for adding any type of work that needs to happen before any outputs are created.

mapFunction(mol)
class schrodinger.application.steps.filters.ChiralCenterCountFilter(*args, **kwargs)

Bases: schrodinger.application.steps.basesteps.MolMapStep

Only allow molecules through that have the number of chiral centers that falls in the ranged determined by settings’ min_value and max_value, with the borders included.

class Settings(*args, _param_type=<object object>, **kwargs)

Bases: schrodinger.models.parameters.CompoundParam

min_value: int

A parameter of the class.

max_value: int

A parameter of the class.

max_valueChanged

A pyqtSignal emitted by instances of the class.

max_valueReplaced

A pyqtSignal emitted by instances of the class.

min_valueChanged

A pyqtSignal emitted by instances of the class.

min_valueReplaced

A pyqtSignal emitted by instances of the class.

validateSettings()

Check whether the step settings are valid and return a list of SettingsError and SettingsWarning to report any invalid settings. Default implementation checks that all stepper files are set to valid file paths.

Return type

list[TaskError or TaskWarning]

mapFunction(mol)
class schrodinger.application.steps.filters.ProductFilterMixin

Bases: object

A mixin that only allows molecules through whose SMARTS substructure count passes all product filters defined in the settings.

If the settings has cflt_file defined, it will be considered to be the path from which to create the smarts_filter to use.

Since the filter.SmartsFilter can checkStructure with either Mol or Structure objects the behavior is completely determined by the class that it is a mixin for, i.e., either an MolMapStep or MaeMapStep.

class Settings(*args, _param_type=<object object>, **kwargs)

Bases: schrodinger.models.parameters.CompoundParam

Variables
  • smarts_filter – the smarts filter or None

  • cflt_file – if defined the source to

cflt_file: schrodinger.stepper.stepper.StepperFile

A parameter of the class.

cflt_fileChanged

A pyqtSignal emitted by instances of the class.

cflt_fileReplaced

A pyqtSignal emitted by instances of the class.

validateSettings()
setUp()
mapFunction(molecule)
class schrodinger.application.steps.filters.ProductFilter(*args, **kwargs)

Bases: schrodinger.application.steps.filters.ProductFilterMixin, schrodinger.application.steps.basesteps.MolMapStep

See ProductFilterMixin

class schrodinger.application.steps.filters.MaeProductFilter(*args, **kwargs)

Bases: schrodinger.application.steps.filters.ProductFilterMixin, schrodinger.application.steps.basesteps.MaeMapStep

See ProductFilterMixin

class schrodinger.application.steps.filters.PropertyFilter(*args, **kwargs)

Bases: schrodinger.application.steps.basesteps.MolMapStep

Only allows molecules through whose properties pass all property filters defined in the settings.

If the settings has filter_file defined, it will be considered to be the path from which to create the filters to be used.

If the filter filename has the .json extension, it will be interpreted as a JSON filter file of the kind used by a few panels, including PathFinder; that filter format is implemented by schrodinger.ui.qt.filter_dialog_dir.filter_core.

A file without the .json extension is considered to be regular text with the format of the filter file is that of what pathfinder and canvas filter uses, e.g., lines like:

r_rdkit_TPSA > 30.0 < 150.0
i_rdkit_NumRotatableBonds < 10
i_rdkit_NumChiralCenters == 1
r_rdkit_MolWt > 150.0 < 575.0
class Settings(*args, _param_type=<object object>, **kwargs)

Bases: schrodinger.models.parameters.CompoundParam

filter_file: schrodinger.stepper.stepper.StepperFile

A parameter of the class.

filter_fileChanged

A pyqtSignal emitted by instances of the class.

filter_fileReplaced

A pyqtSignal emitted by instances of the class.

validateSettings()

Check whether the step settings are valid and return a list of SettingsError and SettingsWarning to report any invalid settings. Default implementation checks that all stepper files are set to valid file paths.

Return type

list[TaskError or TaskWarning]

setUp()

Hook for adding any type of work that needs to happen before any outputs are created.

mapFunction(mol)
class schrodinger.application.steps.filters.PropertyRangeSettings(*args, _param_type=<object object>, **kwargs)

Bases: schrodinger.models.parameters.CompoundParam

The property_ranges dict should have, as keys, the property key and, as values, the range, [min, max] of values allowed for that property where the ends are included in what is considered to be acceptable.

Override _appendPropertyNameIssues to validate the property name, i.e., a key in the property_ranges dict.

property_ranges: Dict[str, List[float]]

A parameter of the class.

validate(step)

Validate the settings on behalf of a step.

Parameters

step – stepper._BaseStep

Return type

list[TaskError or TaskWarning]

property_rangesChanged

A pyqtSignal emitted by instances of the class.

property_rangesReplaced

A pyqtSignal emitted by instances of the class.

class schrodinger.application.steps.filters.ProfileSettings(*args, _param_type=<object object>, **kwargs)

Bases: schrodinger.application.steps.filters.PropertyRangeSettings

The property_ranges should be a dict where the key is the property name (a string that exists in filtering.DESCRIPTORS_DICT). The value should be the range of values allowed for that property where the ends are included in what is considered to be acceptable.

property_ranges: Dict[str, List[float]]

A parameter of the class.

property_rangesChanged

A pyqtSignal emitted by instances of the class.

property_rangesReplaced

A pyqtSignal emitted by instances of the class.

class schrodinger.application.steps.filters.ProfileFilter(*args, **kwargs)

Bases: schrodinger.application.steps.basesteps.MolMapStep

A product filter where the property profile is defined by the settings.

The complexity_max is a dictionary with the property name as key and the value above which the complexity is incremented. If the total complexity exceeds max_complexity the molecule is rejected.

Example in yaml notation:

ProfileFilter:
    property_ranges:
        MolWt: [250, 500]
        FractionCSP3: [0, 1]
        AlogP: [-1, 4]
        NumRotatableBonds: &NumRotatableBonds_range [0, 10]
See

ProfileSettings

class Settings(*args, _param_type=<object object>, **kwargs)

Bases: schrodinger.application.steps.filters.ProfileSettings

core_complexity: Dict[str, int]

A parameter of the class.

max_complexity: int

A parameter of the class.

large_ring_cutoff: int

A parameter of the class.

validate(step)

Validate the settings on behalf of a step.

Parameters

step – stepper._BaseStep

Return type

list[TaskError or TaskWarning]

core_complexityChanged

A pyqtSignal emitted by instances of the class.

core_complexityReplaced

A pyqtSignal emitted by instances of the class.

large_ring_cutoffChanged

A pyqtSignal emitted by instances of the class.

large_ring_cutoffReplaced

A pyqtSignal emitted by instances of the class.

max_complexityChanged

A pyqtSignal emitted by instances of the class.

max_complexityReplaced

A pyqtSignal emitted by instances of the class.

property_rangesChanged

A pyqtSignal emitted by instances of the class.

property_rangesReplaced

A pyqtSignal emitted by instances of the class.

validateSettings()

Check whether the step settings are valid and return a list of SettingsError and SettingsWarning to report any invalid settings. Default implementation checks that all stepper files are set to valid file paths.

Return type

list[TaskError or TaskWarning]

setUp()

Hook for adding any type of work that needs to happen before any outputs are created.

mapFunction(mol)
class schrodinger.application.steps.filters.FepFilter(*args, **kwargs)

Bases: schrodinger.application.steps.basesteps.MolMapStep

Only allow molecules through that are amenable to FEP calculations.

A molecule is considered to be amenable if it is an acceptable perturbation with settings.min_edges other molecules in the self.settings.ref_mols.

A perturbation is considered acceptable if the number of heavy atoms in the perturbation from the maximum common substructure (MCS) is less than or equal to settings.max_hac_diff.

The settings contain the following parameters:

  • fep_references_file: the title-less SMILES file with SMILES in the 0th column (the way that Maestro exports them…)

  • ref_mols: the list of references (Chem.Mol objects)

  • min_edges: the minimum number of edges needed

  • max_hac_diff: the maximum number of heavy atoms not part of the MCS

if the fep_references_file is defined, the ref_mols will be ignored.

class Settings(*args, _param_type=<object object>, **kwargs)

Bases: schrodinger.models.parameters.CompoundParam

fep_references_file: schrodinger.stepper.stepper.StepperFile

A parameter of the class.

ref_mols: List[rdkit.Chem.rdchem.Mol]

A parameter of the class.

min_edges: int

A parameter of the class.

max_hac_diff: int

A parameter of the class.

fep_references_fileChanged

A pyqtSignal emitted by instances of the class.

fep_references_fileReplaced

A pyqtSignal emitted by instances of the class.

max_hac_diffChanged

A pyqtSignal emitted by instances of the class.

max_hac_diffReplaced

A pyqtSignal emitted by instances of the class.

min_edgesChanged

A pyqtSignal emitted by instances of the class.

min_edgesReplaced

A pyqtSignal emitted by instances of the class.

ref_molsChanged

A pyqtSignal emitted by instances of the class.

ref_molsReplaced

A pyqtSignal emitted by instances of the class.

validateSettings()

Check whether the step settings are valid and return a list of SettingsError and SettingsWarning to report any invalid settings. Default implementation checks that all stepper files are set to valid file paths.

Return type

list[TaskError or TaskWarning]

setUp()

Hook for adding any type of work that needs to happen before any outputs are created.

mapFunction(mol)
class schrodinger.application.steps.filters.RangeFilter(*args, **kwargs)

Bases: schrodinger.application.steps.basesteps.MolMapStep

A filter that only passes the Mol part of a ScoredMol objects if the score is in the range determined by settings’ min_value and max_value, with borders included.

Input

alias of schrodinger.application.steps.dataclasses.ScoredMol

InputSerializer

alias of schrodinger.application.steps.dataclasses.ScoredMolSerializer

class Settings(*args, _param_type=<object object>, **kwargs)

Bases: schrodinger.models.parameters.CompoundParam

min_value: float

A parameter of the class.

max_value: float

A parameter of the class.

max_valueChanged

A pyqtSignal emitted by instances of the class.

max_valueReplaced

A pyqtSignal emitted by instances of the class.

min_valueChanged

A pyqtSignal emitted by instances of the class.

min_valueReplaced

A pyqtSignal emitted by instances of the class.

validateSettings()

Check whether the step settings are valid and return a list of SettingsError and SettingsWarning to report any invalid settings. Default implementation checks that all stepper files are set to valid file paths.

Return type

list[TaskError or TaskWarning]

mapFunction(scored_mol)
class schrodinger.application.steps.filters.ScoreFilter(scorer_class=None, **kwargs)

Bases: schrodinger.application.steps.basesteps.MolMolWorkflow

A base class a for step consisting of a self.SCORER_CLASS instance followed by a RangeFilter.

Variables

SCORER_CLASS (ScorerStep) – the class that will compute the value to be filtered

class Settings(*args, _param_type=<object object>, **kwargs)

Bases: schrodinger.models.parameters.CompoundParam

score_filter: dict

A parameter of the class.

score_filterChanged

A pyqtSignal emitted by instances of the class.

score_filterReplaced

A pyqtSignal emitted by instances of the class.

__init__(scorer_class=None, **kwargs)
SCORER_CLASS

alias of NotImplementedError

buildChain()

This method must be implemented by subclasses to build the chain. The chain is built by modifying self.steps. The chain’s composition may be dependent on self.settings.

class schrodinger.application.steps.filters.ScoreFilterChain(*args, **kwargs)

Bases: schrodinger.application.steps.basesteps.MolMolWorkflow

A base class for chains consisting of ScoreFilter

class Settings(*args, _param_type=<object object>, **kwargs)

Bases: schrodinger.models.parameters.CompoundParam

score_filters: List[Dict]

A parameter of the class.

score_filtersChanged

A pyqtSignal emitted by instances of the class.

score_filtersReplaced

A pyqtSignal emitted by instances of the class.

SCORER_CLASS

alias of NotImplementedError

validateSettings()

Check whether the chain settings are valid and return a list of SettingsError and SettingsWarning to report any invalid settings. Default implementation simply returns problems from all child steps.

Return type

list[TaskError or TaskWarning]

buildChain()

This method must be implemented by subclasses to build the chain. The chain is built by modifying self.steps. The chain’s composition may be dependent on self.settings.

class schrodinger.application.steps.filters.LigandMLScoreFilterChain(*args, **kwargs)

Bases: schrodinger.application.steps.filters.ScoreFilterChain

A variable length chain of LigandMLFilters, allowed to be empty.

The configuration information is a list of LigandMLScorer settings combined with those of a RangeFilter for each ligand ML model to use.

Example yaml file configuration:

LigandMLScoreFilterChain:
  score_filters:
    - ml_file: model1.qzip
      min_value: -3.0
      max_value: 2.0
    - ml_file: model2.qzip
      max_value: 200
SCORER_CLASS

alias of schrodinger.application.steps.scorers.LigandMLScorer

class schrodinger.application.steps.filters.MaxMolWtFilter(*args, **kwargs)

Bases: schrodinger.application.steps.basesteps.MolMapStep

A step that filters Chem.Mol objects by molecular weight.

Note that if no max_mol_wt is set in the settings, this filter will just become an identity step.

class Settings(*args, _param_type=<object object>, **kwargs)

Bases: schrodinger.models.parameters.CompoundParam

max_mol_wt: float

A parameter of the class.

max_mol_wtChanged

A pyqtSignal emitted by instances of the class.

max_mol_wtReplaced

A pyqtSignal emitted by instances of the class.

validateSettings()
Returns

A settings error if the max mol. weight setting is not properly set, None otherwise.

Return type

List[stepper.SettingsError] or None

mapFunction(mol)