schrodinger.application.transforms.enumerators.fragment module

class schrodinger.application.transforms.enumerators.fragment.Fragment(core_smarts: str, max_mol_wt: float = inf, max_fragments: int = 500)

Bases: PTransform

A Transform that yields sanitized molecular fragments from input molecules that retain a specified core substructure.

Note: The original input molecule is returned if it matches the core and is under the max_mol_wt.

Example usage:

>>> with beam.Pipeline() as p:
...     fragments = (
...      p
...      | beam.Create([Chem.MolFromSmiles('CC(C)(C)c1ccccc1')])
...      | Fragment(core_smarts='c1ccccc1')
...      | beam.Map(lambda m: Chem.MolToSmiles(m))
...      | beam.LogElements()
...     )
c1ccccc1
Cc1ccccc1
CCc1ccccc1
CC(C)c1ccccc1
CC(C)(C)c1ccccc1
Parameters:
  • core_smarts – The core substructure that all fragments must contain.

  • max_mol_wt – The maximum molecular weight of the fragments.

  • max_fragments – The maximum number of fragments to generate.

__init__(core_smarts: str, max_mol_wt: float = inf, max_fragments: int = 500)