syndirella.fairy ================ .. py:module:: syndirella.fairy .. autoapi-nested-parse:: syndirella.fairy.py This module provides functions to find similar cheaper reactants, filter out reactants based on simple filters, fingerprint generation, and others... Attributes ---------- .. autoapisummary:: syndirella.fairy.logger Functions --------- .. autoapisummary:: syndirella.fairy.load_reactant_filters syndirella.fairy.load_additional_rxn_options syndirella.fairy.do_i_need_alternative_route syndirella.fairy.find_similar_reactants syndirella.fairy.get_similar_reactant syndirella.fairy.make_similar_reactant syndirella.fairy.filter_molecules syndirella.fairy.simple_filters syndirella.fairy.remove_hydrogen_ions syndirella.fairy.remove_repeat_mols syndirella.fairy.remove_non_abundant_isotopes syndirella.fairy.remove_chirality syndirella.fairy.remove_chirality_from_mol syndirella.fairy.print_diff syndirella.fairy.calculate_tanimoto syndirella.fairy.find_reaction_by_name syndirella.fairy.get_morgan_fingerprint syndirella.fairy.generate_inchi_ID syndirella.fairy.check_mol_sanity Module Contents --------------- .. py:data:: logger .. py:function:: load_reactant_filters() -> Dict[str, Dict[str, Any]] .. py:function:: load_additional_rxn_options() -> List[Dict[str, str]] .. py:function:: do_i_need_alternative_route(reaction_names: List[str], additional_rxn_options: List[Dict[str, str]]) -> bool Check if the reaction names need an alternative route. .. py:function:: find_similar_reactants(reactant: syndirella.error.Chem.Mol, reaction_name: str, reactant_filters: Dict[str, Dict[str, Any]]) -> List[str] | None Find additional similar reactants that are cheaper as defined in the reactant_filters. .. py:function:: get_similar_reactant(reactant: syndirella.error.Chem.Mol, reactant_filters: Dict[str, str]) -> Optional[str] Make similar reactant to query reactant from the reactant_filters. .. py:function:: make_similar_reactant(reactant: syndirella.error.Chem.Mol, to_replace: str, matched_details: Dict[str, Any]) -> str Create a similar reactant by modifying the original reactant according to matched_details. .. py:function:: filter_molecules(hits: List[Tuple[str, float]]) -> List[str] Filter out reactants and return a dictionary with SMILES strings as keys and their associated scores as values. .. py:function:: simple_filters(mols: List[syndirella.error.Chem.Mol]) -> List[syndirella.error.Chem.Mol] Filter out molecules based on repeats, and non-abundant isotopes. .. py:function:: remove_hydrogen_ions(mols: List[syndirella.error.Chem.Mol]) -> List[syndirella.error.Chem.Mol] Remove molecules with only hydrogen ions. .. py:function:: remove_repeat_mols(mols: List[syndirella.error.Chem.Mol]) -> List[syndirella.error.Chem.Mol] Remove repeated molecules by checking for Tanimoto similarity of 1. .. py:function:: remove_non_abundant_isotopes(mols: List[syndirella.error.Chem.Mol]) -> List[syndirella.error.Chem.Mol] Remove molecules with non-abundant isotopes. .. py:function:: remove_chirality(mols: List[syndirella.error.Chem.Mol]) -> List[syndirella.error.Chem.Mol] Remove chirality from all molecules in the list. .. py:function:: remove_chirality_from_mol(mol: syndirella.error.Chem.Mol) -> syndirella.error.Chem.Mol Remove chirality from a single molecule. .. py:function:: print_diff(hits: List[Tuple[str, float]], valid_mols: List[syndirella.error.Chem.Mol], desc: str) -> None Print the difference between the original number of molecules and the number of valid molecules. .. py:function:: calculate_tanimoto(mol1: syndirella.error.Chem.Mol, mol2: syndirella.error.Chem.Mol) -> float .. py:function:: find_reaction_by_name(reaction_name: str, additional_rxn_options: List[Dict[str, str]]) -> Optional[Dict[str, Any]] Find a reaction by name in the additional_rxn_options. .. py:function:: get_morgan_fingerprint(mol: syndirella.error.Chem.Mol) -> rdkit.Chem.rdFingerprintGenerator.MorganFP Get the fingerprint of a molecule. .. py:function:: generate_inchi_ID(smiles: str | None = None, mol: syndirella.error.Chem.Mol | None = None, isomeric: bool = False) -> str | syndirella.error.MolError This function is used to generate a unique id for the route just using the scaffold. .. py:function:: check_mol_sanity(mol: syndirella.error.Chem.Mol) -> syndirella.error.Chem.Mol | None Check if the molecule can be sanitized.