syndirella.SMARTSHandler
SMARTSHandler.py
This module contains the SMARTSHandler class. This class contains information about the reaction SMARTS.
Classes
Module Contents
- class syndirella.SMARTSHandler.SMARTSHandler(rxn_smirks_path: str = None)[source]
-
- assign_reactants_w_rxn_smarts(product: rdkit.Chem.Mol, reactant_attach_ids: Dict[rdkit.Chem.Mol, List[Tuple[int, int]]], reaction_name: str) dict[str, tuple[rdkit.Chem.Mol, list[int], str]] | None | dict[Any | None, None][source]
This function is used to assign the reactant number to input reactants using the reaction SMARTS. For now it only supports bimolecular reactions.
- seperate_matching_reactants(r1: rdkit.Chem.Mol, r2: rdkit.Chem.Mol, found_1: Dict[str, bool], found_2: Dict[str, bool], patt1: str, patt2: str) Dict[str, Tuple[rdkit.Chem.Mol, List[int], str]][source]
This function is used to fix edge cases: - to separate reactants that match both reactant SMARTS. - one reactant matches both reactant SMARTS.
These found_1 and found_2 dictionaries are a bit confusing: Key: ‘r1’ or ‘r2’ Value: False if no match, List of atom indices within reactant that match the SMARTS of that reactant.
- check_found_reactants(product: rdkit.Chem.Mol, found_1: Dict[str, bool], found_2: Dict[str, bool], reaction_name: str, r1: rdkit.Chem.Mol, r2: rdkit.Chem.Mol) bool[source]
This function checks that both reactants have been found. It raises a warning if both reactants are matched to the same reactant SMARTS.
Returns False when both reactants match both reactant SMARTS.