syndirella.structure_outputs ============================ .. py:module:: syndirella.structure_outputs .. autoapi-nested-parse:: syndirella.structure_outputs.py This module contains the functions used to structure the pipeline outputs. Attributes ---------- .. autoapisummary:: syndirella.structure_outputs.logger Functions --------- .. autoapisummary:: syndirella.structure_outputs.add_route_info syndirella.structure_outputs.add_outcome_info syndirella.structure_outputs.get_output_df syndirella.structure_outputs.get_scaffold_smiles syndirella.structure_outputs.get_error_info syndirella.structure_outputs.get_inchi syndirella.structure_outputs.check_route_to_add syndirella.structure_outputs.check_placement_to_add syndirella.structure_outputs.check_additional_info_to_add syndirella.structure_outputs.add_new_route_to_output_df syndirella.structure_outputs.save_output_df syndirella.structure_outputs.structure_route_outputs syndirella.structure_outputs.structure_pipeline_outputs Module Contents --------------- .. py:data:: logger .. py:function:: add_route_info(reaction_names: List[str], reactants: List[Tuple[str]], route_uuid: str) -> Dict This function formats the full route into seperate columns for each reactant. .. py:function:: add_outcome_info(slipper: syndirella.slipper.Slipper.Slipper | None = None, template_path: str | None = None, hits_names: List[str] | None = None) -> Dict[str, Any] This function adds placement information (None if not attempted). .. py:function:: get_output_df(csv_path: str, output_dir: str) -> Tuple[pandas.DataFrame, str | None] 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 .. py:function:: get_scaffold_smiles(error: Exception | None, smiles: str | None, workshop: syndirella.route.CobblersWorkshop.CobblersWorkshop | None) -> str This function gets the scaffold smiles from the error, smiles, or workshop. .. py:function:: get_error_info(error: Exception | None) -> Tuple[str | None, str | None, bool] This function gets the error type and message from the error. .. py:function:: get_inchi(scaffold: str, workshop: syndirella.route.CobblersWorkshop.CobblersWorkshop | None) -> str This function gets the inchi from the scaffold and workshop. .. py:function:: check_route_to_add(workshop: syndirella.route.CobblersWorkshop.CobblersWorkshop | None) -> bool 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. .. py:function:: check_placement_to_add(slipper: syndirella.slipper.Slipper.Slipper | None) -> bool 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. .. py:function:: check_additional_info_to_add(slipper: syndirella.slipper.Slipper.Slipper | None) -> bool This function checks if there is additional information in the slipper object. .. py:function:: add_new_route_to_output_df(output_df: pandas.DataFrame, row: Dict) -> pandas.DataFrame 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. .. py:function:: save_output_df(output_df: pandas.DataFrame, output_dir: str, csv_path: str) 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 .. py:function:: 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 This function structures the route outputs as a single row in the output dataframe. .. py:function:: 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) Structure outputs of pipeline.