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:
Chain- class Settings(*args, _param_type=<object object>, **kwargs)¶
Bases:
CompoundParam- n: int¶
A parameter of the class.
- seed: int¶
A parameter of the class.
- nChanged¶
A
pyqtSignalemitted by instances of the class.
- nReplaced¶
A
pyqtSignalemitted by instances of the class.
- seedChanged¶
A
pyqtSignalemitted by instances of the class.
- seedReplaced¶
A
pyqtSignalemitted 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:
MolReduceStepOnly 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:
MolReduceStepA 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:
CompoundParam- n: int¶
A parameter of the class.
- seed: int¶
A parameter of the class.
- nChanged¶
A
pyqtSignalemitted by instances of the class.
- nReplaced¶
A
pyqtSignalemitted by instances of the class.
- seedChanged¶
A
pyqtSignalemitted by instances of the class.
- seedReplaced¶
A
pyqtSignalemitted by instances of the class.
- validateSettings()¶
Check whether the step settings are valid and return a list of
SettingsErrorandSettingsWarningto 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:
MaeMapStepFilter 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:
MolMapStepOnly allow molecules that have a SMARTS substructure defined in settings.
- class Settings(*args, _param_type=<object object>, **kwargs)¶
Bases:
CompoundParam- core_smarts: str¶
A parameter of the class.
- core_smartsChanged¶
A
pyqtSignalemitted by instances of the class.
- core_smartsReplaced¶
A
pyqtSignalemitted by instances of the class.
- validateSettings()¶
Check whether the step settings are valid and return a list of
SettingsErrorandSettingsWarningto 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:
MolMapStepOnly 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:
CompoundParam- min_value: int¶
A parameter of the class.
- max_value: int¶
A parameter of the class.
- max_valueChanged¶
A
pyqtSignalemitted by instances of the class.
- max_valueReplaced¶
A
pyqtSignalemitted by instances of the class.
- min_valueChanged¶
A
pyqtSignalemitted by instances of the class.
- min_valueReplaced¶
A
pyqtSignalemitted by instances of the class.
- validateSettings()¶
Check whether the step settings are valid and return a list of
SettingsErrorandSettingsWarningto 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:
objectA mixin that only allows molecules through whose SMARTS substructure count passes all product filters defined in the settings.
If the settings has
cflt_filedefined, it will be considered to be the path from which to create thesmarts_filterto use.Since the
filter.SmartsFiltercancheckStructurewith eitherMolorStructureobjects the behavior is completely determined by the class that it is a mixin for, i.e., either anMolMapSteporMaeMapStep.- class Settings(*args, _param_type=<object object>, **kwargs)¶
Bases:
CompoundParam- Variables:
smarts_filter – the smarts filter or None
cflt_file – if defined the source to
- cflt_file: StepperFile¶
A parameter of the class.
- cflt_fileChanged¶
A
pyqtSignalemitted by instances of the class.
- cflt_fileReplaced¶
A
pyqtSignalemitted by instances of the class.
- validateSettings()¶
- setUp()¶
- mapFunction(molecule)¶
- class schrodinger.application.steps.filters.ProductFilter(*args, **kwargs)¶
Bases:
ProductFilterMixin,MolMapStep
- class schrodinger.application.steps.filters.MaeProductFilter(*args, **kwargs)¶
Bases:
ProductFilterMixin,MaeMapStep
- class schrodinger.application.steps.filters.PropertyFilter(*args, **kwargs)¶
Bases:
MolMapStepOnly allows molecules through whose properties pass all property filters defined in the settings.
If the settings has
filter_filedefined, 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:
CompoundParam- filter_file: StepperFile¶
A parameter of the class.
- filter_fileChanged¶
A
pyqtSignalemitted by instances of the class.
- filter_fileReplaced¶
A
pyqtSignalemitted by instances of the class.
- validateSettings()¶
Check whether the step settings are valid and return a list of
SettingsErrorandSettingsWarningto 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:
CompoundParamThe
property_rangesdict 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
_appendPropertyNameIssuesto validate the property name, i.e., a key in theproperty_rangesdict.- 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
pyqtSignalemitted by instances of the class.
- property_rangesReplaced¶
A
pyqtSignalemitted by instances of the class.
- class schrodinger.application.steps.filters.ProfileSettings(*args, _param_type=<object object>, **kwargs)¶
Bases:
PropertyRangeSettingsThe
property_rangesshould be a dict where the key is the property name (a string that exists infiltering.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
pyqtSignalemitted by instances of the class.
- property_rangesReplaced¶
A
pyqtSignalemitted by instances of the class.
- class schrodinger.application.steps.filters.ProfileFilter(*args, **kwargs)¶
Bases:
MolMapStepA product filter where the property profile is defined by the settings.
The
complexity_maxis a dictionary with the property name as key and the value above which the complexity is incremented. If the total complexity exceedsmax_complexitythe 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:
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
pyqtSignalemitted by instances of the class.
- core_complexityReplaced¶
A
pyqtSignalemitted by instances of the class.
- large_ring_cutoffChanged¶
A
pyqtSignalemitted by instances of the class.
- large_ring_cutoffReplaced¶
A
pyqtSignalemitted by instances of the class.
- max_complexityChanged¶
A
pyqtSignalemitted by instances of the class.
- max_complexityReplaced¶
A
pyqtSignalemitted by instances of the class.
- property_rangesChanged¶
A
pyqtSignalemitted by instances of the class.
- property_rangesReplaced¶
A
pyqtSignalemitted by instances of the class.
- validateSettings()¶
Check whether the step settings are valid and return a list of
SettingsErrorandSettingsWarningto 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:
MolMapStepOnly 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_edgesother molecules in theself.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_fileis defined, theref_molswill be ignored.- class Settings(*args, _param_type=<object object>, **kwargs)¶
Bases:
CompoundParam- fep_references_file: StepperFile¶
A parameter of the class.
- ref_mols: List[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
pyqtSignalemitted by instances of the class.
- fep_references_fileReplaced¶
A
pyqtSignalemitted by instances of the class.
- max_hac_diffChanged¶
A
pyqtSignalemitted by instances of the class.
- max_hac_diffReplaced¶
A
pyqtSignalemitted by instances of the class.
- min_edgesChanged¶
A
pyqtSignalemitted by instances of the class.
- min_edgesReplaced¶
A
pyqtSignalemitted by instances of the class.
- ref_molsChanged¶
A
pyqtSignalemitted by instances of the class.
- ref_molsReplaced¶
A
pyqtSignalemitted by instances of the class.
- validateSettings()¶
Check whether the step settings are valid and return a list of
SettingsErrorandSettingsWarningto 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:
MolMapStepA 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.
- InputSerializer¶
alias of
ScoredMolSerializer
- class Settings(*args, _param_type=<object object>, **kwargs)¶
Bases:
CompoundParam- min_value: float¶
A parameter of the class.
- max_value: float¶
A parameter of the class.
- max_valueChanged¶
A
pyqtSignalemitted by instances of the class.
- max_valueReplaced¶
A
pyqtSignalemitted by instances of the class.
- min_valueChanged¶
A
pyqtSignalemitted by instances of the class.
- min_valueReplaced¶
A
pyqtSignalemitted by instances of the class.
- validateSettings()¶
Check whether the step settings are valid and return a list of
SettingsErrorandSettingsWarningto 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:
MolMolWorkflowA base class a for step consisting of a
self.SCORER_CLASSinstance followed by aRangeFilter.- Variables:
SCORER_CLASS (ScorerStep) – the class that will compute the value to be filtered
- class Settings(*args, _param_type=<object object>, **kwargs)¶
Bases:
CompoundParam- score_filter: dict¶
A parameter of the class.
- score_filterChanged¶
A
pyqtSignalemitted by instances of the class.
- score_filterReplaced¶
A
pyqtSignalemitted 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:
MolMolWorkflowA base class for chains consisting of
ScoreFilter- class Settings(*args, _param_type=<object object>, **kwargs)¶
Bases:
CompoundParam- score_filters: List[Dict]¶
A parameter of the class.
- score_filtersChanged¶
A
pyqtSignalemitted by instances of the class.
- score_filtersReplaced¶
A
pyqtSignalemitted by instances of the class.
- SCORER_CLASS¶
alias of
NotImplementedError
- validateSettings()¶
Check whether the chain settings are valid and return a list of
SettingsErrorandSettingsWarningto 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:
ScoreFilterChainA variable length chain of LigandMLFilters, allowed to be empty.
The configuration information is a list of
LigandMLScorersettings combined with those of aRangeFilterfor 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
LigandMLScorer
- class schrodinger.application.steps.filters.MaxMolWtFilter(*args, **kwargs)¶
Bases:
MolMapStepA 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:
CompoundParam- max_mol_wt: float¶
A parameter of the class.
- max_mol_wtChanged¶
A
pyqtSignalemitted by instances of the class.
- max_mol_wtReplaced¶
A
pyqtSignalemitted 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[SettingsError] or None
- mapFunction(mol)¶