Skip to main content

MDCheck

CI PyPI version Python versions License: MIT DOI

Automated Convergence, Statistical Inefficiency, and Reproducibility Assessment for Molecular Dynamics Simulations.


Overview

MDCheck is an open-source scientific toolkit that solves a universal methodological need in biomolecular and materials simulations: certifying whether a molecular dynamics trajectory has converged, reached equilibrium, and accumulated sufficient statistically independent observations for publication.

Instead of manually inspecting plots or guessing equilibration cutoffs, mdcheck analyzes raw timeseries (.xvg, .csv, .dat, .log) with a single command and delivers:

  • 🎯 Automated Equilibration Detection ($t_{\text{eq}}$) via statistical inefficiency minimization.
  • ⏱️ Integrated Autocorrelation Time ($\tau_{\text{int}}$) & Statistical Inefficiency ($g$) using Madras-Sokal self-consistent windowing.
  • 🔢 Effective Sample Size ($N_{\text{eff}} = N / g$) to ensure statistically rigorous error estimation.
  • 🔄 Multi-Replica Reproducibility Matrix ($R_1 \text{ vs } R_2 \text{ vs } R_3$) based on Jensen-Shannon Divergence (JSD) and Essential Subspace Overlap (RMSIP).
  • 📉 Linear & CUSUM Systematic Drift Diagnostics and Flyvbjerg-Petersen block averaging.
  • 🚦 Quality Certification Badges (PASS / WARNING / FAIL) with unambiguous diagnostic messages.
  • 📑 Publication-Ready Outputs: Interactive self-contained report.html, vector plots (SVG/PDF/PNG 300 DPI), LaTeX summary tables (.tex), and a draft Methods & Supporting Information text snippet with automated BibTeX citations.
  Simulations (.xvg, .csv, .dat)
               │
               ▼
  ┌───────────────────────────────────────────────────────────┐
  │                         MDCheck                           │
  │  ├── Auto Equilibration (max N_eff)                       │
  │  ├── Autocorrelation & Inefficiency (tau_int, g)          │
  │  ├── Multi-Replica Overlap (Jensen-Shannon, RMSIP)        │
  │  └── Drift Detection & Block Averaging                    │
  └───────────────────────────────────────────────────────────┘
               │
               ▼
  ┌───────────────────────────────────────────────────────────┐
  │                   Publication Deliverables                │
  │  ├── report.html (Interactive Dashboard & Badges)         │
  │  ├── mdcheck_convergence_overview.pdf/svg/png             │
  │  ├── mdcheck_summary_table.tex / .csv                     │
  │  ├── methods_snippet.txt (Ready for Manuscript)           │
  │  └── citation.bib (BibTeX Reference)                      │
  └───────────────────────────────────────────────────────────┘

Installation

From PyPI

pip install mdcheck

From Source (Development Mode)

git clone https://github.com/sircalch/mdcheck.git
cd mdcheck
pip install -e .[dev]

Quickstart (CLI)

1. Test Demo Mode (Instant Synthetic Multi-Replica Simulation)

mdcheck demo -o my_demo_results/

Open my_demo_results/report.html in any web browser to see the interactive report!

2. Assess GROMACS XVG Trajectory

mdcheck assess -i rmsd.xvg gyrate.xvg energy.xvg -o md_quality_report/

3. Assess Multi-Replica Convergence (R1, R2, R3)

mdcheck assess -i rep1_rmsd.xvg -r rep2_rmsd.xvg rep3_rmsd.xvg -o replica_assessment/

Python API Usage

import numpy as np
from mdcheck import assess_trajectory_quality
from mdcheck.reporters import generate_publication_figures, generate_manuscript_assets, generate_html_report

# Load or define your timeseries (e.g. Backbone RMSD over 100 ns)
time_coords = np.linspace(0, 100, 2000)  # ns
rmsd_series = ... # 1D numpy array

# Assess simulation quality
report = assess_trajectory_quality(
    timeseries_dict={"Backbone_RMSD": rmsd_series},
    time_coords=time_coords
)

print(f"Overall Quality Status: {report.overall_status}")
print(f"Equilibration Time: {report.observables['Backbone_RMSD'].t_eq_time:.2f} ns")
print(f"Effective Sample Size (N_eff): {report.observables['Backbone_RMSD'].n_eff:.0f}")

# Export publication figures and LaTeX tables
generate_publication_figures({"Backbone_RMSD": rmsd_series}, time_coords, report, "output_dir/")
generate_manuscript_assets(report, "output_dir/")
generate_html_report(report, "output_dir/report.html")

Scientific Foundations & Methodology

1. Automated Equilibration Detection ($t_{\text{eq}}$)

The initial non-equilibrium transient phase is automatically identified by maximizing the total effective sample size in the subsequent production interval: $$\hat{t}{\text{eq}} = \arg\max{t_0} N_{\text{eff}}(t_0) = \arg\max_{t_0} \frac{N - t_0}{g(t_0)}$$

2. Autocorrelation & Statistical Inefficiency ($g$)

MD frames are temporally correlated. MDCheck computes the integrated autocorrelation time $\tau_{\text{int}}$ using the Madras-Sokal self-consistent cutoff window: $$\tau_{\text{int}} = \frac{1}{2} + \sum_{k=1}^{M} C(k), \quad M \ge 6 \tau_{\text{int}}$$ $$g = 1 + 2\tau_{\text{int}}, \quad N_{\text{eff}} = \frac{N_{\text{prod}}}{g}$$

3. Multi-Replica Conformational Overlap

Conformational consistency between independent trajectories ($R_1, R_2, R_3$) is evaluated via the square-root of Jensen-Shannon Divergence ($\mathrm{JSD} \in [0, 1]$) and Root-Mean-Square Inner Product (RMSIP) across essential PCA subspaces: $$\mathrm{JSD}(P \parallel Q) = \frac{1}{2} D_{\text{KL}}(P \parallel M) + \frac{1}{2} D_{\text{KL}}(Q \parallel M)$$


Citation

If you use MDCheck to evaluate trajectory convergence, equilibration, statistical inefficiency, or replica reproducibility in your research, please cite:

@software{monreal2026mdcheck,
  author = {Monreal-Hern{\'a}ndez, Andre},
  title = {{MDCheck: Automated Convergence, Statistical Inefficiency, and Reproducibility Assessment for Molecular Dynamics Simulations}},
  year = {2026},
  version = {1.0.0},
  publisher = {Zenodo},
  url = {https://github.com/sircalch/mdcheck}
}

License

This project is licensed under the MIT License - see the LICENSE file for details.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mdcheck-1.0.0.tar.gz (32.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mdcheck-1.0.0-py3-none-any.whl (34.0 kB view details)

Uploaded Python 3

File details

Details for the file mdcheck-1.0.0.tar.gz.

File metadata

  • Download URL: mdcheck-1.0.0.tar.gz
  • Upload date:
  • Size: 32.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.10

File hashes

Hashes for mdcheck-1.0.0.tar.gz
Algorithm Hash digest
SHA256 f639255e9beb0f892624194b54a729d3139d973c2e32d5137f7433442a508816
MD5 8907c2d1f94606785d36de2acda65fcd
BLAKE2b-256 58a844cd797480cc8f2528b09a823703e43ac1439fb8848a2b8dbdebf989b17b

See more details on using hashes here.

File details

Details for the file mdcheck-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: mdcheck-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 34.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.10

File hashes

Hashes for mdcheck-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 94147b3a69fb405a943bc3ccc95c250e8e9e2d2af9159c846e7d4a0b73af7769
MD5 ac9370ab72dedea40fdb9ce53105c912
BLAKE2b-256 61de8a4bbb3cc09776809b99e6c47998d745afff3f390e278bce0bd2b9db8049

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page