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
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.
- 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.
- 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.
- _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.
- _should_delete_file(file, suffixes_to_keep)[source]
Determine if a file should be deleted based on its suffix.