syndirella.slipper.SlipperFitter

slipper_fitter/CobblersWorkshop.py

This module contains the SlipperFitter class.

Classes

SlipperFitter

This class is instantiated to place all the products in the template using hits_path

Module Contents

class syndirella.slipper.SlipperFitter.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)[source]

This class is instantiated to place all the products in the template using hits_path

template_path: str[source]
hits_path: str[source]
hits_names: List[str][source]
output_dir: str[source]
id: str | None = None[source]
route_uuid: str | None = None[source]
scaffold_placements: Dict[syndirella.error.Chem.Mol, str | None] = None[source]
atom_diff_min: int = 0[source]
atom_diff_max: int = 10[source]
final_products_csv_path: str | None = None[source]
final_products_pkl_path: str | None = None[source]
batch_num: int | None = None[source]
final_products: pandas.DataFrame | None = None[source]
placements: pandas.DataFrame | None = None[source]
merged_placements: pandas.DataFrame | None = None[source]
output_path = None[source]
n_cores: int = 8[source]
timeout: int = 240[source]
logger[source]
num_placed: int | None = None[source]
num_successful: int | None = None[source]
fit_products()[source]

Main entry to the SlipperFitter class. This function is used to fit the products to the final library.

check_scaffold(scaffold: syndirella.error.Chem.Mol, scaffold_name: str, scaffold_place_num: int) str | None[source]

Checks if the scaffold can be minimised (no specific stereoisomer) and passes intermolecular checks. If it cannot be minimised after 3 attempts, returns False.

_check_intra_geom_flatness_results(geometries: Dict, flat_results: Dict) bool[source]

This function checks the intramolecular geometry and flatness results and returns True if all are True.

_prep_scaffold_input_df(scaffold: syndirella.error.Chem.Mol, scaffold_name: str) pandas.DataFrame[source]

Prepares input dataframe to Fragmenstein for the scaffold compound.

_get_scaffold(input_df: pandas.DataFrame) syndirella.error.Chem.Mol[source]

Get scaffold compound as mol object from the input_df.

prep_products() pandas.DataFrame[source]

This function is used to prepare the inputs for Fragmenstein.

_prepare_input_df() pandas.DataFrame[source]

Creates the input dataframe for the placements. Will remove duplicates of names and other metadata from synthesizer step.

_print_diff(orig_df: pandas.DataFrame, input_df: pandas.DataFrame, verb: str = None)[source]

This function is used to print the difference between the original number of analogues and the number of valid analogues.

add_hits(input_df: pandas.DataFrame) pandas.DataFrame[source]
This function adds:

hits_path as mol objects to input_df[‘hits’]

_place_scaffold(lab: fragmenstein.Laboratory, input_df: pandas.DataFrame) syndirella.error.Chem.Mol[source]

Places the scaffold compound, returns the mol object of the scaffold compound if successful else None.

place_products(input_df: pandas.DataFrame) pandas.DataFrame[source]

This function places products using Fragmenstein.

check_intra_geometry(placements: pandas.DataFrame) pandas.DataFrame[source]

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

setup_Fragmenstein(output_path: str) fragmenstein.Laboratory[source]

This function sets up Fragmenstein to run.

format_placements()[source]

This function edits the placements by changing outcome column, adding paths to mol files, formatting scaffold placements and checking intramolecular geometry.

fix_intxns()[source]
format_scaffold_placements(df: pandas.DataFrame) pandas.DataFrame[source]

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.

get_scaffold_check_values(scaffold_path: str) Tuple[float, float, float, float][source]

This function gets the ∆∆G, comRMSD, ∆G_bound and ∆G_unbound values from the placement done by scaffold check.

add_paths_to_placements(df: pandas.DataFrame) pandas.DataFrame[source]

Adds the absolutes paths to the .mol files.

merge_placements() pandas.DataFrame[source]

This function merges the fragmenstein output with products csv.

save_placements(id: str, route_uuid: str)[source]

This function saves the placements as a .pkl.gz and .csv file.