schrodinger.application.transforms.ligprep.sdstereoexpand module

Apache Beam transform for expanding SD stereochemistry.

This is a thin Beam adapter around the legacy ligprep3 stereo expansion driver (schrodinger.application.macromodel.packages.ligprep3.sdstereoexpander._run), which generates stereoisomers from SD V2000/V3000 enhanced stereo information (ABS/OR/AND groups). The transform adds optional ‘s_lp_label’ stage labelling for tracking provenance through multi-stage pipelines (LIGPREP-2229).

class schrodinger.application.transforms.ligprep.sdstereoexpand.SDStereoExpandConfig(*, max_generated: int = 1, st_opts: str = '', add_hydrogens: bool = False, max_output: int = -1, strict_V2000_stereo: bool = False, label_outputs: bool = False)

Bases: BaseModel

Configuration for the SD stereo expansion transform.

Parameters:
  • max_generated – Maximum stereoisomers to generate per structure, passed to Stereoizer as its -n flag.

  • st_opts – Comma-separated stereoizer options, e.g. ‘-ignore_existing_chiralities,some_flag’.

  • add_hydrogens – Add missing hydrogens before stereo expansion.

  • max_output – Maximum output structures to return, applied after enhanced stereo filtering. -1 means unlimited.

  • strict_V2000_stereo – Skip V2000 enantiomer generation. When True, only atoms in explicit V3000 ABS groups are treated as absolute stereocenters; V2000 files with the chiral flag will not auto-expand.

  • label_outputs – Append stage labels to outputs via the ‘s_lp_label’ property, e.g. ‘1_sdstereoexpand_1’, ‘1_sdstereoexpand_2’.

max_generated: int
st_opts: str
add_hydrogens: bool
max_output: int
strict_V2000_stereo: bool
label_outputs: bool
classmethod validate_max_output(v: int) int

Validate max_output is -1 or positive.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class schrodinger.application.transforms.ligprep.sdstereoexpand.SDStereoExpand(**kwargs)

Bases: PTransformWithConfig

Expand SD file stereochemistry to generate stereoisomers based on enhanced stereo information in SD V2000/V3000 formats (ABS/OR/AND groups), matching the legacy ligprep3 sdstereoexpander behavior.

Example usage:

>>> with beam.Pipeline() as p:
...     expanded = (p
...         | ReadStructuresFromFile('input.sdf')
...         | SDStereoExpand(max_generated=8, label_outputs=True))

See SDStereoExpandConfig for the available parameters.

config_class

alias of SDStereoExpandConfig

expand(pcoll)

Apply SD stereo expansion to a PCollection of structures.

Parameters:

pcoll – PCollection of Structure objects

Returns:

PCollection of expanded Structure objects (1-to-many)