mdciao: Accessible Analysis and Visualization of Molecular Dynamics Simulation Data
Project description
mdciao: Accessible Analysis and Visualization of Molecular Dynamics Simulation Data
mdciao is a Python module that provides quick, “one-shot” command-line tools to analyze molecular simulation data using residue-residue distances. mdciao tries to automate as much as possible for non-experienced users while remaining highly customizable for advanced users, by exposing an API to construct your own analysis workflow.
Under the hood, the module mdtraj is doing most of the computation and handling of molecular information, using BioPython for sequence alignment, pandas for many table and IO related operations, and matplotlib for visualizaton. It tries to automatically use the consensus nomenclature for
GPCRs, e.g. Ballesteros-Weinstein-Numbering or structure-based schemes by Gloriam et al,
G-proteins, via Common G-alpha Numbering (CGN), and
Kinases, via their 85 pocket-residue numbering scheme.
by either using local files or on-the-fly lookups of the GPCRdb and/or KLIFS.
Licenses
mdciao is licensed under the GNU Lesser General Public License v3.0 or later (LGPL-3.0-or-later, see the LICENSE.txt).
mdciao uses a modified version of the method mdtraj.compute_contacts of mdtraj. This modified version is published along with mdciao and can be found in contacts/_md_compute_contacts.py. Please see that file for details on the modifications.
Modules used by mdciao have different licenses. You can check any module’s license in your Python environment using pip-licenses:
>>> pip-licenses | grep module_name
Documentation
Currently, docs are hosted at http://proteinformatics.org/mdciao/, but this can change in the future.
System Requirements
mdciao is developed in GNU/Linux, and CI-tested via github actions for GNU/Linux and MacOs. Tested Python versions are:
GNU/Linux: 3.7, 3.8, 3.9, 3.10, 3.11
MacOs: 3.7, 3.8, 3.9, 3.10, 3.11. For Python 3.7, four CI-tests involving mdtraj.compute_dssp , are skipped because of a hard to repdroduce, random segmentation fault, which apparently wont fix, see here https://github.com/mdtraj/mdtraj/issues/1574 and here.
So everything should work out of the box in these conditions.
Status
mdciao is approaching its first major release, so less changes in the API and CLI calls are expected. For more info on semantic versioning please check the semver page.
Scope
mdciao originated as a loose collection of CLI scripts used in our lab to streamline contact-frequency analysis of MD simulations with mdtraj, which is doing a lot of the heavy work under the hood of mdciao. The goal was to take the less scripting-affine lab members from their raw data to informative graphs about the general vicinity of their residues of interest without much hassle. From there, it grew to incorporate many of the things routinely done in the lab (with a focus on GPCRs and G proteins) and ultimately a package available for third-party use was made.
- The main publications which have driven the development of mdciao are:
- Function and dynamics of the intrinsically disordered carboxyl terminus of β2 adrenergic receptor.
- Heng, J., Hu, Y., Pérez-Hernández, G. et al.Nat Commun 14, 2005 (2023).
- Time-resolved cryo-EM of G-protein activation by a GPCR.
- Papasergi-Scott, M.M., Pérez-Hernández, G., Batebi, H. et al.Nature 629, 1182–1191 (2024).
- Mechanistic insights into G-protein coupling with an agonist-bound G-protein-coupled receptor.
- Batebi, H., Pérez-Hernández, G., Rahman, S.N. et al.Nat Struct Mol Biol (2024).
TODOs
- This is an informal list of known issues and TODOs:
adopt this project structure https://github.com/MolSSI/cookiecutter-cms
keeping vs reporting contacts: a design choice has to be made wrt to the effect of ctc_cutoff_Ang on a ContactGroup: If a given cutoff makes a ContactPair have freq=0, should the CP be kept in the ConctactGroup, simply not reported? The max_cutoff_Ang is already in place s.t. you can have a buffer of some Angstrom, but then the ContactGroup.n_ctcs would be hard to interpret.
overhaul the “printing” system with proper logging and warnings (perhaps use loguru)
the affiliation of a residue to a fragment is done as “res@frag” on the string output and res^frag in figures, this implementation is simply using replace(“@”,”^”), could be better
harmonize documentation API cli methods (mdciao.cli) and the CLI scripts (mdc_*)
The interface between API methods and cli scripts could be better, using sth like click
The API-cli methods (interface, neighborhoods, sites, etc) have very similar flows, and although a lot of effort has been put into refactoring into smaller methods, there’s still some repetition.
Most of the tests were written against a very rigid API that mimicked the CLI closely. Now the API is more flexible and many tests could be re-written or deleted , like those needing mock-input or writing to tempdirs because writing figures or files could not be avoided.
There’s some inconsistencies in private vs public attributes of classes. An attribute might’ve “started” as private and is exceptionally used somewhere else until the number of exceptions is enough for it to make sense to be public, documented and well tested. I’m working on it.
neighborlists could be computed much more efficiently
The labelling names should be harmonized (ctc_label, anchor_res…) and the logic of how/where it get’s constructed (short_AA vs AA_format) is not obvious sometimes
The way uniprot or PDB codes are transformed to relative and/or absolute filenames to check if they exist locally should be unified across all lookup functions, like GPCR_finder, PDB_finder and/or the different LabelerConsensus objects, possibly by dropping optargs like ‘local_path’ or ‘format’.
Some closely related methods could/should be integrated into each other by generalising a bit, but sometimes the generalisation is unnecessarily complicated to code (and test!) for a slightly different scenario (though I try to hard to avoid it). E.g. there’s several methods for computing, reporting, and saving contact frequencies and contact-matrices, or different methods to assign residue idxs to fragments, find_parent_list, `in_what_N_fragments, or assign_fragments. Still, I opted for more smaller methods, which are individually easier to maintain, but that could simply be a `questionable choice.
The ‘dictionary unifying’ methods could be replaced with pandas.DataFrame.merge/join
Writing to files, file manipulation should be done with pathlib
There’s many other TODOs spread throughout the code
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 mdciao-0.0.9.tar.gz
.
File metadata
- Download URL: mdciao-0.0.9.tar.gz
- Upload date:
- Size: 3.2 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 925bd99bc926752d9a22620a26ef0b60b715f71635fd0ed2be53417c4a72f169 |
|
MD5 | e35c7e4159fc9658ec799feb835af7a4 |
|
BLAKE2b-256 | 81320617f516f664a34c08b17a74fec9db181ae1391c980711d982160aec259f |
File details
Details for the file mdciao-0.0.9-py3-none-any.whl
.
File metadata
- Download URL: mdciao-0.0.9-py3-none-any.whl
- Upload date:
- Size: 3.3 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1713ba4f15b6c8709003af62c3f089275a40cb3a1430b4428cee7f10b09805bc |
|
MD5 | 25c464deabb9da21a9b4023de6552740 |
|
BLAKE2b-256 | 863c681c5ec527154cb9373045decff38287a5f97f7bc71993c6f10ddceb8b98 |