syndirella.structure_outputs

syndirella.structure_outputs.py

This module contains the functions used to structure the pipeline outputs.

Attributes

logger

Functions

add_route_info(→ Dict)

This function formats the full route into seperate columns for each reactant.

add_outcome_info(→ Dict[str, Any])

This function adds placement information (None if not attempted).

get_output_df(→ Tuple[pandas.DataFrame, str | None])

Given the csv_path and output_dir, checks and reads in the most recent previous output df.

get_scaffold_smiles(→ str)

This function gets the scaffold smiles from the error, smiles, or workshop.

get_error_info(→ Tuple[str | None, str | None, bool])

This function gets the error type and message from the error.

get_inchi(→ str)

This function gets the inchi from the scaffold and workshop.

check_route_to_add(→ bool)

This function checks if there is a route defined in the workshop object.

check_placement_to_add(→ bool)

This function checks if there is placement information in the slipper object.

check_additional_info_to_add(→ bool)

This function checks if there is additional information in the slipper object.

add_new_route_to_output_df(→ pandas.DataFrame)

This function adds a new row to the output dataframe. If the row contains different columns,

save_output_df(output_df, output_dir, csv_path)

This function saves the output dataframe to a csv file in the output directory.

structure_route_outputs(→ pandas.DataFrame)

This function structures the route outputs as a single row in the output dataframe.

structure_pipeline_outputs(error, csv_path, output_dir)

Structure outputs of pipeline.

Module Contents

syndirella.structure_outputs.logger[source]
syndirella.structure_outputs.add_route_info(reaction_names: List[str], reactants: List[Tuple[str]], route_uuid: str) Dict[source]

This function formats the full route into seperate columns for each reactant.

syndirella.structure_outputs.add_outcome_info(slipper: syndirella.slipper.Slipper.Slipper | None = None, template_path: str | None = None, hits_names: List[str] | None = None) Dict[str, Any][source]

This function adds placement information (None if not attempted).

syndirella.structure_outputs.get_output_df(csv_path: str, output_dir: str) Tuple[pandas.DataFrame, str | None][source]

Given the csv_path and output_dir, checks and reads in the most recent previous output df.

Format of output csv name: [name_of_input_csv]_output_YYYYMMDD_HHMM.csv

syndirella.structure_outputs.get_scaffold_smiles(error: Exception | None, smiles: str | None, workshop: syndirella.route.CobblersWorkshop.CobblersWorkshop | None) str[source]

This function gets the scaffold smiles from the error, smiles, or workshop.

syndirella.structure_outputs.get_error_info(error: Exception | None) Tuple[str | None, str | None, bool][source]

This function gets the error type and message from the error.

syndirella.structure_outputs.get_inchi(scaffold: str, workshop: syndirella.route.CobblersWorkshop.CobblersWorkshop | None) str[source]

This function gets the inchi from the scaffold and workshop.

syndirella.structure_outputs.check_route_to_add(workshop: syndirella.route.CobblersWorkshop.CobblersWorkshop | None) bool[source]

This function checks if there is a route defined in the workshop object.

Returns True if route is defined. Returns False if route is not defined.

syndirella.structure_outputs.check_placement_to_add(slipper: syndirella.slipper.Slipper.Slipper | None) bool[source]

This function checks if there is placement information in the slipper object.

Returns True if placement information exists. Returns False if placement information does not exist.

syndirella.structure_outputs.check_additional_info_to_add(slipper: syndirella.slipper.Slipper.Slipper | None) bool[source]

This function checks if there is additional information in the slipper object.

syndirella.structure_outputs.add_new_route_to_output_df(output_df: pandas.DataFrame, row: Dict) pandas.DataFrame[source]

This function adds a new row to the output dataframe. If the row contains different columns, they are added to the output_df, and all values are filled with None if not present before.

syndirella.structure_outputs.save_output_df(output_df: pandas.DataFrame, output_dir: str, csv_path: str)[source]

This function saves the output dataframe to a csv file in the output directory.

Format of output csv name: [name_of_input_csv]_output_YYYYMMDD_HHMM.csv

syndirella.structure_outputs.structure_route_outputs(error_message: str | None, error_type: str | None, output_df: pandas.DataFrame, workshop: syndirella.route.CobblersWorkshop.CobblersWorkshop | None, slipper: syndirella.slipper.Slipper.Slipper | None, scaffold: str, template_path: str | None, hits: List[str] | None, additional_info: Dict | None) pandas.DataFrame[source]

This function structures the route outputs as a single row in the output dataframe.

syndirella.structure_outputs.structure_pipeline_outputs(error: Exception | None, csv_path: str, output_dir: str, workshop: syndirella.route.CobblersWorkshop.CobblersWorkshop | None = None, slipper: syndirella.slipper.Slipper.Slipper | None = None, smiles: str | None = None, template_path: str | None = None, hits: List[str] | None = None, additional_info: Dict | None = None)[source]

Structure outputs of pipeline.