API Documentation for bindingmodes
- class BindingModeProcesser(pdb_md, ligand, peptide, special, ligand_rings, interaction_list, threshold, total_frames)
A class that processes protein-ligand interaction data for a given molecular dynamics (MD) simulation trajectory. The class performs multiple analyses on interaction data, such as filtering interactions based on frequency, generating fingerprints according to the combination of interactions present in frames creating specific binding modes.
- Variables:
pdb_md (str) – The path to the molecular dynamics (MD) PDB file for the protein-ligand complex.
ligand (str) – The ligand information (e.g., name or structure).
peptide (str or None) – The peptide chain ID, if applicable, or None if not considered.
special (bool) – Special handling or unique identifiers related to the ligand or protein.
ligand_rings (list) – List of ligand ring information used for hydrophobic interaction detection.
interaction_list (pd.DataFrame) – DataFrame containing the interactions for the trajectory frames.
threshold (float) – The threshold for filtering interactions based on their occurrence frequency.
total_frames (int) – The total number of frames in the molecular dynamics simulation trajectory.
unique_columns_rings_grouped (dict) – A dictionary containing the grouped interactions based on frames.
interactions_all (pd.DataFrame) – DataFrame containing all interaction data processed.
unique_data_all (dict) – Dictionary of unique data generated for all interactions across all frames.
unique_data (dict) – Dictionary of unique data generated based on filtered interactions and threshold.
- _gather_interactions(df)
Process a DataFrame with the protein-ligand interaction and generate column names for each unique interaction.
- Parameters:
df (pd.DataFrame) – DataFrame that contains the interaction data for the whole trajectory.
- Returns:
A dictionary with the keys being ‘FRAME’ numbers and values being dictionaries containing row indices and their corresponding unique column names for interactions.
- Return type:
dict
- _process_interaction_wraper(interaction_list, threshold)
Apply filtering and interaction enumeration to an interaction DataFrame.
- Parameters:
interaction_list (pd.DataFrame) – Interaction data obtained from the MD simulation.
threshold (float) – Threshold for interaction occurrence (as a fraction of total frames).
- Returns:
interaction_list (pd.DataFrame): Modified DataFrame including new interaction columns that contain the filtered values.
unique_data (dict): Dictionary containing unique filtered interaction names.
- Return type:
tuple[pd.DataFrame, dict]
- _filtering_values(threshold, df)
Filter and append values (interactions) to a DataFrame based on occurrence counts.
- Parameters:
threshold (float) – A threshold value that is used for filtering of the values (interactions) based upon the occurence count.
df (pd.DataFrame) – DataFrame to which the filtered values (interactions) will be added.
- Returns:
A list of values, with unique values and their corresponding occurence counts.
- Return type:
list of str
- _unique_data_generation(filtered_values)
Generate a dictionary conataing the unique interactions from a list of filtered values obtained by filtering_values.
- Parameters:
filtered_values (list of str) – A list of values, where the unique interactions are extracted from.
- Returns:
A dictionary containing the filtered unique interactions.
- Return type:
dict
- _df_iteration_numbering(df, unique_data)
Loop through the DataFrame and assign the values 1 and 0 to the rows, depending if the corresponding interaction from unique data is present.
- Parameters:
df (pd.DataFrame) – DataFrame which has the interaction data for all of the frames.
unique_data (dict) – Dictionary that contains the unique interactions obtained from unique_data_generation.
- Returns:
None. Modifies the input DataFrame in-place by appending columns corresponding to recurring interactions.
- Return type:
None