schrodinger.application.transforms.ligprep.desalt module

Apache Beam transform for desalting structures.

This module provides a PTransform that removes salt and solvent molecules from chemical structures using MacroModel’s desalting functionality.

class schrodinger.application.transforms.ligprep.desalt.Desalt(label: Optional[str] = None)

Bases: PTransform

A PTransform that removes salt and solvent molecules from structures.

Accepts Structure objects as input. For RDKit Mol objects, convert to Structure first using adapter.to_structure().

Example usage:

>>> from schrodinger import adapter
>>> import apache_beam as beam
>>> st = adapter.to_structure('c1ccccc1.[Na+].[Cl-]')
>>> with beam.Pipeline() as p:
...     desalted = (p
...         | beam.Create([st])
...         | Desalt()
...         | beam.Map(lambda s: adapter.to_smiles(s)))
expand(pcoll)

Apply desalting to a PCollection of structures.

Parameters:

pcoll – PCollection of Structure objects

Returns:

PCollection of desalted Structure objects