Adaptive sampling on MD trajectories via clustering and policy-driven seed selection
Project description
AdaptivePy
Adaptive sampling for molecular dynamics trajectories
Clustering-based and frame-level adaptive policies for MD workflows, including entropy-based MaxEnt VAMPNet seed selection.
Overview
AdaptivePy helps you identify under-sampled or high-uncertainty regions of conformational space and select seed frames for new simulations. It loads per-trajectory feature arrays, optionally clusters frames, applies adaptive policies, and writes reproducible metadata and optional PDB structures.
Most policies select seeds from clusters. MaxEnt VAMPNet (maxent_vampnet) is frame-level: it trains a VAMPNet on lagged features and selects frames with the highest Shannon entropy of softmax state probabilities — no clustering required.
Full documentation: https://hnadeem2.github.io/AdaptivePy/
| Input | Feature arrays (.npy / .pkl), optional coordinate trajectories |
| Clustering | KMeans, MiniBatch KMeans, regular-space (optional for frame-level policies) |
| Policies | Least counts, random, FAST, MA-REAP, kNN-AS, MaxEnt VAMPNet (extensible) |
| Output | Seeds, cluster assignments, model, logs, policy scores, optional PDBs |
Installation
pip install adaptivepy-sampling
For MaxEnt VAMPNet (requires PyTorch and deeptime):
pip install adaptivepy-sampling[maxent]
For development:
git clone https://github.com/hnadeem2/AdaptivePy.git
cd AdaptivePy
pip install -e ".[dev,docs]"
For MaxEnt development:
pip install -e ".[dev,docs,maxent]"
Quick start
-
Prepare features — one file per trajectory, shape
(n_frames, n_features):features/ ├── traj_0.npy └── traj_1.pkl
-
Configure — edit
examples/config.yaml(or create your own). -
Run:
adaptivepy run examples/config.yaml
See the Getting Started guide for a complete walkthrough.
CLI
adaptivepy run config.yaml # run adaptive sampling
adaptivepy validate config.yaml # validate inputs only
adaptivepy list-policies # list available policies
Python API
from adaptivepy import run_adaptive_sampling
results = run_adaptive_sampling("config.yaml")
Policies
Built-in seed-selection policies:
| Policy | Use case |
|---|---|
least_counts |
Target under-sampled clusters |
random |
Baseline random sampling |
fast |
Goal-directed sampling via feature columns (Zimmerman & Bowman 2015) |
ma_reap |
Multi-agent coordinated sampling with learned CV weights (Kleiman & Shukla 2022) |
knn_as |
k-nearest-neighbors adaptive sampling over cluster representatives (Rovers et al. 2025) |
maxent_vampnet |
Entropy-based frame selection via VAMPNet soft state assignments (Kleiman & Shukla 2023); no clustering |
fast, ma_reap, knn_as, and maxent_vampnet accept extra YAML under policy_params.
MA-REAP requires mapping each trajectory to an agent. MaxEnt VAMPNet requires the
[maxent] install extra (pip install adaptivepy-sampling[maxent]). See the
Policies guide and
Configuration.
AdaptivePy also supports opt-in metapolicy ensembles with majority polling or
per-policy seed allocation through the metapolicy YAML block.
Documentation
| Guide | Description |
|---|---|
| Getting Started | First run in minutes |
| Configuration | YAML options and defaults |
| Feature Inputs | File formats and layout |
| Policies | Seed selection strategies |
| API Reference | Module documentation |
Contributors
- Hassan
License
MIT. See LICENSE for details.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file adaptivepy_sampling-0.3.0.tar.gz.
File metadata
- Download URL: adaptivepy_sampling-0.3.0.tar.gz
- Upload date:
- Size: 49.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
03410f73b7181d15db52f4a61ba169344321b21432bdd890bfa0feff3d819a27
|
|
| MD5 |
aa9de8369a864edda632997637e057b5
|
|
| BLAKE2b-256 |
22d4f6a94b8ffed6ec171e89badddff623941fc0dde9aaefe66501b3ec959a14
|
Provenance
The following attestation bundles were made for adaptivepy_sampling-0.3.0.tar.gz:
Publisher:
publish.yml on hnadeem2/AdaptivePy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
adaptivepy_sampling-0.3.0.tar.gz -
Subject digest:
03410f73b7181d15db52f4a61ba169344321b21432bdd890bfa0feff3d819a27 - Sigstore transparency entry: 1842396072
- Sigstore integration time:
-
Permalink:
hnadeem2/AdaptivePy@ff4f2d203f2aa577a25b790a56d2c0872849935d -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/hnadeem2
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@ff4f2d203f2aa577a25b790a56d2c0872849935d -
Trigger Event:
release
-
Statement type:
File details
Details for the file adaptivepy_sampling-0.3.0-py3-none-any.whl.
File metadata
- Download URL: adaptivepy_sampling-0.3.0-py3-none-any.whl
- Upload date:
- Size: 54.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5a4633042e2bb1048b7741c3eef6e939e3fa99235bb8c46b070296f18b1277aa
|
|
| MD5 |
64b4eca322704cf5cf68f4804468c60b
|
|
| BLAKE2b-256 |
634dd8718ef39c12b21a0b9fe411b6930067c73380beacc9ddf9a05aa9cd4371
|
Provenance
The following attestation bundles were made for adaptivepy_sampling-0.3.0-py3-none-any.whl:
Publisher:
publish.yml on hnadeem2/AdaptivePy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
adaptivepy_sampling-0.3.0-py3-none-any.whl -
Subject digest:
5a4633042e2bb1048b7741c3eef6e939e3fa99235bb8c46b070296f18b1277aa - Sigstore transparency entry: 1842396272
- Sigstore integration time:
-
Permalink:
hnadeem2/AdaptivePy@ff4f2d203f2aa577a25b790a56d2c0872849935d -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/hnadeem2
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@ff4f2d203f2aa577a25b790a56d2c0872849935d -
Trigger Event:
release
-
Statement type: