schrodinger.application.transforms.ligprep.ligprep4 module

Composite Apache Beam pipeline for LigPrep stages.

This module provides LigPrep4, the initial Beam-native re-implementation of the legacy ligprepworkflow.py. It chains the individual stage transforms into a single reusable PTransform.

Example usage:

>>> from schrodinger import adapter
>>> import apache_beam as beam
>>> from schrodinger.application.transforms.ligprep import LigPrep4
>>> st = adapter.to_structure('c1ccccc1.[Na+].[Cl-]')
>>> with beam.Pipeline() as p:
...     desalted = (p
...         | beam.Create([st])
...         | LigPrep4()
...         | beam.Map(adapter.to_smiles))

LigPrep4() returns an OutcomePCollections: .main holds the prepared structures and .dropped holds the DroppedRecord objects from the stages that drop on failure. OutcomePCollections.__or__ delegates to .main, so chaining directly (as above) keeps working.

When summary_tally_file is set, each stage’s main/dropped streams are turned into per-structure tally records and written to that file for summary.format_summary; when dropped_structures_file is also set, the dropped molecules are joined back to their original inputs and written there.

class schrodinger.application.transforms.ligprep.ligprep4.LigPrep4Config(*, sdstereo_config: ~schrodinger.application.transforms.ligprep.sdstereoexpand.SDStereoExpandConfig = <factory>, htreat_config: schrodinger.application.transforms.ligprep.htreat.HTreatConfig | None = <factory>, enable_desalt: bool = True, neutralizer_config: schrodinger.application.transforms.ligprep.neutralizer.NeutralizerConfig | None = <factory>, enable_guard: bool = True, epik_config: schrodinger.application.transforms.epik.EpikConfig | None = None, tautomerizer_config: schrodinger.application.transforms.ligprep.tautomerizer.TautomerizerConfig | None = <factory>, stereoizer_config: schrodinger.application.transforms.ligprep.stereoizer.StereoizerConfig | None = <factory>, enable_duplicate_filter: bool = False, cgx_config: schrodinger.application.transforms.ligprep.cgx.CGXConfig | None = <factory>, stereo_filter_config: schrodinger.application.transforms.ligprep.stereo_filter.StereoFilterConfig | None = <factory>, summary_tally_file: str | None = None, dropped_structures_file: str | None = None, arg_string: str | None = None)

Bases: BaseModel

Configuration for the LigPrep pipeline.

Parameters:
  • sdstereo_config – Configuration for the SD stereo expansion stage.

  • htreat_config – Configuration for the hydrogen-treatment stage, or None to skip the stage.

  • enable_desalt – Run the desalting stage after hydrogen treatment.

  • neutralizer_config – Configuration for the neutralizer stage, or None to skip the stage.

  • enable_guard – Run the guard stage to drop structures with undesired atom types.

  • epik_config – Configuration for the Epik ionization/tautomer stage, or None to skip it. Off by default; requires the epik product.

  • tautomerizer_config – Configuration for the tautomerizer stage, or None to skip it. Skipped when epik_config is set (Epik tautomerizes internally).

  • stereoizer_config – Configuration for the stereoizer stage, or None to skip it.

  • cgx_config – Configuration for the CGX 3D coordinate-generation stage, or None to skip it.

  • stereo_filter_config – Configuration for the high-energy-stereoisomer filter, or None to skip it. Requires CGX energies, so it is applied only when cgx_config is also set.

sdstereo_config: SDStereoExpandConfig
htreat_config: HTreatConfig | None
enable_desalt: bool
neutralizer_config: NeutralizerConfig | None
enable_guard: bool
epik_config: EpikConfig | None
tautomerizer_config: TautomerizerConfig | None
stereoizer_config: StereoizerConfig | None
enable_duplicate_filter: bool
cgx_config: CGXConfig | None
stereo_filter_config: StereoFilterConfig | None
summary_tally_file: str | None
dropped_structures_file: str | None
arg_string: str | 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.ligprep.ligprep4.LigPrep4(*, _config: pydantic.main.BaseModel | None = None, **kwargs)

Bases: PTransformWithConfig

Chain the LigPrep stage transforms into a single composite transform.

Stages run in legacy workflow order:

  1. SDStereoExpand - expand SD enhanced stereochemistry (1-to-many).

  2. ApplyHTreat - strip and re-add hydrogens (skip with htreat_config=None).

  3. Desalt - remove salt and solvent molecules (optional).

  4. Neutralizer - neutralize charged groups (skip with neutralizer_config=None).

  5. Guard - drop structures with undesired atom types (optional).

  6. Epik - enumerate ionization/tautomer states (opt-in via epik_config; requires the epik product).

  7. Tautomerizer - enumerate tautomers (skip with tautomerizer_config=None; also skipped when epik_config is set, as Epik tautomerizes internally).

  8. Stereoizer - enumerate stereoisomers (skip with stereoizer_config=None).

  9. DuplicateFilter - remove stereochemically-redundant variants of each input (opt-in via enable_duplicate_filter, off by default).

  10. CGX - generate 3D coordinates, optionally optimizing the geometry (skip with cgx_config=None).

  11. StereoFilter - keep the max_stereo lowest-energy stereoisomers per input (requires CGX energies; skipped when cgx_config=None).

See LigPrep4Config for the available parameters.

Example usage:

>>> with beam.Pipeline() as p:
...     prepared = (p
...         | beam.Create([st])
...         | LigPrep4(enable_desalt=False))
config_class

alias of LigPrep4Config

expand(pcoll) → OutcomePCollections

Apply the LigPrep stages to a PCollection of structures.

When summary_tally_file is set, each stage’s main/dropped streams are turned into per-structure tally records and written to that file for summary.format_summary. When dropped_structures_file is also set, the molecules dropped by a DROPPING_STAGES stage are joined back to their original inputs and written there.

Parameters:

pcoll – PCollection of Structure objects.

Returns:

OutcomePCollections with the prepared structures (.main) and the DroppedRecord objects from the dropping stages (.dropped).