schrodinger.application.transforms.dock module

schrodinger.application.transforms.dock.validate_docking_grid(grid_path: str | pathlib.Path) → None

Validate that a Glide grid is supported by the docking transforms.

Parameters:

grid_path – Path to the Glide grid archive.

Raises:

ValueError – If the archive is invalid or contains unsupported features.

class schrodinger.application.transforms.dock.DockingConfig(*, grid_path: ~pathlib.Path, ref_ligand_path: ~typing.Optional[~pathlib.Path] = None, in_path: ~typing.Optional[~pathlib.Path] = None, poses_per_lig: int = 1, input_overrides: dict[str, typing.Any] = <factory>)

Bases: BaseModel

Configuration for Dock.

Parameters:
  • grid_path – The path to the grid file.

  • ref_ligand_path – (Optional) A path to a reference ligand file.

  • in_path – (Optional) A path to a glide input file.

  • poses_per_lig – (Optional) The number of poses to generate per ligand.

  • input_overrides – (Optional) A dictionary of input overrides.

grid_path: Path
ref_ligand_path: Optional[Path]
in_path: Optional[Path]
poses_per_lig: int
input_overrides: dict[str, Any]
model_config: ClassVar[ConfigDict] = {'frozen': True}

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

getValidatedConfigDict() → dict

Return the validated Glide configuration.

class schrodinger.application.transforms.dock.Dock(*, _config: pydantic.main.BaseModel | None = None, **kwargs)

Bases: PTransformWithConfig

A PTransform that docks structures and generates poses using Glide.

Example usage:

>>> import apache_beam as beam
>>> from schrodinger.application.transforms.dock import Dock
>>> from schrodinger.seam.io import chemio
>>> from schrodinger.test import mmshare_data_file
>>> with beam.Pipeline() as p:
...     _ = (p
...          | chemio.ReadStructuresFromFile(mmshare_data_file('glide/factorXa.maegz'))
...          | Dock(grid_path=mmshare_data_file('glide/factorXa_grid.zip'),
...                 ref_ligand_path=mmshare_data_file('glide/factorXa_reference.maegz'),
...                 in_path=mmshare_data_file('glide/glide.in'),
...                 poses_per_lig=1)
...          | chemio.WriteStructuresToFile('output.maegz'))

See DockingConfig for available configuration options.

config_class

alias of DockingConfig

class schrodinger.application.transforms.dock.FilterUndockable(*, _config: pydantic.main.BaseModel | None = None, **kwargs)

Bases: PTransformWithConfig

A PTransform that filters out any molecules that failed to dock with Glide.

Accepts either Mol or Structure PCollections and returns the same type.

See DockingConfig for available configuration options.

Raises:

ValueError – If poses_per_lig is not 1.

Example usage:

>>> import apache_beam as beam
>>> from rdkit import Chem
>>> from schrodinger.application.transforms.dock import FilterUndockable
>>> from schrodinger.seam.io import chemio
>>> from schrodinger.test import mmshare_data_file
>>> with beam.Pipeline() as p:
...     _ = (p
...          | beam.Create([Chem.MolFromSmiles('N(c1ccccc1)c1nc(-c2ccccc2)c2nc[nH]c2n1'),
...                 Chem.MolFromSmiles('COC(=O)CCc1c(C(=O)OC)[nH]c(C)c1C(=O)[O-]')])
...          | FilterUndockable(grid_path=mmshare_data_file('glide/factorXa_grid.zip'),
...                 ref_ligand_path=mmshare_data_file('glide/factorXa_reference.maegz'),
...                 in_path=mmshare_data_file('glide/glide.in'))
...          | chemio.WriteMolsToFile('output.smi'))
>>> # The output file will contain only the second molecule, as the first molecule failed to dock.
config_class

alias of DockingConfig