syndirella.route.Library

syndirella.route.Library.py

This module contains the Library class. This class contains information about the analogue library. It will create the analogue library from the Reaction object. It will also store the analogue library as a .pkl file.

Classes

Library

This class contains information about the analogue library. It will create the analogue library from the Reaction

Module Contents

class syndirella.route.Library.Library(reaction: syndirella.route.Reaction.Reaction, output_dir: str, id: str, num_steps: int, current_step: int, filter: bool, route_uuid: str, atom_diff_min: int, atom_diff_max: int)[source]

This class contains information about the analogue library. It will create the analogue library from the Reaction object. It will also store the analogue library as a .pkl file.

reaction: syndirella.route.Reaction.Reaction[source]
id: str[source]
output_dir: str[source]
extra_dir_path: str[source]
num_steps: int[source]
current_step: int[source]
analogues_dataframes: Dict[str:pd.DataFrame][source]
filter: bool[source]
route_uuid: str[source]
atom_diff_min: int[source]
atom_diff_max: int[source]
logger[source]
r1 = None[source]
r2 = None[source]
create_library()[source]

This function is used to create the analogue library from the Reaction object.

process_reactant(reactant: Chem.Mol, reactant_smarts: str, analogue_prefix: str) tuple[pandas.DataFrame, tuple[str, str]][source]
process_analogues(analogues: List[str], reactant_smarts: str, analogue_prefix: str, previous_product: bool) pandas.DataFrame[source]

This function puts list of analogues in dataframe and does SMART checking to check if the analogues contains the SMARTS pattern of the original reactant and against all other reactants SMARTS.

check_analogue_contains_smarts_pattern(analogues_mols: List[Chem.Mol], reactant_smarts_mol: Chem.Mol)[source]

This function is used to check if the analogues contains the original reactant. Will return dictionary of boolean values and the number of matches.

filter_analogues(analogues: List[str], analogue_prefix: str) List[str][source]

This function is used to filter out analogues.

print_diff(mols: List[Chem.Mol], valid_mols: List[Chem.Mol], analogue_prefix: str)[source]

This function is used to print the difference between the original number of analogues and the number of valid analogues.

filter_on_substructure_filters(mols: List[Chem.Mol]) List[str][source]

This function is used to filter out analogues that do not pass the substructure filters.

check_analogue_contains_other_reactant_smarts_pattern(analogues_mols: List[Chem.Mol], reactant_smarts: str) List[bool][source]

This function is used to check if the analogues contains the SMARTS patterns of the other reactant.

check_analogue_contains_all_smarts_patterns(analogues_mols: List[Chem.Mol]) List[bool] | NotImplementedError[source]

This function is used to check if the analogues contains all the SMARTS patterns of the other reactants.

check_analogues_pkl_exists(analogue_prefix: str, reactant: Chem.Mol) str and bool[source]

This function is used to check if the analogue library has already been created and saved as a .pkl file.

_find_analogues_pkl_name(analogue_prefix: str) str[source]

Checks if the analogue library was already created and saved as a .pkl.gz file. Returns the path to the .pkl.gz file.

_find_products_pkl_name(reactant: Chem.Mol) str[source]

This function is used to find the name of the products .pkl file by comparing the reactant to the scaffold with bit vector similarity.

save_library(df: pandas.DataFrame, analogue_prefix: str)[source]

This function is used to save the analogue library as a .pkl file in self.extra_dir_path

load_library(reactant_analogues_path: str, analogue_prefix: str, internal_step: bool) List[str][source]

This function is used to load the analogue library from a .pkl file.

save()[source]

This function saves the library object in the self.extra_output_dir_path.

static load(output_dir: str, product: str) Library[source]

This function loads the library object. Will have to load all library objects