Plot RMSF (Root Mean Square Fluctuation) - k-ngo/CATMD GitHub Wiki

Plot RMSF (Root Mean Square Fluctuation)

Overview and Methodology

What It Does

This script calculates the Root Mean Square Fluctuation (RMSF) of atoms over a simulation trajectory to quantify the positional flexibility of regions or residues. It supports up to four groups and can report either:

  • One RMSF value per group
  • One RMSF value per residue (if plot_individual = True)

How It Works

  • Trajectory Alignment: Each group is aligned to itself in the first frame to remove global motion.
  • RMSF Calculation:
    • Measures the average deviation of atomic positions from their mean over time.
    • Uses either all atoms in the selection or per-residue averages.
  • Visualization: Plots RMSF as a bar chart, colored by group.

Configuration and Inputs

Selections

  • groupX_sel (1–4): Atom selections (e.g., "segid VSD and protein")
  • groupX_name: Labels for legend/group coloring
  • plot_groupX_individual: Whether to compute RMSF per residue (True) or as a group average (False)

Frame Settings

  • begin_frame, end_frame, step: Frame range and sampling
  • time_total: Used only for labeling

Output

  • RMSF Bar Plot
    figures/<group1_name>_<group2_name>_RMSF.png
    Displays RMSF values for each group or residue with color-coded bars.

  • Legend
    If per-residue RMSF is enabled, groups are color-coded and included in the legend.

  • Console Output

    • Lists selection details
    • Displays total frames processed
    • Confirms save location

Interpreting the Results

  • High RMSF:
    • Indicates high flexibility or mobility (e.g., termini, loops)
  • Low RMSF:
    • Suggests stable, rigid regions (e.g., helices, core residues)
  • Comparative Insight:
    • Helps identify differential dynamics across groups or domains
    • Useful for analyzing the effect of mutations, ligand binding, or conformational changes

Example Scenarios

Membrane Channel Domain Comparison

  • group1_sel = "segid VSD", group2_sel = "segid POI"
  • Observation: VSD shows lower RMSF
  • Interpretation: VSD is more rigid than interacting domain

Per-Residue Flexibility of a Peptide

  • group1_sel = "segid TOX and resid 1 to 20"
  • plot_group1_individual = True
  • Observation: Residues 1–5 show the highest RMSF
  • Interpretation: N-terminus is more flexible than rest of the peptide

Mutant vs. Wild-Type RMSF

  • Use different selections for WT and mutant simulations
  • Insight: Can reveal stabilization/destabilization at specific sites

Usage Tips

  • Exclude Water: Automatically excludes TIP/WAT residues from calculation
  • Alignment is per group: Each selection is internally aligned to itself, not globally
  • Per-residue RMSF is slower: Uses more memory and CPU time, but more informative