Plot RMSD (Root Mean Square Deviation) - k-ngo/CATMD GitHub Wiki
Plot RMSD (Root Mean Square Deviation)
Overview and Methodology
What It Does
This script calculates the Root Mean Square Deviation (RMSD) over time for up to four atomic groups within a molecular dynamics simulation. RMSD provides insight into how much a structure deviates from its initial conformation, serving as a key metric for assessing structural stability and conformational changes.
How It Works
- Objective: Quantify structural deviations during a trajectory for selected atom groups.
- Process:
- Alignment: Each frame is aligned to a reference frame (typically the first) using a specified atom selection.
- RMSD Calculation: Measures the average positional deviation of atoms from their reference positions.
- Per-Residue Option: Allows for RMSD calculation at the residue level for fine-grained analysis.
- Multi-Group Support: Supports up to four simultaneous group selections.
- Rolling Average: Optionally overlays a smoothed curve using a rolling window.
Configuration and Inputs
Prerequisites
- Requires a loaded trajectory.
Key Configuration Options
-
Selections:
group1_sel
–group4_sel
: Define up to four atomic groups using MDAnalysis selection strings.group1_name
–group4_name
: Custom labels for each group.
-
Per-Residue Analysis:
plot_groupX_individual=True
: Enables per-residue RMSD for group X.
-
RMSD Method:
'All Atoms'
: Uses all atoms in the selection.'Backbone'
: Restricts to backbone atoms (N
,CA
,C
).'CA'
: Uses only alpha-carbon atoms.
-
Frame Range:
begin_frame
,end_frame
,step
: Defines trajectory slicing (e.g., skip frames, partial sampling).
-
Simulation Duration:
time_total
: Total duration of the trajectory (used for X-axis).
-
Rolling Average:
plot_rolling_average=True
: Adds smoothed curve.rolling_window
: Number of frames in the rolling window.
-
Plot Customization:
fig_width
,fig_height
: Plot dimensions.title_label
,xlabel
,ylabel
: Axis titles and their font sizes.sns_style
,color_palette
: Aesthetic settings for consistent styling.legend_size
: Font size for legend.
Output
-
RMSD Plot:
figures/*_RMSD.png
— RMSD vs. time plot for each group or per-residue RMSD curves if selected. -
Console Output:
- Defined group selections and options.
- Confirmation of processed frame range.
- Path to saved plot.
Interpreting the Results
-
Stable RMSD:
- Indicates minimal deviation from the reference frame.
- Common for well-folded domains or highly rigid regions.
-
Gradual Increase:
- Suggests conformational change, flexibility, or drift.
- Often observed in loop regions or solvent-exposed segments.
-
High RMSD with Fluctuations:
- Reflects dynamic, unstable regions or unfolding events.
-
Per-Residue Trends:
- Peaks may highlight flexible loops or mobile sidechains.
- Flat traces often correlate with structured, stable residues.
Example Scenarios
Protein Stability
- Scenario: Simulate a folded protein over 500 ns.
- Observation: Flat RMSD around 1–2 Å.
- Interpretation: Structure is stable over the simulation.
Domain Movement
- Scenario: Large protein with mobile subdomains.
- Observation: RMSD gradually increases to 5 Å.
- Interpretation: Subdomain movement or hinge flexibility.
Residue-Specific Flexibility
- Scenario: Use per-residue RMSD for a loop region.
- Observation: Certain residues show larger deviations.
- Interpretation: Indicates local flexibility or disorder.
Usage Tips
-
Selection Strategy:
- Use
and not resname TIP WAT
to exclude solvent. - Choose selections that make structural sense (e.g., specific chains or domains).
- Use
-
CA vs Backbone vs All Atoms:
- Use
'CA'
for global motions and quick comparisons. - Use
'Backbone'
or'All Atoms'
for higher accuracy or fine motions.
- Use
-
Smoothing:
- Use
rolling_window=3–5
for typical smoothing. Adjust based on trajectory length.
- Use
-
Per-Residue View:
- Recommended for detailed insights but may generate clutter; use filtering or post-processing for clarity.