API Documentation for interactions

class InteractionAnalyzer(pdb_md, dataframe, num_processes, lig_name, special_ligand, peptide, md_len)

Analyzes molecular interactions between a protein and a ligand/peptide throughout an MD trajectory using PLIP (Protein-Ligand Interaction Profiler).

Variables:
  • pdb_md (mda.Universe) – MDAnalysis Universe object representing the topology and trajectory.

  • dataframe (str or None) – Path to an existing interaction CSV file. If None, the trajectory will be processed anew.

  • num_processes (int) – Number of CPU cores to use for parallel frame analysis.

  • lig_name (str) – Residue name of the ligand in the complex.

  • special_ligand (str) – Residue name for special ligands like metal ions (optional).

  • peptide (str) – Chain ID of the peptide ligand (optional).

  • md_len (int) – Number of frames in the trajectory.

  • interaction_list (pd.DataFrame) – DataFrame storing the extracted interactions across the trajectory.

_retrieve_plip_interactions(self, pdb_file, lig_name)

Retrieves the interactions from PLIP.

Parameters:
  • pdb_file (str) – The path of the PDB file of the complex.

  • lig_name (str) – Name of the Ligand in the complex topology that will be analyzed.

Returns:

A dictionary of the binding sites and the interactions.

Return type:

dict

_retrieve_plip_interactions_peptide(self, pdb_file)

Retrives the interactions from PLIP for a peptide.

Parameters:

pdb_file (str) – The path of the PDB file of the complex.

Returns:

A dictionary of the binding sites and the interactions.

Return type:

dict

_create_df_from_binding_site(self, selected_site_interactions, interaction_type='hbond')

Creates a data frame from a binding site and interaction type.

Parameters:
  • selected_site_interactions (dict) – Precaluclated interactions from PLIP for the selected site.

  • interaction_type (str, optional) – The interaction type of interest (default set to hydrogen bond). Defaults to “hbond”.

Returns:

DataFrame with information retrieved from PLIP.

Return type:

pd.DataFrame

_change_lig_to_residue(self, file_path, new_residue_name)

Reformats the topology file to change the ligand to a residue. This is needed for interactions with special ligands such as metal ions.

Parameters:
  • file_path (str) – Filepath of the topology file.

  • new_residue_name (str) – New residue name of the ligand now changed to mimic an amino acid residue.

Returns:

None. Modifies and writes out new topology file.

Return type:

None

_process_frame(self, frame)

Process a single frame of MD simulation.

Parameters:

frame (int) – The number of the frame that will be processed.

Returns:

A dataframe conatining the interaction data for the processed frame.

Return type:

pd.DataFrame

_process_frame_special(self, frame)

Function extension of process_frame to process special ligands.

Parameters:

frame (int) – Number of the frame that will be processed.

Returns:

List of dataframes containing the interaction data for the processed frame with the special ligand.

Return type:

list of pd.DataFrame

_process_frame_wrapper(self, args)

Wrapper for the MD Trajectory procession.

Parameters:

args (tuple) – Tuple containing (frame_idx: int - number of the frame to be processed).

Returns:

Tuple containing the frame index and the result of from the process_frame function.

Return type:

tuple

:fill_missing_frames(self, df)

Fills the frames with no interactions in the DataFrame with placeholder values.

Parameters:

df (pd.DataFrame) – The input DataFrame with frames that have no interactions

Returns:

DataFrame with placeholder values in the frames with no interactions.

Return type:

pd.DataFrame

_process_trajectory(self)

Process protein-ligand trajectory with multiple CPUs in parallel.

Returns:

A DataFrame containing all the protein-ligand interaction data from the whole trajectory.

Return type:

pd.DataFrame