WatCon.residue_analysis module

Per-residue water analysis

WatCon.residue_analysis.classify_waters(network, ref1_coords, ref2_coords)[source]

Classify all water-protein interactions based on two reference angles.

This function analyzes the geometric relationships between water molecules and protein atoms by calculating angles relative to two reference points.

Parameters:
  • network (WaterNetwork) – The water network object containing interaction data.

  • ref1_coords (array-like) – Coordinates of the first reference point (e.g., an atom or centroid).

  • ref2_coords (array-like) – Coordinates of the second reference point (e.g., an atom or centroid).

Returns:

A dictionary describing interaction classifications and calculated angles.

Return type:

dict

WatCon.residue_analysis.get_all_water_distances(network_group, box, selection='No-active-site', msa=False, offset=0)[source]

Collect all distances for each protein-interacting water

Parameters:
  • network_group (list[WaterNetwork]) – List of WaterNetwork objects

  • box (array-like) – Dimensions of unit-cell

  • selection ({‘No-active-site’, ‘active-site’, ‘all’}) – Analysis selection

  • msa (bool, optional) – Indicate whether to use MSA indexing or standard residue indexing. Defualt is False

  • offset (int, optional) – Residue offset from desired numbering that can be given to match standard residue indexing. Default is 0.

WatCon.residue_analysis.get_interaction_counts(network, selection='all')[source]

Calculate numbers of interactions split by ‘water-water’ and ‘water-protein’.

Parameters:
  • network (WaterNetwork object)

  • selection ({‘all’, ‘active_region’, ‘not_active_region’}) – Specifies which subset of the graph to analyze.

Returns:

Describes number of ‘water-water’ and ‘water-protein’ interactions.

Return type:

dict

WatCon.residue_analysis.get_per_residue_interactions(network, selection='all', msa=False)[source]

Calculate numbers of interactions per residue.

Parameters:
  • network (WaterNetwork object)

  • selection ({‘all’, ‘active_region’, ‘not_active_region’}) – Specifies which subset of the graph to analyze.

  • msa (bool, optional) – Indicate whether to use msa common residue indices

Returns:

Describes number of interactions per residue.

Return type:

dict

WatCon.residue_analysis.histogram_metrics(all_files, input_directory, concatenate, output_dir='images')[source]

Plot histograms for calculated metrics

Parameters:
  • all_files (list) – List of all files

  • input_directory (str) – Directory which contains .pkl files

  • concatenate (list) – List of files to concatenate

  • output_dir (str, optional) – Output directory. Default is ‘images’

Return type:

None

WatCon.residue_analysis.plot_interactions_from_angles(csvs, input_dir='msa_classification', output_dir='MSA_images', name1='DYNAMIC', name2='STATIC')[source]

Plot water classifications from 2-angle analysis

Parameters:
  • csvs (list) – List of .csv files outputted from classify_waters

  • output_dir (str) – Directory to write images

Return type:

None

WatCon.residue_analysis.plot_residue_interactions(topology_file, cutoff=0.0, watcon_directory='watcon_output', output_dir='images')[source]

Plot water-protein interactions by residue and color by average number of simultaneous interactions

Parameters:
  • topology_file (str) – Full path to an MDAnalysis-readable topology

  • cutoff (float, optional) – Cutoff to show residue interactions. Default is 0.2.

  • watcon_directory (str, optional) – Directory containing WatCon output files. Default is ‘watcon_output’

  • output_dir (str, optional) – Directory to save resulting image. Default is ‘images’

Return type:

None