Skip to content
Projekte

Über uns

MDANCE: Hyper-efficient tools to process molecular dynamics simulations.

Wissenschaft und Technik

So werden diese Zahlen gemessen

Gemessener Sternzuwachs

in 24h
0
in 7 days
-1
in 15 days
0
in 1 month
+1

Nettoänderungen in überlappenden Zeiträumen, keine Tagessummen. Fehlende Messwerte bleiben leer. Sterne zeigen Interesse, nicht Qualität.

README.md

Original

MDANCE

Molecular Dynamics Analysis with N-ary Clustering Ensembles

Cluster millions of MD frames in minutes, with the same result on every run.

PyPI version Python 3.10 or newer Documentation License

Website • Installation • Quick start • Algorithms • Documentation • Citing • Videos

Watch MDANCE in 1 minute Try NANI in 60 seconds

Why MDANCE

Most clustering tools compare frames two at a time. That breaks down on modern simulations:

  • Quadratic cost. Comparing every frame with every other frame means doubling the trajectory quadruples the work.
  • Memory. A full RMSD matrix for a million-frame trajectory takes terabytes before clustering even starts.
  • Poor initialization. Random seeding gives suboptimal clusters, and different clusters on every run.
  • Hard follow-up questions. Finding the dominant pathways, or the native structure, in a large ensemble is difficult.

MDANCE is built on n-ary (extended) similarity, which compares all frames at once and finds high- and low-density regions in linear time. Its algorithms:

  • scale linearly with the number of frames, from O(N²) to O(N), without pairwise distance matrices;
  • use deterministic seeding, so the same input gives the same clusters;
  • are designed for structural biology and validated against experimental structures.

Researchers use MDANCE to find biologically relevant conformations for drug discovery, study mechanisms through pathway analysis, validate models against experimental structures, and analyze very large simulation datasets.

Installation

pip install mdance

MDANCE requires Python 3.10 or newer. To install from source:

git clone https://github.com/mqcomplab/MDANCE.git
cd MDANCE
pip install -e .

Quick start

New to NANI? See it in action first: Learn NANI in 60 seconds (interactive).

Cluster the example trajectory included with MDANCE (6,001 frames of 50 atoms) with NANI seeding and k-means:

import numpy as np
from sklearn.cluster import KMeans
from mdance import data
from mdance.cluster.nani import KmeansNANI

X = np.load(data.sim_traj_numpy)

# Deterministic NANI seeds
nani = KmeansNANI(data=X, n_clusters=6, metric='MSD', N_atoms=50,
                  init_type='strat_reduced', percentage=10)
centroids = nani.initiate_kmeans()

# k-means from the NANI seeds gives the same labels every run
labels = KMeans(n_clusters=6, init=centroids, n_init=1).fit(X).labels_

To use your own trajectory, convert it to a NumPy array first (preprocessing tutorial). Every algorithm also has ready-to-run scripts in scripts/.

Algorithms

Algorithm What it does Best for Learn Paper

NANI
Deterministic k-means seeding that finds metastable states Simple analysis Tutorial · Video JCTC 2024, JCIM 2026

HELM
Hierarchical clustering at k-means cost High-resolution hierarchies Tutorial · Video JCIM 2025

DIVINE
Top-down divisive clustering, every resolution in one pass Fast hierarchies Tutorial · Video JCIM 2026

mdBIRCH
Online clustering with an RMSD-calibrated merge test Very large or streaming trajectories Tutorial · Video JCTC 2026

SHINE
Finds the dominant pathways in enhanced-sampling data Pathway exploration Tutorial · Video JCIM 2025

PRISM
Compares pathways by their structural medoids Multi-pathway comparison Tutorial · Video Digital Discovery 2026

eQual
Radial threshold clustering in linear time Clusters of a set radius Tutorial · Video JCIM 2025

PRIME
Retrieves the native structure from a clustered ensemble Structure selection Tutorial · Video JCTC 2024
More about each algorithm

NANI: k-means initialization

  • Solves the seed selection problem of k-means: picks diverse initial centroids from high-density regions using n-ary comparisons.
  • Gives compact, well-separated clusters that find metastable states, with consistent populations across replicates.
  • Clusters 1.5 million HP35 frames in about 40 minutes.

HELM: hybrid hierarchical clustering

  • Combines k-means efficiency with hierarchical flexibility using n-ary difference functions.
  • Keeps the cost of k-means while allowing any partition: the hierarchy is built without a pairwise distance matrix, so any number of clusters can be taken from one run.
  • Clusters 1.5 million frames in about 34 minutes. Classic hierarchical clustering already needs 29 hours for 75,000 frames.

DIVINE: divisive hierarchical clustering

  • Splits clusters top-down, choosing the next cluster to split by a weighted variance criterion.
  • Uses NANI anchors, so every split is deterministic, and never builds a pairwise distance matrix.
  • Explores every resolution in a single pass.
  • Matches or exceeds bisecting k-means quality in less time.

mdBIRCH: online clustering

  • Adapts the BIRCH CF-tree to MD data and processes frames as they arrive.
  • The merge test is calibrated to RMSD, so its threshold has a physical meaning.
  • Avoids pairwise distance matrices and scales near-linearly with the number of frames: hundreds of thousands of frames on a single CPU core in seconds.
  • Two protocols: runs anchored to a chosen RMSD, and a blind sweep over thresholds.

SHINE: pathway clustering

  • Groups pathways from multiple simulations, such as enhanced-sampling runs, and picks the most representative pathway in each group.
  • Combines n-ary similarity with tools from cheminformatics to reveal the dominant transformation mechanisms.
  • Costs less than Fréchet-distance approaches.
  • Applied to alanine dipeptide and adenylate kinase.

PRISM: pathway representation

  • Summarizes each pathway by a compact set of structural medoids.
  • Clusters pathways by weighted average Hausdorff distance with hierarchical clustering.
  • Offers three ways to build the medoids: shared global medoids, per-pathway medoids, or a two-stage refinement.
  • Designed for comparing and classifying many pathways, for example from enhanced sampling.

eQual: radial threshold clustering

  • Turns O(N²) radial threshold clustering into an O(N) algorithm with new seed selection and tie-breaking.
  • Selects seeds with k-means++ and breaks ties with extended similarity indices, for deterministic results.
  • Uses no memory-intensive pairwise RMSD matrix.
  • Gives compact, well-separated clusters of the same quality as the original method.

PRIME: native structure prediction

  • Uses n-ary similarity across clusters to pick the most native-like frame of an ensemble.
  • Mapped all structural motifs in benchmark studies, and consistently identified native structures within 2 Å RMSD of experimental data.

PRIME structure of 2k2e superposed on the experimental structure
2k2e: structure from PRIME (yellow) superposed on the experimental native structure (blue).

Citing MDANCE

If you use MDANCE, please cite the paper of each algorithm you use (linked in the table above). BibTeX entries for all papers are in CITATION.bib.

Contributing

We welcome collaborations and contributions, whether you are a computational biologist with new analysis needs, a method developer who wants to extend the framework, or a structural biologist with a challenging dataset.

  • Open an issue for bug reports or feature requests.
  • Submit a pull request with improvements.
  • Get in touch to discuss a research collaboration.

Funding

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

License

MDANCE is released under the MIT License.

Ähnliche Projekte entdecken

Wird geladen…