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:
BaseModelConfiguration 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
_runraises 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:
PTransformWithConfigApply hydrogen treatment to structures, wrapping the legacy ligprep3
applyhtreatlogic: 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); seeHTreatConfigfor 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
HTreatConfigfor 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