schrodinger.livedesign.reaction module¶
- class schrodinger.livedesign.reaction.RxnCheckResult(num_reactants: int = -1, num_products: int = -1, rxn_validated: bool = False, valid_rgroups: bool = False, valid_mapping: bool = False)¶
Bases:
object- num_reactants: int = -1¶
- num_products: int = -1¶
- rxn_validated: bool = False¶
- valid_rgroups: bool = False¶
- valid_mapping: bool = False¶
- __init__(num_reactants: int = -1, num_products: int = -1, rxn_validated: bool = False, valid_rgroups: bool = False, valid_mapping: bool = False) None¶
- schrodinger.livedesign.reaction.setup_rgroup_rxn_map_nums(mol: Mol) bool¶
Turn indexed R groups into dummy atoms with atom map numbers > 100
Reactions are commonly drawn with mapped R groups, and nothing else mapped. The R groups should be turned into star (wildcard) atoms with the correct atom mapping.
to be tested: - collisions if some existing atoms are mapped
- schrodinger.livedesign.reaction.initialize_map_numbers(reactants: list[rdkit.Chem.rdchem.Mol], products: list[rdkit.Chem.rdchem.Mol]) bool¶
A reaction isn’t fully mapped if: * There are no atoms mapped * There are are unmapped dummy atoms in the product.
It’s OK to have some unmapped atoms, that means that they are annhilated or created in the reaction. If _all_ atoms are unmapped, though, that’s a problem because we don’t know how to specific reactants interact with the reaction.
- schrodinger.livedesign.reaction.check_rxn(rxn: ChemicalReaction) RxnCheckResult¶
- schrodinger.livedesign.reaction.check_reaction(rxn_input: str) dict[str, int]¶
Validate reaction structure and return JSON-serializable result data.
- Parameters:
rxn_input – reaction definition in any supported format, such as RXN or reaction SMARTS.
- Returns:
dictionary describing the reaction’s reactant/product counts and validation results.
- schrodinger.livedesign.reaction.enumerate_reactions(rxn_input: str, reactant_lists: list[list[str]], reactant_id_lists: list[list[str]] = None, max_products: int = None, property_filters: dict[str, str] = None) dict[str, list[str]]¶
Execute a reaction on one or more sets of reagents
Basically, each “reaction” can have one or more than reagents, and could be run on one or more sets of reagents.
- Parameters:
rxn_input – reaction definition in any supported format, such as RXN or reaction SMARTS.
reactant_lists – lists of reactants in any supported format, such as MOL or SMILES. Each list has to have the correct length, matching the number of reactant templates used by the reaction.
reactant_lists – lists of IDs of the reactants. Each list should have exactly the same size as the corresponding list in reactant_lists. For reactants with no ID, an empty string should be used.
max_products – yield at most this many unique products. If not provided, all products are returned without limit or deduplication. (The canonical SMILES is used as the key.)
property_filters – dictionary with JSON data describing the property filters, with the schema expected by schrodinger.ui.qt.filter_dialog_dir.filter_core.Filter.
- Returns:
dictionary with product SDF blocks and source reactant ID lists.