Skip to main content

The Weir Labs H-bond Systems Analyses modules!

Project description

mdsa-tools Docs BuildCIPyPI versionLicense

Tools for systems-level analysis of Molecular Dynamics (MD) simulations

Pipeline overview

Pipeline

We start from an MD trajectory and generate per-frame interaction networks (graphs/adjacency matrices). Adjacencies are flattened (row-wise) into vectors; stacking these per-frame vectors yields a feature matrix suitable for clustering (e.g., k-means) and dimensionality reduction (PCA/UMAP). Results can be visualized with graphs, scatter plots, MDCcircos plots (residue H-bonding), or replicate maps of frame-level measurements of interest. These clustered states can then serve as candidate substates for constructing and analyzing Markov state models (MSMs), enabling exploration of long-timescale dynamics and transition pathways.

Install

pip install mdsa-tools
# Optional:
# pip install "mdsa-tools[docs]"   # if you want to build the docs locally
# pip install "mdsa-tools[examples]"  # if you define this extra for demo deps

Systems Problem Area:

System panel

In the Weir Group at Wesleyan University, we perform molecular dynamics (MD) simulations of a ribosomal subsystem to study tuning of protein translation by the CAR interaction surface- a ribosomal interface identified by the lab that interacts with the +1 codon (poised to enter the ribosome A site). Our "computational genetics" research focuses on modifying adjacent codon identities at the A-site and the +1 positions to model how changes at these sites influence the behavior of the CAR surface and corellate with translation rate variations.

Quickstart example (see examples for more use-cases;contour plots, UMAP, MSM, etc):

Open In Colab Binder nbviewer

from mdsa_tools.Data_gen_hbond import TrajectoryProcessor as tp
import numpy as np
import os

###
### Datagen
###

#load in and test trajectory
system_one_topology = '../PDBs/5JUP_N2_CGU_nowat.prmtop'
system_one_trajectory = '../PDBs/CCU_CGU_10frames.mdcrd'


system_two_topology = '../PDBs/5JUP_N2_GCU_nowat.prmtop'
system_two_trajectory = '../PDBs/CCU_GCU_10frames.mdcrd'


test_trajectory_one = tp(trajectory_path=system_one_trajectory,topology_path=system_one_topology)
test_trajectory_two = tp(trajectory_path=system_two_trajectory,topology_path=system_two_topology)


#now that its loaded in try to make object
test_system_one_ = test_trajectory_one.create_system_representations()
test_system_two_ = test_trajectory_two.create_system_representations()


np.save('test_system_one',test_system_one_)
np.save('test_system_two',test_system_two_)

###
### Analysis
###

from mdsa_tools.Analysis import systems_analysis

all_systems=[test_system_one_,test_system_two_]
Systems_Analyzer = systems_analysis(all_systems)

#transform adjacency matrices preform clustering and dimensional reduction
Systems_Analyzer.replicates_to_featurematrix()
optimal_k_silhouette_labels,optimal_k_elbow_labels,centers_sillohuette,centers_elbow = Systems_Analyzer.cluster_system_level(outfile_path='./test_',max_clusters=5)
print('clustering succesfully completed')
X_pca,weights,explained_variance_ratio_=Systems_Analyzer.reduce_systems_representations(method='PCA') #you could do method=PCA/UMAP here
print('reduction successful')


###
### Visualization
###

import matplotlib.cm as cm
from mdsa_tools.Viz import visualize_reduction
#visualize embedding space with original clusters
visualize_reduction(X_pca,color_mappings=optimal_k_silhouette_labels,savepath='./PCA_',cmap=cm.plasma_r)

#If they exist map transitions between the various cluster assignments
from mdsa_tools.Viz import replicatemap_from_labels
fake_labels=np.arange(0,18,1)
replicatemap_from_labels(cmap=cm.plasma_r,frame_list=[9]*2,labels=fake_labels,savepath='./Repmap_')#9 frames each so 

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

mdsa_tools-1.1.1.tar.gz (45.4 kB view details)

Uploaded Source

Built Distribution

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

mdsa_tools-1.1.1-py3-none-any.whl (54.8 kB view details)

Uploaded Python 3

File details

Details for the file mdsa_tools-1.1.1.tar.gz.

File metadata

  • Download URL: mdsa_tools-1.1.1.tar.gz
  • Upload date:
  • Size: 45.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for mdsa_tools-1.1.1.tar.gz
Algorithm Hash digest
SHA256 d686e1914e4c795a3d881ff7b1ca50df78372636ce00b9dbc79b6cb32f7a8ad8
MD5 c22c282f229654b62239772687805afb
BLAKE2b-256 1f5c4b8f6db8c334d697b083e712a6ab15a91dd60d845afe3e4c39f949f7b352

See more details on using hashes here.

File details

Details for the file mdsa_tools-1.1.1-py3-none-any.whl.

File metadata

  • Download URL: mdsa_tools-1.1.1-py3-none-any.whl
  • Upload date:
  • Size: 54.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for mdsa_tools-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d61e0e5b1f4c74c4679c7cfb909720d799a90b54abc83e5c589abf6d90549bf6
MD5 75fcdffed5fa80fb690f15d54f33f113
BLAKE2b-256 51d403a66fbb5d166ca6fe4fb37659bbd71ce4cf65c3143bf9e8d6d37dc9b51c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page