syndirella.fairy

syndirella.fairy.py

This module provides functions to find similar cheaper reactants, filter out reactants based on simple filters, fingerprint generation, and others…

Attributes

logger

Functions

load_reactant_filters(→ Dict[str, Dict[str, Any]])

load_additional_rxn_options(→ List[Dict[str, str]])

do_i_need_alternative_route(→ bool)

Check if the reaction names need an alternative route.

find_similar_reactants(→ List[str] | None)

Find additional similar reactants that are cheaper as defined in the reactant_filters.

get_similar_reactant(→ Optional[str])

Make similar reactant to query reactant from the reactant_filters.

make_similar_reactant(→ str)

Create a similar reactant by modifying the original reactant according to matched_details.

filter_molecules(→ List[str])

Filter out reactants and return a dictionary with SMILES strings as keys and their associated scores as values.

simple_filters(→ List[syndirella.error.Chem.Mol])

Filter out molecules based on repeats, and non-abundant isotopes.

remove_hydrogen_ions(→ List[syndirella.error.Chem.Mol])

Remove molecules with only hydrogen ions.

remove_repeat_mols(→ List[syndirella.error.Chem.Mol])

Remove repeated molecules by checking for Tanimoto similarity of 1.

remove_non_abundant_isotopes(...)

Remove molecules with non-abundant isotopes.

remove_chirality(→ List[syndirella.error.Chem.Mol])

Remove chirality from all molecules in the list.

remove_chirality_from_mol(→ syndirella.error.Chem.Mol)

Remove chirality from a single molecule.

print_diff(→ None)

Print the difference between the original number of molecules and the number of valid molecules.

calculate_tanimoto(→ float)

find_reaction_by_name(→ Optional[Dict[str, Any]])

Find a reaction by name in the additional_rxn_options.

get_morgan_fingerprint(...)

Get the fingerprint of a molecule.

generate_inchi_ID(→ str | syndirella.error.MolError)

This function is used to generate a unique id for the route just using the scaffold.

check_mol_sanity(→ syndirella.error.Chem.Mol | None)

Check if the molecule can be sanitized.

Module Contents

syndirella.fairy.logger[source]
syndirella.fairy.load_reactant_filters() Dict[str, Dict[str, Any]][source]
syndirella.fairy.load_additional_rxn_options() List[Dict[str, str]][source]
syndirella.fairy.do_i_need_alternative_route(reaction_names: List[str], additional_rxn_options: List[Dict[str, str]]) bool[source]

Check if the reaction names need an alternative route.

syndirella.fairy.find_similar_reactants(reactant: syndirella.error.Chem.Mol, reaction_name: str, reactant_filters: Dict[str, Dict[str, Any]]) List[str] | None[source]

Find additional similar reactants that are cheaper as defined in the reactant_filters.

syndirella.fairy.get_similar_reactant(reactant: syndirella.error.Chem.Mol, reactant_filters: Dict[str, str]) str | None[source]

Make similar reactant to query reactant from the reactant_filters.

syndirella.fairy.make_similar_reactant(reactant: syndirella.error.Chem.Mol, to_replace: str, matched_details: Dict[str, Any]) str[source]

Create a similar reactant by modifying the original reactant according to matched_details.

syndirella.fairy.filter_molecules(hits: List[Tuple[str, float]]) List[str][source]

Filter out reactants and return a dictionary with SMILES strings as keys and their associated scores as values.

syndirella.fairy.simple_filters(mols: List[syndirella.error.Chem.Mol]) List[syndirella.error.Chem.Mol][source]

Filter out molecules based on repeats, and non-abundant isotopes.

syndirella.fairy.remove_hydrogen_ions(mols: List[syndirella.error.Chem.Mol]) List[syndirella.error.Chem.Mol][source]

Remove molecules with only hydrogen ions.

syndirella.fairy.remove_repeat_mols(mols: List[syndirella.error.Chem.Mol]) List[syndirella.error.Chem.Mol][source]

Remove repeated molecules by checking for Tanimoto similarity of 1.

syndirella.fairy.remove_non_abundant_isotopes(mols: List[syndirella.error.Chem.Mol]) List[syndirella.error.Chem.Mol][source]

Remove molecules with non-abundant isotopes.

syndirella.fairy.remove_chirality(mols: List[syndirella.error.Chem.Mol]) List[syndirella.error.Chem.Mol][source]

Remove chirality from all molecules in the list.

syndirella.fairy.remove_chirality_from_mol(mol: syndirella.error.Chem.Mol) syndirella.error.Chem.Mol[source]

Remove chirality from a single molecule.

syndirella.fairy.print_diff(hits: List[Tuple[str, float]], valid_mols: List[syndirella.error.Chem.Mol], desc: str) None[source]

Print the difference between the original number of molecules and the number of valid molecules.

syndirella.fairy.calculate_tanimoto(mol1: syndirella.error.Chem.Mol, mol2: syndirella.error.Chem.Mol) float[source]
syndirella.fairy.find_reaction_by_name(reaction_name: str, additional_rxn_options: List[Dict[str, str]]) Dict[str, Any] | None[source]

Find a reaction by name in the additional_rxn_options.

syndirella.fairy.get_morgan_fingerprint(mol: syndirella.error.Chem.Mol) rdkit.Chem.rdFingerprintGenerator.MorganFP[source]

Get the fingerprint of a molecule.

syndirella.fairy.generate_inchi_ID(smiles: str | None = None, mol: syndirella.error.Chem.Mol | None = None, isomeric: bool = False) str | syndirella.error.MolError[source]

This function is used to generate a unique id for the route just using the scaffold.

syndirella.fairy.check_mol_sanity(mol: syndirella.error.Chem.Mol) syndirella.error.Chem.Mol | None[source]

Check if the molecule can be sanitized.