schrodinger.application.transforms.ligprep.htreat module

Apache Beam transform for hydrogen treatment.

This is a thin Beam adapter around the legacy ligprep3 hydrogen-treatment driver (schrodinger.application.macromodel.packages.ligprep3.htreat._run), which strips and re-adds hydrogens according to a named treatment, optionally tracking stereochemistry and regenerating 3D coordinates. The legacy chemistry is reused verbatim; this module only provides the Beam plumbing (LIGPREP-2230).

class schrodinger.application.transforms.ligprep.htreat.HTreatConfig(*, treatment: str = 'All-None', asl: str = 'all', use_stereo: bool = True, atom_limit: int = 200)

Bases: BaseModel

Configuration for the hydrogen-treatment transform.

The defaults match the legacy ligprep workflow’s invocation of applyhtreat (-t All-None -a all -s), not the bare standalone CLI defaults.

Parameters:
  • treatment – Name of the hydrogen treatment to apply (legacy -t, default “All-None” which is an alias for “All-atom with No-Lp”).

  • asl – Restrict treatment to atoms matching this ASL expression (legacy -a; default “all”, which selects every atom).

  • use_stereo – Adjust atom numbers in chirality strings (legacy -s). Only valid with the “All-None” treatment (index 1); set this to False when using any other treatment or _run raises a RuntimeError.

  • atom_limit – Maximum number of atoms allowed after treatment; a structure exceeding this is dropped (legacy -l).

treatment: str
asl: str
use_stereo: bool
atom_limit: int
model_config: ClassVar[ConfigDict] = {}

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

class schrodinger.application.transforms.ligprep.htreat.ApplyHTreat(**kwargs)

Bases: PTransformWithConfig

Apply hydrogen treatment to structures, wrapping the legacy ligprep3 applyhtreat logic: strip and re-add hydrogens according to a named treatment, optionally tracking stereochemistry and regenerating geometry. The defaults reproduce the ligprep workflow’s invocation (-t All-None -a all -s); see HTreatConfig for the parameters.

Structures that fail treatment (e.g. exceeding the atom limit) are dropped.

Example usage:

>>> from schrodinger import adapter
>>> import apache_beam as beam
>>> st = adapter.to_structure('CC(C)C')
>>> with beam.Pipeline() as p:
...     treated = (p
...         | beam.Create([st])
...         | ApplyHTreat(treatment='All-None'))

See HTreatConfig for the available parameters.

config_class

alias of HTreatConfig

expand(pcoll)

Apply hydrogen treatment to a PCollection of structures.

Parameters:

pcoll – PCollection of Structure objects

Returns:

PCollection of treated Structure objects