Skip to main content

MDANCE: Molecular Dynamics Analysis with N-ary Clustering Ensembles

A transformative framework for analyzing molecular dynamics simulations through advanced clustering algorithms

Installation • The Problem • Our Solution • Key Features • Quick Start • Publications • Contributing

The Problem

Molecular Dynamics (MD) simulations generate terabytes of conformational data, but extracting meaningful biological insights remains challenging. Traditional clustering methods struggle with:

  • Exponential complexity - MD datasets are massive.
  • Poor initialization - leading to suboptimal clustering.
  • Pathway ambiguity - difficulty identifying dominant biological pathways.
  • Native structure prediction - accurately identifying biologically relevant states.
  • Pairwise similarity limitations - traditional methods only compare pairs of objects, causing performance bottlenecks.
  • Stochastic variability - lack of reproducibility across clustering runs.

Our Solution

MDANCE introduces a novel n-ary similarity framework that transforms how we analyze MD trajectories. Our algorithms provide:

  • Linear scaling - from O(N²) to O(N) complexity.
  • Deterministic results - reproducible science.
  • Biological relevance - algorithms designed for structural biology.
  • Unprecedented accuracy - validated against experimental structures.
  • Extended similarity techniques - swift identification of high and low-density regions in linear time.

Key Features

🪄 NANI - Smart k-means Initialization

Breakthrough: Deterministic centroid initialization using n-ary comparisons to identify high-density regions and select diverse initial conformations.

Key Advantages:

  • Solves the seed selection challenge in k-means clustering.
  • Creates compact, well-separated clusters that accurately find metastable states.
  • Provides consistent cluster populations across replicates.
  • Dramatically reduces runtime: clusters 1.5 million HP35 frames in ~40 minutes.

🧩 HELM - Scalable Hierarchical Clustering

Breakthrough: Combines k-means efficiency with hierarchical flexibility using n-ary difference functions.

Performance:

  • Retains k-means computational efficiency while enabling arbitrary partitions.
  • Successfully analyzes simulations with over 1.5 million frames.
  • Achieves in ~34 minutes what traditional HAC requires 29 hours for 1.5 million frames.
  • Builds hierarchy without expensive pairwise distance matrices.

🌳 DIVINE - Deterministic Divisive Clustering

Breakthrough: Top-down hierarchical clustering framework that recursively splits clusters based on n-ary similarity principles.

Key Features:

  • Completely avoids O(N²) pairwise distance matrices.
  • Deterministic anchor initialization with NANI.
  • Multiple cluster selection criteria including weighted variance metric.
  • Single-pass design enables efficient resolution exploration.
  • Matches or exceeds bisecting k-means quality with reduced runtime.

🌿 mdBIRCH - Online Clustering for MD Data

Innovation: Adapts BIRCH CF-tree to molecular dynamics data with RMSD-calibrated merge tests.

Key Capabilities:

  • Online clustering that processes frames as they arrive.
  • Merge test calibrated directly to RMSD for physical interpretability.
  • Completely avoids pairwise distance matrices.
  • Scales near-linearly with number of frames.
  • Two practical protocols: RMSD-anchored runs and blind sweep analysis.
  • Processes hundreds of thousands of frames on a single CPU core in seconds.

🔍 SHINE - Pathway Analysis

Transformative: Hierarchical clustering that identifies dominant biological pathways from enhanced sampling data.

Key Advantages:

  • Streamlines analysis of pathway ensembles from multiple MD simulations.
  • Integrates n-ary similarity with cheminformatics-inspired tools.
  • Identifies most representative pathway within each pathway class.
  • Provides insight into dominant biomolecular transformation mechanisms.
  • Lower computational cost than Fréchet distance approaches.
  • Successfully applied to alanine dipeptide and adenylate kinase systems.

🌈 PRISM - Pathway Representation & Clustering

Innovation: Pathway Representation via Intrinsic Structural Medoids enables efficient clustering of multiple molecular pathways.

Key Capabilities:

  • Summarizes each pathway by a compact set of representative conformations (structural medoids).
  • Clusters pathways using hierarchical agglomerative clustering based on weighted average Hausdorff distance.
  • Three construction strategies for medoid selection: global sharing, per-pathway independent, or two-stage refinement.
  • Enables efficient analysis of enhanced sampling and multiple pathway ensembles.
  • Designed for multi-trajectory pathway comparison and classification.

🎯 eQual - O(N) Clustering

Innovation: Transforms O(N²) Radial Threshold Clustering into O(N) algorithm with novel seed selection and tie-breaking.

Key Features:

  • Uses k-means++ for efficient seed selection.
  • Employs extended similarity indices for deterministic results.
  • Eliminates memory-intensive pairwise RMSD matrices.
  • Produces compact and well-separated clusters matching RTC quality.

🏆 PRIME - Native Structure Prediction

Game Changer: Predicts native protein structures from simulation data with unprecedented accuracy. Scientific Validation: PRIME (Protein Retrieval via Integrative Molecular Ensembles) perfectly mapped all structural motifs in benchmark studies and consistently identified native structures within 2Å RMSD of experimental data.

2k2e
Superposition of native structure using PRIME (yellow) and experimental native structures (blue) of 2k2e.

Algorithm Comparison

Algorithm Complexity Type Key Feature Best Use Case
NANI O(N) Initialization Deterministic centroids k-means improvement
HELM O(N) Hybrid hierarchical k-means + hierarchical fusion Large-scale analysis
DIVINE O(N) Divisive hierarchical Top-down splitting Multi-resolution analysis
mdBIRCH O(N) Online clustering Streaming data processing Large-scale trajectories
SHINE O(N) Hierarchical Pathway analysis Enhanced sampling
PRISM O(N) Hierarchical Structural medoid representation Multi-pathway comparison
eQual O(N) Flat clustering Linear RTC replacement General purpose
PRIME O(N) Post-processing Native structure prediction Structure validation

Quick Start

Installation

pip install mdance

Basic Usage

import mdance
import numpy as np

# Load your MD trajectory data
data = np.load('trajectory.npy')

# Use NANI for optimal clustering initialization
from mdance.cluster.nani import KmeansNANI
nani = KmeansNANI(data, n_clusters=5, metric='MSD')
optimal_centroids = nani.initiate_kmeans()

# Cluster with standard *k*-means
from sklearn.cluster import KMeans
kmeans = KMeans(5, init=optimal_centroids[:5], n_init=1)
labels = kmeans.fit_predict(data)

Tutorials

Publications

Our methods are backed by peer-reviewed research:

If you use MDANCE, please cite the paper of each method you use. BibTeX entries for all papers are in CITATION.bib.

Impact

MDANCE is enabling researchers to:

  • Accelerate drug discovery by rapidly identifying biologically relevant conformations.
  • Understand disease mechanisms through precise pathway analysis.
  • Validate computational models against experimental structures.
  • Scale analyses to massive simulation datasets.

Contributing

We welcome collaborations and contributions! Whether you're a:

  • Computational biologist with novel analysis needs.
  • Method developer interested in extending our framework.
  • Structural biologist with challenging datasets.

Get involved:

  • Open an issue for bug reports or feature requests.
  • Submit a pull request for improvements.
  • Reach out to discuss research collaborations.

Funding

This research was supported by the National Institute of General Medical Sciences of the National Institutes of Health under award number R35GM150620.

Metadata

Release files for MDANCE 0.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for MDANCE 0.5.0
File Size Uploaded Provenance Actions
mdance-0.5.0.tar.gz 17.5 MB Without provenance Details for mdance-0.5.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for MDANCE 0.5.0
File Interpreter ABI Platform Actions
mdance-0.5.0-py3-none-any.whl Python 3 none any Details for mdance-0.5.0-py3-none-any.whl

Total release size: 35.1 MB

Release files / mdance-0.5.0.tar.gz

Download URL mdance-0.5.0.tar.gz
Size 17.5 MB
Tags Source
SHA-256 checksum
How to use checksums
22439550075dde8124796b4811acbbd5acdefe48734a56c203e14295211d6b1e
BLAKE2b-256 checksum
How to use checksums
7b465e7191c81a9aa404240cb1e1f0fa11ac1775cc03a03b42b9f5d600ce4417
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.11

Release files / mdance-0.5.0-py3-none-any.whl

Download URL mdance-0.5.0-py3-none-any.whl
Size 17.6 MB
Tags Python 3
SHA-256 checksum
How to use checksums
dd3eea1e27dd355cdb3a3563ccdb55c818cbdce339df860e11b9f825fdfcb014
BLAKE2b-256 checksum
How to use checksums
2eca6ea0368f0c14d87c00ff357cf171e5186819f2fcdad22098a6cac35709bb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.11

Security for MDANCE 0.5.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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