A complete, modular, publication-quality analysis pipeline for a 100 ns GROMACS MD simulation of an α-zein protein (UniProt A8HNE1, 187 residues) built as an ab initio AlphaFold 3 model and simulated in an explicit cellular/solvent environment (CHARMM36, TIP3P, K⁺/Cl⁻).
Every analysis is a self-contained Python module that can be run independently
or through run_all.py. Each writes CSV data, 300-dpi PNG and PDF
figures, and feeds an automatically generated Markdown report.
The production system is large (~608k atoms) and the trajectory is ~4.4 GB, but the protein is only 2,912 atoms. The pipeline therefore:
- Preprocesses once — streams the full trajectory a single time and writes a
PBC-corrected, protein-only trajectory (
data/protein.xtc, ~21 MB, ~200× smaller). All protein analyses run on this and are fast. - Needs no external binaries — no
gmx, no standalone DSSP, no AmberTools:- energies are read straight from the
.edrwith panedr, - secondary structure uses mdtraj's built-in DSSP,
- MM-GBSA scripts are generated (see note below).
- energies are read straight from the
analysis/
├── config.py # single source of truth for paths & parameters
├── run_all.py # orchestrator (runs everything, builds the report)
├── requirements.txt / environment.yml / README.md
│
├── mdkit/ # shared utilities
│ ├── io_utils.py # universe loading, CLI, CSV, progress bars
│ ├── plotting.py # Nature-like style, save PNG+PDF @300 dpi
│ └── stats_utils.py # mean/median/std/95% CI, rolling, block avg
│
├── scripts/ # one module per analysis (each has run(cfg)+CLI)
│ ├── preprocess.py # build protein-only trajectory (run first)
│ ├── rmsd.py rmsf.py rog.py sasa.py com.py structural.py
│ ├── hbonds.py salt_bridges.py native_contacts.py contact_map.py
│ ├── pca.py dccm.py clustering.py secondary_structure.py
│ ├── ramachandran.py rin.py prolif_analysis.py mmgbsa.py
│ ├── energies.py convergence.py statistics_summary.py
│ └── report.py # Markdown report generator
│
├── data/ # protein.xtc, protein.pdb, meta.json (preprocessing outputs)
├── results/ # all CSV outputs (+ cluster_structures/*.pdb)
├── figures/ # all figures (PNG + PDF, 300 dpi)
├── tables/ # summary/statistics tables, MM-GBSA scripts
└── report/ # analysis_report.md, mmgbsa_workflow.md
# option A: conda (recommended — reliable rdkit/mdtraj/MDAnalysis builds)
conda env create -f environment.yml
conda activate zein-md
# option B: pip (Python 3.11)
python -m pip install -r requirements.txtpython run_all.py \
--top step5_production.tpr \
--traj step5_production.xtc \
--edr step5_production.edr \
--output .Omit the flags to use the defaults in config.py. Preprocessing runs
automatically the first time; use --force-preprocess to rebuild it.
python scripts/rmsd.py # backbone & Cα RMSD
python scripts/pca.py # PCA + free-energy landscape
python scripts/secondary_structure.pypython run_all.py --list # list module keys
python run_all.py --only rmsd,rmsf,rog # run a subset
python run_all.py --skip prolif_analysis # skip the slow ProLIF step| Module | Outputs |
|---|---|
rmsd |
backbone & Cα RMSD + moving average, plateau |
rmsf |
per-residue RMSF, flexible-region highlighting |
rog |
radius of gyration, mean ± σ |
structural |
end-to-end, Dmax, shape anisotropy κ², convex-hull volume, elongation |
sasa |
total + per-residue SASA (Shrake–Rupley) |
hbonds |
protein–protein & protein–solvent H-bonds, occupancy, lifetime, donor/acceptor table |
com |
COM X/Y/Z, distance travelled, 3D trajectory |
pca |
covariance, eigenvalues, PC1/PC2, free-energy landscape |
dccm |
dynamic cross-correlation matrix |
contact_map |
contact occupancy + time-resolved difference map |
clustering |
RMSD clustering, optimal k (silhouette), medoid PDBs, populations |
secondary_structure |
DSSP timeline, helix/sheet/coil % |
salt_bridges |
salt-bridge count & occupancy |
native_contacts |
fraction of native contacts Q(t) |
ramachandran |
φ/ψ before vs after MD + ensemble density |
rin |
residue interaction network + centralities/hubs |
prolif_analysis |
protein–water hydration frequency + ProLIF fingerprint |
mmgbsa |
gmx_MMPBSA workflow generation + structural proxy |
energies |
potential/kinetic/total energy, T, P, density from .edr |
convergence |
RMSD plateau, block averaging, first-50 vs last-50 ns, RMSIP |
statistics_summary |
master stats table + Pearson/Spearman correlations |
report |
Markdown report with automated biological interpretation |
MM-GBSA/MM-PBSA computes a binding free energy between two partners. This is a
single, ligand-free protein, so a binding ΔG is not physically defined. The
mmgbsa module therefore generates a ready-to-run gmx_MMPBSA workflow
(tables/mmgbsa_run.sh, tables/mmpbsa.in) for use once two groups are defined,
and provides a force-field-independent per-residue structural contribution
proxy instead. See report/mmgbsa_workflow.md.
- All parameters (cutoffs, strides, window sizes, temperature) live in
config.py. results/pipeline_summary.jsonrecords every module's numeric summary and per-module timings.- Figures are written as both PNG and PDF at 300 dpi for direct manuscript use.