Tools for molecular dynamics simulation setup and analysis.
Project description
MDPlus: Python tools for molecular modelling.
Introduction
MDPlus brings together a number of tools related to the setup and analysis of molecular simulations:
-
PCA - the Principal Component Analysis library as used by pyPcazip.
-
Glimps - a machine learning method for backmapping coarse-grained structures to finer-grained ones.
-
ENM - an elastic network approach to the refinement of approximate molecular models.
Installation:
Easiest via pip:
pip install mdplus
Getting started:
API overview
For maximum compatibility with other Python-based MD simulation processing packages, All tools operate on simple arrays of coordinate data (typically [n_frames, n_atoms, 3] numpy
arrays).
All tools have a similar API, modelled on the transformer object approach that used by many of the utilities in scipy
and scikit-learn
.
PCA
An instance of a PCA transformer is fit to an ensemble of structures, to obtain the eigenvectors, eigenvalues and mean. This trained transformer can then be used to transform further coordinate sets of the same system into the PCA space, and vice-versa:
from mdplus.pca import PCA
pca_transformer = PCA()
pca_transformer.fit(traj) # traj should be an [n_frames, n_atoms, 3] numpy array
scores = pca_transformer.transform(traj) # scores will be an [n_frames, n_components] numpy array
reconstituted_traj = pca_transformer.inverse_transform(scores)
Glimps
While tools to transform high-resolution models to lower resolution ones (e.g. atomistic to coarse-grained) are relatively available and/or easy to implement, the reverse - "back-mapping" - is typically much harder. Given a training set of high-resolution structures and their low-resolution counterparts obtained by application of a forward-mapping tool, Glimps learns the reverse transform from the low resolution dataset to the higher resolution one, and once trained can back-map further low-resolution models.
from mdplus.multiscale import Glimps
backmapper = Glimps()
backmapper.fit(cg_training_traj, fg_training_traj) # matched pairs of low and high resolution structures
fg_structure = backmapper.transform(cg_structure)
Command-line tools for back mapping are also available - see the glimps_example
folder.
ENM
ENM implements an elastic network restraints-based refinement of approximate molecular structures. It can be a useful post-processor for structures obtained from PCA inverse transforms or from Glimps. ENM learns the set of restraints from a training set of "good" molecular structures, and can then refine further approximate structures:
from mdplus.refinement import ENM
refiner = ENM()
refiner.fit(training_traj) # A diverse collection of good-quality structures
refined_traj = refiner.transform(crude_traj)
Who do I talk to?
Project details
Release history Release notifications | RSS feed
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
File details
Details for the file mdplus-0.1.0rc0.tar.gz
.
File metadata
- Download URL: mdplus-0.1.0rc0.tar.gz
- Upload date:
- Size: 215.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1fd7ec04c2c1c952f68d16992e9cc5fba10f48a39c482e6bbcd34b2726ae5f2d |
|
MD5 | c856eff7d0930b85100734ea21ec9629 |
|
BLAKE2b-256 | e6f513c75c833335cccfee36c71e1ab9ac70648cc44b206857bfdafe9a4b0b45 |
File details
Details for the file mdplus-0.1.0rc0-cp39-cp39-macosx_14_0_arm64.whl
.
File metadata
- Download URL: mdplus-0.1.0rc0-cp39-cp39-macosx_14_0_arm64.whl
- Upload date:
- Size: 156.7 kB
- Tags: CPython 3.9, macOS 14.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f2f46b68afcb56c18b341291a2f2900e76b6793984cf24b104865adcfb64671d |
|
MD5 | 0104083967af7f3cd297869c95914934 |
|
BLAKE2b-256 | 202550cd17c36d3c28c5862f4b023b0ce2fe44262564ee2ee308cde2921e1e1c |