syndirella.slipper.SlipperFitter ================================ .. py:module:: syndirella.slipper.SlipperFitter .. autoapi-nested-parse:: slipper_fitter/CobblersWorkshop.py This module contains the SlipperFitter class. Classes ------- .. autoapisummary:: syndirella.slipper.SlipperFitter.SlipperFitter Module Contents --------------- .. py:class:: SlipperFitter(template_path: str, hits_path: str, hits_names: List[str], output_dir: str, id: str | None = None, route_uuid: str | None = None, scaffold_placements: Dict[syndirella.error.Chem.Mol, str | None] = None) This class is instantiated to place all the products in the template using hits_path .. py:attribute:: template_path :type: str .. py:attribute:: hits_path :type: str .. py:attribute:: hits_names :type: List[str] .. py:attribute:: output_dir :type: str .. py:attribute:: id :type: str | None :value: None .. py:attribute:: route_uuid :type: str | None :value: None .. py:attribute:: scaffold_placements :type: Dict[syndirella.error.Chem.Mol, str | None] :value: None .. py:attribute:: atom_diff_min :type: int :value: 0 .. py:attribute:: atom_diff_max :type: int :value: 10 .. py:attribute:: final_products_csv_path :type: str | None :value: None .. py:attribute:: final_products_pkl_path :type: str | None :value: None .. py:attribute:: batch_num :type: int | None :value: None .. py:attribute:: final_products :type: pandas.DataFrame | None :value: None .. py:attribute:: placements :type: pandas.DataFrame | None :value: None .. py:attribute:: merged_placements :type: pandas.DataFrame | None :value: None .. py:attribute:: output_path :value: None .. py:attribute:: n_cores :type: int :value: 8 .. py:attribute:: timeout :type: int :value: 240 .. py:attribute:: logger .. py:attribute:: num_placed :type: int | None :value: None .. py:attribute:: num_successful :type: int | None :value: None .. py:method:: fit_products() Main entry to the SlipperFitter class. This function is used to fit the products to the final library. .. py:method:: check_scaffold(scaffold: syndirella.error.Chem.Mol, scaffold_name: str, scaffold_place_num: int) -> str | None Checks if the scaffold can be minimised (no specific stereoisomer) and passes intermolecular checks. If it cannot be minimised after 3 attempts, returns False. .. py:method:: _check_intra_geom_flatness_results(geometries: Dict, flat_results: Dict) -> bool This function checks the intramolecular geometry and flatness results and returns True if all are True. .. py:method:: _prep_scaffold_input_df(scaffold: syndirella.error.Chem.Mol, scaffold_name: str) -> pandas.DataFrame Prepares input dataframe to Fragmenstein for the scaffold compound. .. py:method:: _get_scaffold(input_df: pandas.DataFrame) -> syndirella.error.Chem.Mol Get scaffold compound as mol object from the input_df. .. py:method:: prep_products() -> pandas.DataFrame This function is used to prepare the inputs for Fragmenstein. .. py:method:: _prepare_input_df() -> pandas.DataFrame Creates the input dataframe for the placements. Will remove duplicates of names and other metadata from synthesizer step. .. py:method:: _print_diff(orig_df: pandas.DataFrame, input_df: pandas.DataFrame, verb: str = None) This function is used to print the difference between the original number of analogues and the number of valid analogues. .. py:method:: add_hits(input_df: pandas.DataFrame) -> pandas.DataFrame This function adds: hits_path as mol objects to input_df['hits'] .. py:method:: _place_scaffold(lab: fragmenstein.Laboratory, input_df: pandas.DataFrame) -> syndirella.error.Chem.Mol Places the scaffold compound, returns the mol object of the scaffold compound if successful else None. .. py:method:: place_products(input_df: pandas.DataFrame) -> pandas.DataFrame This function places products using Fragmenstein. .. py:method:: check_intra_geometry(placements: pandas.DataFrame) -> pandas.DataFrame Checks the intramolecular geometry and flatness of double bonds and aromatic rings of each mol object using PoseBuster's implemented checks. Checks: Bond lengths The bond lengths in the input molecule are within 0.75 of the lower and 1.25 of the upper bounds determined by distance geometry Bond angles The angles in the input molecule are within 0.75 of the lower and 1.25 of the upper bounds determined by distance geometry Planar aromatic rings All atoms in aromatic rings with 5 or 6 members are within 0.25 Å of the closest shared plane Planar double bonds The two carbons of aliphatic carbon–carbon double bonds and their four neighbours are within 0.25 Å of the closest shared plane Internal steric clash The interatomic distance between pairs of non-covalently bound atoms is above 0.7 of the lower bound determined by distance geometry .. py:method:: setup_Fragmenstein(output_path: str) -> fragmenstein.Laboratory This function sets up Fragmenstein to run. .. py:method:: format_placements() This function edits the placements by changing outcome column, adding paths to mol files, formatting scaffold placements and checking intramolecular geometry. .. py:method:: fix_intxns() .. py:method:: format_scaffold_placements(df: pandas.DataFrame) -> pandas.DataFrame This function checks if the scaffold placement was successful. If not, attempt to replace it with the scaffold placement performed for the scaffold check. If that placement failed, don't replace. .. py:method:: get_scaffold_check_values(scaffold_path: str) -> Tuple[float, float, float, float] This function gets the ∆∆G, comRMSD, ∆G_bound and ∆G_unbound values from the placement done by scaffold check. .. py:method:: add_paths_to_placements(df: pandas.DataFrame) -> pandas.DataFrame Adds the absolutes paths to the .mol files. .. py:method:: merge_placements() -> pandas.DataFrame This function merges the fragmenstein output with products csv. .. py:method:: save_placements(id: str, route_uuid: str) This function saves the placements as a .pkl.gz and .csv file.