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 (currently SD stereo expansion, hydrogen treatment, then desalting) into a single reusable PTransform. Additional stages from the legacy workflow will be added here over time, each as its own native transform.

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))

Structures that fail a stage are silently dropped, inheriting the behavior of the underlying stage transforms.

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)

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.

sdstereo_config: SDStereoExpandConfig
htreat_config: HTreatConfig | None
enable_desalt: bool
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(**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).

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)

Apply the LigPrep stages to a PCollection of structures.

Parameters:

pcoll – PCollection of Structure objects.

Returns:

PCollection of prepared Structure objects.