syndirella.route.Reaction ========================= .. py:module:: syndirella.route.Reaction .. autoapi-nested-parse:: syndirella.route.Reaction.py This module contains the Reaction class. One instance of this object is used to describe a single reaction. Classes ------- .. autoapisummary:: syndirella.route.Reaction.Reaction Module Contents --------------- .. py:class:: Reaction(product: rdkit.Chem.Mol, reactants: List[rdkit.Chem.Mol], reaction_name: str, smarts_handler: syndirella.SMARTSHandler.SMARTSHandler, route_uuid: str) This class contains information about the reaction. It is used to find the atoms on the reactants involved in the reaction, check the reaction atoms are the ones that are supposed to be connected. .. py:attribute:: route_uuid :type: str .. py:attribute:: logger .. py:attribute:: scaffold :type: rdkit.Chem.Mol .. py:attribute:: reactants :type: List[rdkit.Chem.Mol] .. py:attribute:: reaction_name :type: str .. py:attribute:: smarts_handler :type: syndirella.SMARTSHandler.SMARTSHandler .. py:attribute:: reaction_pattern :type: rdkit.Chem.rdChemReactions .. py:attribute:: all_attach_ids :type: Dict[rdkit.Chem.Mol, List[int]] | None .. py:attribute:: additional_rxn_options :type: List[Dict[str, str]] .. py:attribute:: alt_reactions :type: List[Dict[str, str]] | None :value: [] .. py:method:: alt_reaction() -> List[Dict[str, str]] | None This function is used to determine if an additional reaction is specified. .. py:method:: get_additional_reactions() -> List[Tuple[str, Tuple[str, str]]] | None This function edits the reactants to make an additional reaction. .. py:method:: check_reaction_can_produce_product(new_reactant: rdkit.Chem.Mol, other_reactant: rdkit.Chem.Mol, reaction_name: str) -> bool This function is used to check if the new reactants can simply produce a scaffold from the labeled reaction. .. py:method:: edit_reactant(reactant: Tuple[rdkit.Chem.Mol, Tuple[int], str], new_reactant_smarts: str, to_replace_smarts: str, replacement_connecting_atom_id: int) -> rdkit.Chem.Mol | None Directly edits the reactant to replace SMARTS matched atoms to new SMARTS. .. py:method:: _replace_carboxylic_acid_hydroxy_with_dummy(mol: rdkit.Chem.Mol) -> rdkit.Chem.Mol .. py:method:: _replace_halide_with_dummy(mol: rdkit.Chem.Mol, atom_to_check_by_symbol=None) -> rdkit.Chem.Mol .. py:method:: _find_attachment_id_from_dummy(reactant: rdkit.Chem.Mol, dummy_symbol='*') -> Tuple[List[int], List[List[int]]] .. py:method:: use_fmcs(reactant: rdkit.Chem.Mol) -> Dict[int, int] .. py:method:: find_attachment_id_for_reactant(reactant: rdkit.Chem.Mol) -> List[int] | None This function is used to find the attachment indices of a single reactant in the reaction. :param reactant: a single reactant molecule :returns a list of tuples (attachmentIdx_whole, attachmentIdx_subMol) .. py:method:: find_attachment_ids_for_all_reactants() -> Dict[rdkit.Chem.Mol, List[int]] | None This function is used to find the attachment indices of all reactants in the reaction. :returns a list of lists, each containing tuples of attachment indices for each reactant .. py:method:: format_matched_smarts_to_index(matched_reactants: Dict[str, Tuple[rdkit.Chem.Mol, List[int], str]]) -> Dict[int, Tuple[rdkit.Chem.Mol, List[int], str]] | None Formats matched smarts to reactant by using reactant index in smarts as the key. .. py:method:: find_reaction_atoms_for_all_reactants() -> Tuple[Dict[str, Tuple[rdkit.Chem.Mol, List[int], str]] | None, Dict[int, Tuple[rdkit.Chem.Mol, List[int], str]]] This function is used to find the reaction atoms of both reactants. And how those atoms correspond to the SMARTS pattern associated with the reaction.