syndirella.slipper.Slipper

syndirella.slipper.Slipper.py

This module contains the Slipper class. A slipper in this metaphor is the set of molecules that is the scaffold of a reaction.

Classes

Slipper

This class is instantiated to represent all products for a step in a route.

Module Contents

class syndirella.slipper.Slipper.Slipper(*, library: syndirella.route.Library.Library, template: str = None, hits_path: str = None, hits_names: List[str] = None, batch_num: int = None, atoms_ids_expansion: dict = None, additional_info: dict = None, scaffold_placements: Dict[rdkit.Chem.Mol, str | None] = None)[source]

This class is instantiated to represent all products for a step in a route.

products: pandas.DataFrame = None[source]
library: syndirella.route.Library.Library[source]
route_uuid: str[source]
output_dir: str[source]
final_products_pkl_path: str = None[source]
final_products_csv_path: str = None[source]
scaffold_placements: Dict[rdkit.Chem.Mol, str | None] = None[source]
template: str = None[source]
hits_path: str = None[source]
hits_names: List[str] = None[source]
batch_num: int = None[source]
atoms_ids_expansion: dict = None[source]
placements: pandas.DataFrame = None[source]
output_path: str = None[source]
additional_info: dict = None[source]
logger[source]
num_placed: int | None = None[source]
num_successful: int | None = None[source]
to_hippo_path: str | None = None[source]
num_unique_products: int | None = None[source]
num_products_enumstereo: int | None = None[source]
get_products() pd.DataFrame and str[source]

Main entry to the Slipper class. This function is used to get the products the self.library object.

place_products()[source]

This function is used to place the products with Fragmenstein.

write_products_to_hippo() str[source]

Writes a dataframe that contains the values needed for HIPPO db input.

Returns:

str : the path to the saved dataframe

Return type:

path

check_scaffold_in_hippo(hippo_df: pandas.DataFrame, hippo_path: str)[source]

Checks if there is a scaffold in the scaffold names of the HIPPO output.

_load_products_dfs(products_files: List[str]) Dict[int, pandas.DataFrame][source]

Load the products dataframes from the files in the /extra directory and putting into dict where key is step.

_structure_products_for_hippo(placements_df: pandas.DataFrame, product_dfs: Dict[int, pandas.DataFrame]) pandas.DataFrame[source]

Structures the placements or products df for HIPPO output.

calculate_inchi_similarity(smiles1: str, smiles2: str) int[source]
find_matches(row, step, df_previous_step: pandas.DataFrame) List[str][source]
_put_hippo_dfs_together(hippo_dfs: Dict[int, pandas.DataFrame]) pandas.DataFrame[source]

Puts the HIPPO dataframes together by matching on each reaction scaffold to the correct previous step’s reactant.

_structure_step_for_hippo(step: int, products_df: pandas.DataFrame) pandas.DataFrame[source]

Structures the products df for HIPPO output.

which_reactant_was_previous_product(r1_is_previous_product: bool, r2_is_previous_product: bool) int | None[source]

Determine which reactant was the scaffold of the previous step.

_delete_file_or_directory(path)[source]

Delete a file or directory at the given path.

_should_delete_file(file, suffixes_to_keep)[source]

Determine if a file should be deleted based on its suffix.

clean_up_placements()[source]

This function is used to remove extra files that are generated by Fragmenstein.

get_placements_df() pandas.DataFrame | None[source]

This function is used to get the placements dataframe which is the merged df with the products.