schrodinger.application.transforms.screening module¶
- class schrodinger.application.transforms.screening.FixedSizeSamplingConfig(*, sample_size: int, distinct: bool = False, seed: int | None = None)¶
Bases:
BaseModelConfiguration for fixed sampling before an expensive screening transform.
- Parameters:
sample_size – fixed number of inputs to sample
distinct – deduplicate inputs before sampling
seed – random seed for reproducible approximate sampling
- sample_size: int¶
- distinct: bool¶
- seed: int | None¶
- model_config: ClassVar[ConfigDict] = {'frozen': True}¶
Configuration for the model, should be a dictionary conforming to [
ConfigDict][pydantic.config.ConfigDict].
- class schrodinger.application.transforms.screening.ScreenMoleculesConfig(*, property_space: schrodinger.application.transforms.filters.PropertySpaceFilterConfig | None = None, complexity: schrodinger.application.transforms.filters.ComplexityFilterConfig | None = None, substructure_filter_path: ~typing.Optional[~pathlib.Path] = None, fep_amenability: schrodinger.application.transforms.filters.FepAmenableConfig | None = None, similarity: schrodinger.application.transforms.filters.RDKitPathTanimotoSimilarityFilterConfig | None = None, pre_ligprep_sampling: schrodinger.application.transforms.screening.FixedSizeSamplingConfig | schrodinger.seam.transforms.samplers.ThrottleConfig | None = None, ligprep: ~schrodinger.application.transforms.ligprep.core.LigPrepConfig = <factory>, ligprep_property_ranges: dict[typing.Annotated[str, AfterValidator(func=<function _number_property_validator at 0x7d07c41e58a0>)], typing.Annotated[tuple[int | float, int | float], AfterValidator(func=<function _range_validator at 0x7d07c41e5760>)]] = <factory>, charged_nitrogen_pka: schrodinger.application.transforms.filters.ChargedNHpKaFilterConfig | None = None, pre_docking_sampling: schrodinger.application.transforms.screening.FixedSizeSamplingConfig | schrodinger.seam.transforms.samplers.ThrottleConfig | None = None, docking: ~schrodinger.application.transforms.dock.DockingConfig, hypothesis: schrodinger.application.transforms.filters.HypothesisFilterConfig | None = None)¶
Bases:
BaseModelConfiguration for
ScreenMolecules.Optional filter configurations enable their corresponding transforms. The supplied substructure filter file is applied both before LigPrep and before docking.
ligprep_property_rangesfilters numeric properties available on the LigPrep output structures.Distinct pre-LigPrep sampling is supported when the candidates are molecules. Similarity filtering first converts them to structures, which cannot safely be passed to Beam’s generic distinct operation. Pre-docking candidates have already been deduplicated by molecular SMILES, so distinct pre-docking sampling is unnecessary and unsupported.
- property_space: PropertySpaceFilterConfig | None¶
- complexity: ComplexityFilterConfig | None¶
- substructure_filter_path: Optional[Path]¶
- fep_amenability: FepAmenableConfig | None¶
- similarity: RDKitPathTanimotoSimilarityFilterConfig | None¶
- pre_ligprep_sampling: FixedSizeSamplingConfig | ThrottleConfig | None¶
- ligprep: LigPrepConfig¶
- ligprep_property_ranges: dict[typing.Annotated[str, AfterValidator(func=<function _number_property_validator at 0x7d07c41e58a0>)], typing.Annotated[tuple[int | float, int | float], AfterValidator(func=<function _range_validator at 0x7d07c41e5760>)]]¶
- charged_nitrogen_pka: ChargedNHpKaFilterConfig | None¶
- pre_docking_sampling: FixedSizeSamplingConfig | ThrottleConfig | None¶
- docking: DockingConfig¶
- hypothesis: HypothesisFilterConfig | None¶
- model_config: ClassVar[ConfigDict] = {'frozen': True}¶
Configuration for the model, should be a dictionary conforming to [
ConfigDict][pydantic.config.ConfigDict].
- class schrodinger.application.transforms.screening.ScreenMoleculesOutputs(ligprep_candidates: PCollection[rdkit.Chem.rdchem.Mol | Structure], after_ligprep: PCollection[Structure], docking_inputs: PCollection[Structure], after_docking: PCollection[Structure], main: PCollection[Structure])¶
Bases:
objectIntermediate and final PCollections available for reporting and diagnostic side branches.
Additional transforms may be attached to the intermediate collections without coupling
ScreenMoleculesto a particular metrics backend or workflow-specific diagnostic behavior.ligprep_candidatesMolecules or structures that passed all pre-LigPrep filters, before pre-LigPrep sampling or reshuffling. This collection contains molecules unless similarity filtering is enabled, in which case it contains structures.
after_ligprepStructures after LigPrep, structure deduplication, and LigPrep-property filtering, but before the charged-nitrogen and second substructure filters.
docking_inputsStructures after all pre-docking filters and pre-docking sampling or reshuffling. These are the structures supplied to docking.
after_dockingStructures produced by docking, before the optional hypothesis filter.
mainFinal structures after the optional hypothesis filter.
- class schrodinger.application.transforms.screening.ScreenMolecules(*, label: str | None = None, funnel_input_label: str = 'Inputs', substructure_filter: SubstructureFilter | None = None, **kwargs)¶
Bases:
PTransformWithConfigApply a configurable molecular screening cascade.
The cascade filters RDKit molecules, converts them to structures, prepares them with LigPrep, filters the prepared structures, docks them, and optionally applies a Phase hypothesis filter.
- Parameters:
label – optional Beam transform label; this is a constructor-only argument and is not part of
ScreenMoleculesConfigfunnel_input_label – label used for the funnel’s input collection; this is also a constructor-only argument
substructure_filter – optional prepared substructure filter to apply before LigPrep and before docking; this is a constructor-only argument and cannot be combined with
substructure_filter_path
Example usage:
import apache_beam as beam from schrodinger.application.transforms.screening import ( ScreenMolecules) from schrodinger.application.transforms.screening import ( ScreenMoleculesConfig) from schrodinger.application.transforms.dock import DockingConfig config = ScreenMoleculesConfig( docking=DockingConfig(grid_path='receptor.zip')) screened = ( mols | ScreenMolecules.from_config(config) | 'Reshuffle screened molecules' >> beam.Reshuffle() )
A caller that has already prepared a substructure filter can inject it without writing another filter file:
outputs = mols | ScreenMolecules.from_config( config, substructure_filter=prepared_filter)
Intermediate PCollections are available for reporting and diagnostic transforms:
outputs = mols | ScreenMolecules.from_config(config) screened = outputs.main after_ligprep_count = ( outputs.after_ligprep | 'Count after LigPrep' >> beam.combiners.Count.Globally() )
- config_class¶
alias of
ScreenMoleculesConfig
- LIGPREP_CANDIDATES_COUNT_SOURCE = 'ligprep_candidates'¶
- AFTER_LIGPREP_COUNT_SOURCE = 'after_ligprep'¶
- AFTER_DOCKING_COUNT_SOURCE = 'after_docking'¶
- MAIN_COUNT_SOURCE = 'main'¶
- __init__(*, label: str | None = None, funnel_input_label: str = 'Inputs', substructure_filter: SubstructureFilter | None = None, **kwargs)¶
Initialize with constructor-only runtime options.
- display_data()¶
Return configuration and filter-funnel metadata.
- expand(mols)¶
Expand the cascade and return its outputs.
- schrodinger.application.transforms.screening.screening_output_metrics(group_path: tuple[str, ...], transform_label: str, *, before_ligprep_key: str, after_ligprep_key: str, after_docking_key: str, output_key: str) OutputMetricsDisplayData¶
Declare output metrics for the standard screening outputs.
- Parameters:
group_path – common prefix of each output metric path
transform_label – label of
ScreenMoleculesrelative to the transform declaring the metricsbefore_ligprep_key – key for candidates before LigPrep sampling
after_ligprep_key – key for prepared, deduplicated structures
after_docking_key – key for structures produced by docking
output_key – key for the final filtered structures