OpenMMDL Analysis functions

This page displays all the functions of OpenMMDL Analysis.

openmmdl_analysis.barcode_generation

barcodegeneration(df, interaction)

Generates barcodes for a given interaction.

Parameters:
  • protein_name (str) – Name of the protein PDB.

  • df (pandas.dataframe) – Dataframe containing all interactions from plip analysis (typicaly df_all)

  • interaction (str) – name of the interaction to generate a barcode for

Returns:

binary array of wit 1 representing the interaction is present in the corresponding frame

Return type:

numpy.array

waterids_barcode_generator(df, interaction)

Generates a barcode containing coresponding water ids for a given interaction.

Parameters:
  • df (pandas.dataframe) – Dataframe containing all interactions from plip analysis (typicaly df_all)

  • interaction (str) – name of the interaction to generate a barcode for

Returns:

returns a list of waterids for the frames where the interaction is present 0 if no interaction present

Return type:

list

plot_barcodes(barcodes, save_path)

Generates picture of barcodes for interactions of a specific type.

Parameters:
  • barcodes (list) – list of np arrays containing the barcodes for each interaction

  • save_path (str) – name of the file to save the picture to

Returns:

None

Return type:

None

plot_waterbridge_piechart(df_all, waterbridge_barcodes, waterbridge_interactions)

Generates piecharts for each waterbridge interaction with the water ids of the interacting waters.

Parameters:
  • df_all (pandas.dataframe) – Dataframe containing all interactions from plip analysis (typicaly df_all)

  • waterbridge_barcodes (list) – list of np arrays containing the barcodes for each waterbridge interaction

  • waterbridge_interactions (list) – list of strings containing waterbridge interactions

Returns:

None

Return type:

None

plot_bacodes_grouped(interactions, df_all, interaction_type)

Generates barcode figures and groups them by ligandatom, aswell as total interaction barcode for a giveen lingenatom.

Parameters:
  • interactions (list) – list of pandas.indexes that contain the interactions to generate barcodes for

  • df_all (pandas.dataframe) – Dataframe containing all interactions from plip analysis (typicaly df_all)

  • interaction_type (str) – name of the interaction to generate a barcode for

Returns:

None

Return type:

None

openmmdl_analysis.binding_mode_processing

gather_interactions(df, ligand_rings, peptide=None)

Process a DataFrame with the protein-ligand interaction and generate column names for each unique interaction.

Parameters:
  • df (pandas.dataframe) – DataFrame that contains the interaction data for the whole trajectory.

  • ligand_rings (list) – List of the ligand ring information to recognize the atom numbers belonging to rings for hydrophobic interactions.

  • peptide (str) – Name of the peptide chain in the protein. If None, the peptide chain is not considered.

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

remove_duplicate_values(data)

Remove the duplicate values from sub-dictionaries within the input dictionary.

Parameters:

data (dict) – The input dictionary containing sub-dictionaries with possible duplicate values.

Returns:

A dictionary without duplicate values.

Return type:

dict

combine_subdict_values(data)

Combines the values from the individual sub-dictionaries into a single list.

Parameters:

data (dict) – Dictionary with values that are sub-dictionaries.

Returns:

A dictionary with a single key named ‘all’ that contains a list of all combined values from all the sub-dictionaries.

Return type:

dict

filtering_values(threshold, frames, df, unique_columns_rings_grouped)

Filter and append values (interactions) to a DataFrame based on occurrence counts.

Parameters:
  • threshold (float) – A treshold value that is used for filtering of the values (interactions) based upon the occurence count.

  • frames (int) – The number of frames that is used to calculate the treshold.

  • df (pandas.dataframe) – DataFrame to which the filtered values (interactions) will be added.

  • unique_columns_rings_grouped (dict) – Dictionary containing the grouped and unique values otained from gather_interactions.

Returns:

A list of values, with unique values and their corresponding occurence counts.

Return type:

list

unique_data_generation(filtered_values)
Parameters:

filtered_values (list) – 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, peptide=None)

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 (pandas.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.

  • peptide (str) – Name of the peptide chainid in the original topology. Defaults to None. If None, the peptide chain is not considered.

Returns:

None

Return type:

None

update_values(df, new, unique_data)

Update the values in the input DataFrame based upon the frame values and an reference DataFrame.

Parameters:
  • df (pandas.dataframe) – Input DataFrame that will be updated.

  • new (pandas.dataframe) – The reference DataFrame containing values that are used to update the input DataFrame.

  • unique_data (dict) – A dictionary containing keys that represent the specific unique column names that need to be updated in the input DataFrame.

Returns:

None

Return type:

None

calculate_representative_frame(traj, bmode_frame_list, lig)

Calculates the most representative frame for a bindingmode. This is based uppon the averagwe RMSD of a frame to all other frames in the binding mode.

Parameters:
  • traj (mdanalysis.universe) – MDAnalysis universe object containing the trajectory.

  • bmode_frame_list (list) – List of frames belonging to a binding mode.

  • lig (str) – Name of the ligand in the topology.

openmmdl_analysis.find_stable_waters

trace_waters(topology, trajectory, output_directory)

Trace the water molecules in a trajectory and write all which move below one Angstrom distance. To adjust the distance alter the integer

Parameters:
  • topology (str) – Path to the topology file.

  • trajectory (str) – Path to the trajectory file.

  • output_directory (str) – Path to the output directory.

Returns:

DataFrame containing stable water coordinates.

Return type:

pandas.DataFrame

Returns:

Total number of frames.

Return type:

int

perform_clustering_and_writing(stable_waters, cluster_eps, total_frames, output_directory)

Perform DBSCAN clustering on the stable water coordinates, and write the clusters and their representatives to PDB files.

Parameters:
  • stable_waters (pandas.DataFrame) – DataFrame containing stable water coordinates.

  • cluster_eps (float) – DBSCAN clustering epsilon parameter. This is in Angstrom in this case, and defines which Water distances should be within one cluster

  • total_frames (int) – Total number of frames.

  • output_directory (str) – Path to the output directory.

Returns:

None

Return type:

None

write_pdb_clusters_and_representatives(clustered_waters, min_samples, output_sub_directory)

Writes the clusters and their representatives to PDB files.

Parameters:
  • clustered_waters (pandas.dataframe) – DataFrame containing clustered water coordinates.

  • min_samples (int) – DBSCAN clustering min_samples parameter.

  • output_sub_directory (str) – Path to the output subdirectory.

Returns:

None

Return type:

None

stable_waters_pipeline(topology, trajectory, water_eps, output_directory='./stableWaters')

Function to run the pipeline to extract stable water clusters, and their representatives from a PDB & DCD file

Parameters:
  • topology (str) – Path to the topology file.

  • trajectory (str) – Path to the trajectory file.

  • water_eps (float) – DBSCAN clustering epsilon parameter.

  • output_directory (str) – Path to the output directory. Optional, defaults to “./stableWaters”

Returns:

None

Return type:

None

filter_and_parse_pdb(protein_pdb)

This function reads in a PDB and returns the structure with bioparser.

Parameters:

protein_pdb (str) – Path to the PDB file.

Returns:

Biopython PDB Structure object.

Return type:

biopython.structure

find_interacting_residues(structure, representative_waters, distance_threshold)

This function maps waters (e.g. the representative waters) to interacting residues of a different PDB structure input. Use “filter_and_parse_pdb” to get the input for this function

Parameters:
  • structure (biopython.structure) – Biopython PDB Structure object.

  • representative_waters (pandas.dataframe) – DataFrame containing representative water coordinates.

  • distance_threshold (float) – Threshold distance for identifying interacting residues.

Returns:

Dictionary mapping cluster numbers to interacting residues.

Return type:

dict

read_pdb_as_dataframe(pdb_file)

Helper function reading a PDB

Parameters:

pdb_file (str) – Path to the PDB file.

Returns:

DataFrame containing PDB data.

Return type:

pandas.dataframe

analyze_protein_and_water_interaction(protein_pdb_file, representative_waters_file, cluster_eps, output_directory='./stableWaters', distance_threshold=5.0)

Analyse the interaction of residues to water molecules using a threshold that can be specified when calling the function

Parameters:
  • protein_pdb_file (str) – Path to the protein PDB file without waters.

  • representative_waters_file (str) – Path to the representative waters PDB file, or any PDB file containing only waters

  • cluster_eps (float) – DBSCAN clustering epsilon parameter.

  • output_directory (str) – Path to the output directory. Optional, defaults to “./stableWaters”

  • distance_threshold (float) – Threshold distance for identifying interacting residues. Optional, defaults to 5.0

Returns:

None

Return type:

None

openmmdl_analysis.interaction_gathering

characterize_complex(pdb_file, binding_site_id)

Characterize the protein-ligand complex and return their interaction set

Parameters:
  • pdb_file (str) – Path to the PDB file.

  • binding_site_id (str) – A string that specifies the identifier of the binding site

Returns:

A object representing the interactions if. If Binding site is not found returns None

Return type:

plip.pdb_complex.basic.interaction_sets

retrieve_plip_interactions(pdb_file, lig_name)

Retrieves the interactions from PLIP.

Parameters:
  • pdb_file (str) – Path to the PDB file.

  • lig_name (str) – Name of the ligand in the topology.

Returns:

A dictionary of the binding sites and the interactions.

Return type:

dict

retrieve_plip_interactions_peptide(pdb_file, peptide)

Retrives the interactions from PLIP for a peptide.

Parameters:
  • pdb_file (str) – Path to the PDB file.

  • peptide (str) – Name of the peptide chainid in the original topology.

Returns:

A dictionary of the binding sites and the interactions.

Return type:

dict

create_df_from_binding_site(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) – The interaction type of interest (default set to hydrogen bond). Defaults to “hbond”.

Returns:

DataFrame with information retrieved from PLIP.

Return type:

pandas.DataFrame

change_lig_to_residue(file_path, old_residue_name, 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) – Path to the topology file.

  • old_residue_name (str) – Name of the ligand in the topology.

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

Returns:

None

Return type:

None

process_frame(frame, pdb_md, lig_name, special=None, peptide=None):

Process a single frame of MD simulation.

Parameters:
  • frame (int) – Number of frame to be processed.

  • pdb_md (mdanalysis.universe) – MDAnalysis universe object containing the trajectory.

  • lig_name (str) – Name of the ligand in the topology.

  • special (str) – Name of the special ligand in the topology. Defaults to None.

  • peptide (str) – Name of the peptide chainid in the original topology. Defaults to None.

Returns:

A dataframe conatining the interaction data for the processed frame.

Return type:

pandas.dataframe

process_frame_special(frame, pdb_md, lig_name, special=None)

Function extension of process_frame to process special ligands.

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

  • pdb_md (mdanalysis.universe) – MDAnalysis universe object containing the trajectory.

  • lig_name (str) – Name of the ligand in the topology.

  • special (str) – Name of the special ligand in the topology. Defaults to None.

Returns:

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

Return type:

list

process_frame_wrapper(args)

Wrapper for the MD Trajectory procession.

Parameters:

args (tuple) – Tuple containing (frame_idx: int - number of the frame to be processed, pdb_md: mda.universe - MDA Universe class representation of the topology and the trajectory of the file that is being processed, lig_name: str - Name of the ligand in the complex that will be analyzed, special_ligand: str - Name of the special ligand that will be analysed, peptide: str - Chainid of the peptide that will be analyzed)

Returns:

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

Return type:

tuple

process_trajectory(pdb_md, dataframe, num_processes, lig_name, special_ligand, peptide)

Process protein-ligand trajectory with multiple CPUs in parallel.

Parameters:
  • pdb_md (mdanalysis.universe) – MDAnalysis universe object containing the trajectory.

  • dataframe (str) – Name of a CSV file as str, where the interaction data will be read from if not None.

  • num_processes (int) – Number of processes to be used for the parallelization.

  • lig_name (str) – Name of the ligand in the topology.

  • special_ligand (str) – Name of the special ligand in the topology.

  • peptide (str) – Name of the peptide chainid in the original topology.

Returns:

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

Return type:

pandas.dataframe

fill_missing_frames(df, md_len)

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

Parameters:
  • df (pandas.dataframe) – The input DataFrame with frames that have no Interactions

  • md_len (int) – The value that indicates the number of frames, thus allowing the function to loop through the DataFrame

Returns:

DataFrame with placeholder values in the frames with no interactions.

Return type:

pandas.dataframe

openmmdl_analysis.markov_state_figure_generation

min_transition_calculation(min_transition)

Calculates a list based on the minimum transition time provided values and returns it in factors 1, 2, 5, 10.

Parameters:

min_transition (int) – The minimum tranisiton time input for the generation of the factors.

Returns:

List with the minimum transition time with factors 1, 2, 5, 10.

Return type:

list

binding_site_markov_network(total_frames, min_transitions, combined_dict, font_size=12, size_node=200)

Generate Markov Chain plots based on transition probabilities.

Parameters:
  • total_frames (int) – The number of frames in the protein-ligand MD simulation.

  • min_transitions (list) – List of transition tresholds in %. A Markov Chain plot will be generated for each of the tresholds.

  • combined_dict (dict) – A dictionary with the information of the Binding Modes and their order of appearance during the simulation for all frames.

  • font_size (int) – The font size for the node labels. The default value is set to 12.

  • size_node (int) – The size of the nodes in the Markov Chain plot. the default value is set to 200.

Returns:

None

Return type:

None

openmmdl_analysis.pml_writer

generate_pharmacophore_centers(df, interactions)

Generates pharmacophore points for interactions that are points such as hydrophobic and ionic interactions

Parameters:
  • df (pandas.dataframe) – Dataframe containing all interactions from plip analysis (typicaly df_all)

  • interactions (list) – list of strings containing the interactions to generate pharmacophore points for

Returns:

Dict of interactions from which pharmacophore is generated as key and list of coordinates as value

Return type:

dict

generate_pharmacophore_vectors(df, interactions)

Generates pharmacophore points for interactions that are vectors such as hydrogen bond donors or acceptors

Parameters:
  • df (pandas.dataframe) – Dataframe containing all interactions from plip analysis (typicaly df_all)

  • interactions (list) – list of strings containing the interactions to generate pharmacophore points for

Returns:

Dict of interactions from which pharmacophore is generated as key and list of coordinates as value (first coords are ligand side, second are protein side)

Return type:

dict

generate_md_pharmacophore_cloudcenters(df, core_compound, output_filename, sysname, id_num=0)

Generates pharmacophore from all interactions formed in the MD simulation. A feature is generated for each interaction at the center of all its ocurrences.

Parameters:
  • df (pandas.dataframe) – Dataframe containing all interactions from plip analysis (typicaly df_all)

  • core_compound (str) – Name of the ligand.

  • output_filename (str) – Name of the output file.

  • sysname (str) – Name of the system.

  • id_num (int) – Number of the system. Defaults to 0.

Returns:

None

Return type:

None

generate_bindingmode_pharmacophore(dict_bindingmode, core_compound, sysname, outname, id_num=0)

Generates pharmacophore from a binding mode and writes it to a .pml file

Parameters:
  • dict_bindingmode (dict) – Dictionary containing all interactions of the bindingmode and thei coresponding ligand and protein coordinates.

  • core_compound (str) – Name of the ligand.

  • sysname (str) – Name of the system.

  • outname (str) – Name of the output file.

  • id_num (int) – Number of the system. Defaults to 0.

Returns:

None

Return type:

None

generate_pharmacophore_centers_all_points(df, interactions)

Generates pharmacophore points for all interactions to generate point cloud.

Parameters:
  • df (pandas.dataframe) – Dataframe containing all interactions from plip analysis (typicaly df_all)

  • interactions (list) – list of strings containing the interactions to generate pharmacophore points for.

Returns:

Dict of interactions from which pharmacophore is generated as key and list of coordinates as value

Return type:

dict

generate_point_cloud_pml(cloud_dict, sysname, outname)

Generates pharmacophore point cloud and writes it to a .pml file

Parameters:
  • cloud_dict (dict) – Dictionary containing all interactions of the trajectory and their corresponding ligand coordinates.

  • sysname (str) – Name of the system.

  • outname (str) – Name of the output file.

Returns:

None

Return type:

None

openmmdl_analysis.preprocessing

increase_ring_indices(ring, lig_index)

Increases the atom indices in a ring of the ligand obtained from the ligand to fit the atom indices present in the protein-ligand complex.

Parameters:
  • ring (str) – A list of atom indices belonging to a ring that need to be modified.

  • lig_index (int) – An integer that is the first number of the ligand atom indices obtained from the protein-ligand, which is used to modify the ring indices

Returns:

A new list with modified atom indicies.

Return type:

list

convert_ligand_to_smiles(input_sdf, output_smi)

Converts ligand structures from an SDF file to SMILES :) format

Parameters:
  • input_sdf (str) – Path to the input SDF file.

  • output_smi (str) – Path to the output SMILES file.

Returns:

None

Return type:

None

process_pdb_file(input_pdb_filename)

Process a PDB file to make it compatible with the openmmdl_analysis package.

Parameters:

input_pdb_filename (str) – Path to the input PDB file.

Returns:

None

Return type:

None

extract_and_save_ligand_as_sdf(input_pdb_filename, output_filename, target_resname)

Extract and save the ligand from the receptor ligand complex PDB file into a new PDB file by itself.

Parameters:
  • input_pdb_filename (str) – Path to the input PDB file.

  • output_filename (str) – Path to the output SDF file.

  • target_resname (str) – Name of the ligand in the target PDB file.

Returns:

None

Return type:

None

renumber_atoms_in_residues(input_pdb_file, output_pdb_file, lig_name)

Renumer the atoms of the ligand in the topology PDB file.

Parameters:
  • input_pdb_file (str) – Path to the input PDB file.

  • output_pdb_file (str) – Path to the output PDB file.

  • lig_name (str) – Name of the ligand in the input PDB file.

Returns:

None

Return type:

None

replace_atom_type(data)

Replace wrong ligand atom types in the topology PDB file.

Parameters:

data (str) – Text of the initial PDB file.

Returns:

Edited text of the PDB file.

Return type:

str

process_pdb(input_file, output_file)

Wrapper function to process a PDB file.

Parameters:
  • input_file (str) – Path to the input PDB file.

  • output_file (str) – Path to the output PDB file.

Returns:

None

Return type:

None

move_hydrogens_to_end(structure, target_residue_name)

Moves hydrogens to the last lines of theresidue in the PDB file.

Parameters:
  • structure (biopython.structure) – Biopython PDB Structure object.

  • target_residue_name (str) – Name of the target residue in the input PDB file.

Returns:

None

Return type:

None

openmmdl_analysis.rdkit_figure_generation

generate_ligand_image(ligand_name, complex_pdb_file, ligand_no_h_pdb_file, smiles_file, output_png_filename)

Generates a PNG image of the ligand.

Parameters:
  • ligand_name (str) – Name of the ligand in the topology.

  • complex_pdb_file (str) – Path to the PDB file of the protein-ligand complex.

  • ligand_no_h_pdb_file (str) – Path to the PDB file of the ligand without hydrogens.

  • smiles_file (str) – Path to the SMILES file of the ligand.

  • output_png_filename (str) – Path to the output PNG file.

Returns:

None

Return type:

None

split_interaction_data(data)

Splits the Input which consists of the ResNr and ResType, Atom indices, interaction type in multiple parts.

Parameters:

data (list) – A list of ResNr and ResType, Atom indices, interaction type that needs to be split.

Returns:

A new list of the interaction data that consists of three parts, being the protein_partner_name that represents the interacting protein residue, numeric codes, that represent the atom indices of the interacting atoms of the ligand and the interaction type.

Return type:

list

highlight_numbers(split_data, starting_idx)

Extracts the data from the split_data output of the interactions and categorizes it to its respective list.

Parameters:
  • split_data (list) – A list of interaction data items, where each item contains information about protein partner name, numeric codes and interaction type.

  • starting_idx (list) – Starting index of the ligand atom indices used for identifying the correct atom to highlight.

Returns:

A tuple that contains list of all of the highlighted atoms of all of the interactions. - highlighted_hbond_donor (list of int): Atom indices for hydrogen bond donors. - highlighted_hbond_acceptor (list of int): Atom indices for hydrogen bond acceptors. - highlighted_hbond_both (list of int): Atom indices for interactions that are both donors and acceptors. - highlighted_hydrophobic (list of int): Atom indices for hydrophobic interactions. - highlighted_waterbridge (list of int): Atom indices for water-bridge interactions. - highlighted_pistacking (list of int): Atom indices for pi-stacking interactions. - highlighted_halogen (list of int): Atom indices for halogen interactions. - highlighted_ni (list of int): Atom indices for negative ionizable salt bridge interactions. - highlighted_pi (list of int): Atom indices for positive ionizable salt bridge interactions. - highlighted_pication (list of int): Atom indices for pi-cation interactions. - highlighted_metal (list of int): Atom indices for metal interactions.

Return type:

tuple

generate_interaction_dict(interaction_type, keys)

Generates a dictionary of interaction RGB color model based on the provided interaction type.

Parameters:
  • interaction_type (str) – The type of the interaction, for example ‘hydrophobic’.

  • keys (list) – List of the highlighted atoms that display an interaction.

Returns:

A dictionary with the interaction types are associated with their respective RGB color codes.

Return type:

dict

update_dict(target_dict, *source_dicts)

Updates the dictionary wth the keys and values from other dictionaries.

Parameters:
  • target_dict (dict) – The dictionary that needs to be updated with new keys and values.

  • source_dicts (dict) – One or multiple dictionaries that are used to update the target dictionary with new keys and values.

Returns:

None

Return type:

None

create_and_merge_images(binding_mode, occurrence_percent, split_data, merged_image_paths)

Create and merge images to generate a legend for binding modes.

Parameters:
  • binding_mode (str) – Name of the binding mode.

  • occurrence_percent (float) – Percentage of the binding mode occurrence.

  • split_data (list) – Data of the interactions used to generate the legend.

  • merged_image_paths (list) – A list with the paths to the rdkit figures.

Returns:

Paths to the merged images.

Return type:

list

arranged_figure_generation(merged_image_paths, output_path)

Generate an arranged figure by arranging merged images in rows and columns.

Parameters:
  • merged_image_paths (list) – Paths of the merged images with the rdkit figure and legend.

  • output_path (dict) – The paths where the arranged output should be saved.

Returns:

None

Return type:

None

openmmdl_analysis.rmsd_calculation

rmsd_for_atomgroups(prot_lig_top_file, prot_lig_traj_file, selection1, selection2=None)

Calulate the RMSD for selected atom groups, and save the csv file and plot.

Parameters:
  • prot_lig_top_file (str) – Path to the topology file.

  • prot_lig_traj_file (str) – Path to the trajectory file.

  • selection1 (str) – Selection string for main atom group, also used during alignment.

  • selection2 (list) – Selection strings for additional atom groups. Defaults to None.

Returns:

DataFrame containing RMSD of the selected atom groups over time.

Return type:

pandas.dataframe

RMSD_dist_frames(prot_lig_top_file, prot_lig_traj_file, lig, nucleic=False)

Calculate the RMSD between all frames in a matrix.

Parameters:
  • prot_lig_top_file (str) – Path to the topology file.

  • prot_lig_traj_file (str) – Path to the trajectory file.

  • lig (str) – Name of the ligand in the topology.

  • nucleic (bool) – Boolean to indicate if the receptor is a nucleic acid. Defaults to False.

Returns:

pairwise_rmsd_prot. Numpy array of RMSD values for pairwise protein structures.

Return type:

numpy.array

Returns:

pairwise_rmsd_lig. Numpy array of RMSD values for ligand structures.

Return type:

numpy.array

openmmdl_analysis.visualization_functions

interacting_water_ids(df_all, waterbridge_interactions)

Generates a list of all water ids that form water bridge interactions.

Parameters:
  • df_all (pandas.dataframe) – Dataframe containing all interactions from plip analysis (typicaly df_all)

  • waterbridge_interactions (list) – list of strings containing waterbridge interactions

Returns:

list of all unique water ids that form water bridge interactions

Return type:

list

save_interacting_waters_trajectory(pdb_file_path, dcd_file_path, interacting_waters, ligname, special, outputpath='./Visualization/')

Saves .pdb and .dcd files of the trajectory containing ligand, receptor and all interacting waters.

Parameters:
  • pdb_file_path (str) – Path to the original PDB file.

  • dcd_file_path (str) – Path to the original DCD file.

  • interacting_waters (list) – List of all interacting water ids

  • ligname (str) – Name of the ligand in the topology.

  • special (str) – Name of the special ligand in the topology.

  • outputpath (str) – Path to the output directory. Optional, defaults to “./Visualization/”

Returns:

None

Return type:

None

cloud_json_generation(df_all)

Generates dict for visualization of interaction clouds. Later saved as .json file.

Parameters:

df_all (pandas.dataframe) – Dataframe containing all interactions from plip analysis (typicaly df_all)

Returns:

Dict containing all interaction clouds

Return type:

dict

visualization(ligname, receptor_type='protein or nucleic', height='1000px', width='1000px')

Generates visualization of the trajectory with the interacting waters and interaction clouds.

Parameters:
  • ligname (str) – Name of the ligand in the topology.

  • receptor_type (str) – Type of the receptor. Defaults to “protein or nucleic”.

  • height (str) – Height of the visualization. Defaults to “1000px”.

  • width (str) – Width of the visualization. Defaults to “1000px”.

Returns:

Returns an nglview.widget object containing the visualization

Return type:

nglview.widget

run_visualization()

Runs the visualization notebook in the current directory. The visualization notebook is copied from the package directory to the current directory and automaticaly started.

Returns:

None

Return type:

None