Plot Interaction Formation and Loss Distributions - k-ngo/CATMD GitHub Wiki
Plot Interaction Formation and Loss Distributions
Overview and Methodology
What it does
This tool visualizes the temporal distribution of interaction formation and loss events throughout a simulation. For each interaction type, such as hydrogen bonds, salt bridges, hydrophobic contacts, π-stacking, and cation–π interactions, it generates a bar plot showing when new contacts form and when existing ones disappear.
How it works
- Objective: Highlight the timing and frequency of transitions in interaction networks across the trajectory.
- Process:
- Loads binary interaction matrices (e.g.,
hbonds_*.csv
) generated by the ▶️ (Run First) Extract Pairwise Interaction from Trajectory tool. - Identifies formation events (transitions from 0 → 1) and loss events (transitions from 1 → 0) for all residue-residue interaction pairs.
- For each time point (frame), counts the number of formation and loss events.
- Displays this data as a time series bar plot, with gains plotted upward and losses plotted downward.
- Loads binary interaction matrices (e.g.,
Configuration and Inputs
Prerequisites
- Requires interaction CSVs generated using the same
sel1_name
andsel2_name
from the extraction step.
Key configuration options
-
Selection labels:
sel1_name
,sel2_name
: Must match the labels used during extraction. Used to locate interaction data files.
-
Interaction mode:
interaction_mode
: Must match the previous step (interchain + intrachain
,interchain
, orintrachain
).
Output
-
Bar plots:
- One plot per interaction type, such as:
hydrogen_bonds_transition_distribution.png
salt_bridges_transition_distribution.png
- Each time point is represented by two bars:
- Upward bar = number of formation events
- Downward bar = number of loss events
- Saved to the
saved_results
directory.
- One plot per interaction type, such as:
-
Console output:
- Reports file paths where each plot was saved.
- Warns if interaction data is missing or no transitions are found.
Interpreting the Results
-
Formation vs. loss dominance:
- If upward bars dominate, the system is building new contacts more frequently.
- If downward bars dominate, contacts are breaking more often.
-
Contact turnover dynamics:
- Spikes in both formation and loss suggest rapid reorganization or transitions between states.
- Quiet periods may indicate structural stability or equilibrium.
-
Time-resolved patterns:
- Early or late surges in transitions can reflect induced fit, binding events, or domain rearrangements.
-
Comparison across types:
- Running this tool across multiple interaction types reveals which contact classes are most dynamic.
Example Scenarios
Detecting ligand-induced contact onset
- Scenario: A toxin binds to a voltage sensor domain during the first third of the simulation.
- Selections:
sel1 = 'segid VSD'
sel2 = 'resname TOX'
,sel2_is_ligand = True
- Observation:
- A sharp peak in hydrogen bond and hydrophobic contact formation in the early frames.
- Interpretation:
- Indicates initial binding event that stabilizes via specific contacts. May guide binding site refinement.
Monitoring contact dissolution during unbinding
- Scenario: A substrate gradually unbinds from a catalytic pocket.
- Selections:
sel1 = 'resid 100-130'
(pocket)sel2 = 'resname SUB'
- Observation:
- Gradual increase in contact loss events, especially hydrogen bonds and π-stacking, over time.
- Interpretation:
- Reflects disassembly of interaction network supporting the unbinding process.
Visualizing contact churn during domain rearrangement
- Scenario: Two protein domains explore multiple configurations over the trajectory.
- Selections:
sel1 = 'segid A'
sel2 = 'segid B'
- Observation:
- Repeated alternating peaks in both gain and loss across all interaction types.
- Interpretation:
- Suggests flexible interface with multiple metastable contact networks, characteristic of hinge or swivel motion.
Usage Tips
- Loss Events:
- Loss events are plotted as negative bars to distinguish them from formations; consider this when interpreting plot symmetry.