schrodinger.application.transforms.enumerators.synthesize module¶
- class schrodinger.application.transforms.enumerators.synthesize.Synthesize(frozen_smarts: str, depth: int = 1, dedupe_routes: bool = False, max_routes: int | None = None, max_products_per_route: int = 100, max_tries_per_route: int | None = None, reagent_libraries: list[pathlib.Path] | None = None, seed: int | None = None)¶
Bases:
PTransformA PTransform that generates sanitized molecules by:
Enumerating all retrosynthetic routes available in the default reaction dictionary of up to a maximum depth for all molecules with fixed heavy atoms based on
frozen_smarts.Optionally deduplicating the routes based on their one-line representation (
dedupe_routes).Optionally sampling the number of routes to retain (
max_routes).Evaluating each route either systematically or randomly. Products are generated systematically if
max_products_per_routeis 0,max_tries_per_routeis 0, or the combinations of reagents less thanmax_products_per_route.
Note that random sampling may yield fewer products than requested.
The resulting products may not be unique since only unqiue products per route are guaranteed. Consider using
beam.Distinct()after this transform if unique products are desired.Example usage:
>>> import apache_beam as beam >>> from rdkit import Chem >>> from schrodinger.application.transforms.enumerators import Synthesize >>> from schrodinger.seam.io import chemio >>> with beam.Pipeline() as p: ... products = ( ... p ... | beam.Create([Chem.MolFromSmiles('Cc1ccccc1')]) ... | Synthesize('c1ccccc1', max_products_per_route=100) ... | chemio.WriteMolsToFile('synthesized.smi') ... )
- Parameters:
frozen_smarts – The SMARTS whose heavy atoms the products should have.
depth – The maximum depth of the retrosynthetic routes to use.
dedupe_routes – Whether to deduplicate the routes.
max_routes – The number of routes to retain. If ‘None’, all routes will be kept.
max_products_per_route – The maximum number of products to try to synthesize for each input molecule per route. Use 0 to force exhaustive synthesis.
max_tries_per_route – The maximum number of tries to synthesize products for each input molecule per route. If
None, the number of tries is automatically determined. If 0, the synthesis will be exhaustive.reagent_libraries – The optional reagent libraries to use. If
Noneor an empty list, the default reagent library will be used.seed – seed for random number generator. If
None, the random number generator will not be seeded.
- __init__(frozen_smarts: str, depth: int = 1, dedupe_routes: bool = False, max_routes: int | None = None, max_products_per_route: int = 100, max_tries_per_route: int | None = None, reagent_libraries: list[pathlib.Path] | None = None, seed: int | None = None)¶
- class schrodinger.application.transforms.enumerators.synthesize.SystematicSynthesize(frozen_smarts: str, max_routes: int | None = None, max_reactions_per_route: int | None = None)¶
Bases:
PTransformA PTransform that generates unique sanitized molecules by:
Enumerating unique retrosynthetic routes of depth 1 for all molecules with fixed heavy atoms based on
frozen_smarts.Optionally sampling the number of routes to retain (
max_routes).Evaluating each route systematically, optionally limiting the number of reactions per route (
max_reactions_per_route).
Example usage:
>>> import apache_beam as beam >>> from rdkit import Chem >>> from schrodinger.application.transforms.enumerators import SystematicSynthesize >>> from schrodinger.seam.io import chemio >>> with beam.Pipeline() as p: ... products = ( ... p ... | beam.Create([Chem.MolFromSmiles('Cc1ccccc1')]) ... | SystematicSynthesize('c1ccccc1') ... | chemio.WriteMolsToFile('systematic_synthesized.smi') ... )
- Parameters:
frozen_smarts – The SMARTS whose heavy atoms the products should have.
max_routes – The number of routes to retain. If
None, all routes will be kept.max_reactions_per_route – The maximum number of reactions to try to synthesize products for each input molecule per route. If
None, the number of reactions is unlimited.
- __init__(frozen_smarts: str, max_routes: int | None = None, max_reactions_per_route: int | None = None)¶