Skip to main content

TrajMapQuick Logo

Overview

TrajMapQuick 1.0 is a light tool useful for visualization of trajectory maps and residual shifts within select regions of proteins, across several frames. It is built partially on the codes provided in the original work of Matej Kožić and Branimir Bertoša, 2024 : "Trajectory maps: molecular dynamics visualization and analysis". TrajMapQuick extends the work by reconfiguring how the pdb files are parsed to generate the distance matrix, thereby improving speed dramatically. In addition, TrajMapQuick provides a CLI where the user can pass arguments for better throughput and batch processing. We have also extended the code to allow for automatic detection of regions with high residual fluctuations (named "Hotspots") and generation of the residual shifts of those regions. In addition, a python API has also been provided for python based community. In TrajMapQuick, the user can also choose between the backbone (backbone) atoms or the alpha carbon (CA) for computing the maps.

Features

  • Trajectory Map Visualization: Generates a trajectory map of residual fluctuations across the select frames chosen by the user.
  • Residual shift calculation and visualization: For a select range of residues (region), residual shifts are computed and visualized across select frames
  • Difference and Average map visualization This computes the difference and average of two trajectories, respectively and display the resultant trajectory maps.
  • Hotspot Detection and Plotting: This automatically probes and detects regions of high fluctuations and computes the residual shift for each region for downstream processing.
  • Hotspot Annotation: An RMSF like plot is also generated with the key hotspots highlight for visual confirmation and inspection.

Project Structure

TrajMapQuick/
├── README.md                     # Project overview, installation, usage 
├── requirements.txt              # Python dependencies
├── setup.py                      # Packaging configuration
├── environment.yml               # Build config
├── pyproject.toml                # Build config 
├── LICENSE                       # MIT license
├── Manifest.in                   
├── tmq/                          # Source codes and CLI wrappers lives here
│   ├── cli.py/                   # Main command line launcher 
│   ├── __init__.py               # Main launcher for the python API
│   ├── core/                     # Python package folder
│   │   ├── __init__.py
│   │   ├── traj2pdb.py           # Converts trajectory to pdb
│   │   ├── pdb2csv.py            # Converts pdb to distance matrix
│   │   ├── trajmap.py            # plots the trajectory map
│   │   ├── csv2shift.py          # Core shift logic for a given loop
│   │   ├── shift2graph.py        # Makes shift plots for a given loop
│   │   ├── hotspot.py            # Automatic detection of regions with peak fluctuations
│   │   ├── diff2graph.py         # Computes and plot difference map for two trajectories
│   │   └── average_trajmap.py    # Computes and plot average map for two trajectories
│   ├── commands/                 # Main wrapper for the CLI
│   │   ├── __init__.py
│   │   ├── traj2pdb_cli.py       # CLI wrapper
│   │   ├── pdb2csv_cli.py        # CLI wrapper
│   │   ├── trajmap_cli.py        # CLI wrapper
│   │   ├── csv2shift_cli.py      # CLI wrapper
│   │   ├── shift2graph_cli.py    # CLI wrapper
│   │   ├── hotspot_cli.py        # CLI wrapper
│   │   ├── diff2graph_cli.py     # CLI wrapper
│   │   └── average_trajmap_cli.py# CLI wrapper
│   └── utils                     # Holds functions
│   │   ├── __init__.py
│   │   └── utils.py              # utility functions
├── docs/                         # docstrings for the modules
├── assets/                       # Container for images
├── Tests/                        # Containers for test trajectories and topologies
└── Conda/                        # Backup YAML files


Installation

# Clone the repo
git clone https://github.com/SHEDOOMTC/TrajMapQuick.git
cd TrajMapQuick

# In conda environment with pip
conda create -n tmq python=3.10 
conda activate tmq
conda install -c conda-forge mdtraj
pip install (-e) .

# In conda environment without pip
conda env create -f environment.yml
conda activate tmq

Use tmq --help to see the arguments

Commands

#TrajMapQuick uses a two levell subcommand from the global "tmq" command
tmq  shift  : Extract matrices, compute residue-residue shifts and make plots: For more, use tmq shift --help

tmq hotspot : Detect hotspots in residue shifts and create plots: For more, use tmq hotspot --help

tmq diff      Computes difference between two matrices and creates the difference map: For more, use tmq diff --help

tmq average   Computes average of n matrices and creates the average map: For more, use tmq average --help

Usage (CLI)

# For tmq shift, arguments are passed into the flags for trajectory, topology etc.

tmq shift --traj traj.pdb --top top.parmtop --str 1 --resr 1-300 --resrs 110-125 --cent backbone --plot --out shift_output

#for tmq hotspot, arguments are passed similiarly, except that the region of shift is not provided

tmq hotspot --traj traj.pdb --top top.parmtop --str 1 --resr 1-300 --cent backbone --out hotspot_output

Usage (Python API)

The core modules in the tmq library are clearly demonstrated in the Python_API.ipynb file

#Typical modules are loaded and then used as explained in the jupyter notebook above:

from tmq.core.traj2pdb import traj2pdb
from tmq.core.pdb2csv import pdb2csv  
from tmq.core.trajmap import trajmap
from tmq.core.csv2shift import shift
from tmq.core.shift2graph import shift2graph
from tmq.core.hotspot import detect_shifts
from tmq.core.hotspot import create_submatrices
from tmq.core.hotspot import plot_hotspot_regions
from tmq.core.hotspot import slice_shifts
from tmq.core.hotspot import plot_slice_regions
from tmq.core.diff2graph import diff_map
from tmq.core.average_trajmap import avg_trajmap
# To run the notebook
cd ./Notebooks/
jupyter notebook Python_API.ipynb

Requirements

  • Trajectory processing libraries (mdtraj, biopython)

  • Data wrangling tools (numpy, pandas)

  • Trajectories must have been preprocessed (strippin water, ions,) before feeding into TrajMapQuick

All library requirements are pre-installed installed via pip or conda and are available for use in CLI or via Python API

Examples

Three trajectories and topologies files are included in the Test directory for users to try out the codes. Trajectory 1 has only 125 frames (from apo strucuture of PDB ID: 8EM8 with 789 residues) while others have 250 frames (from apo and bound strucutres of BACE1, with 389 residues). To get the full sized trajectories, see DOI

The Utility of the shift command (using a 500 frame trajectory) was shown by the figure below:

test_traj_2_shift_graph.png

And that of the hotspot command by:

test_traj_2_hotspot_graph.png

To reproduce the figures above, download the full length trajectory (500 frames) from Zenodo DOI and run the codes below on the CLI

#The exact codes used to produce the results above
tmq shift -tr traj_9NSR_500.nc -to topol_9NSR.prmtop -st 1 -rr 1-378 -rs 272-285 -ce backbone -ma 5 -o out

tmq hotspot -tr traj_9NSR_500.nc -to topol_9NSR.prmtop -st 1 -rr 1-378 -ce backbone -o out

Improvements (Speed, Throughput and Reliability)

1. Batch processing over the CLI and Python API

2. A major improvement of TrajMapQuick over TrajMap is the speed across varying residue lengths and number of frames. We evaluated a 1000 frame trajectory (at 100 frame interval) over 800 residues (at 100 residue interval) in TrajMapQuick for both subcommands (shift & hotspot). The performance plots below:

performance plots

shows clear scaling with number of residues and frames, with completion time between 2-5 mins. Compared to TrajMapQuick, a single 500 frame calculations across 800 residues took around 10 minutes in TrajMap, besides the manual editing of input parameters.

3. The choice to select either the CA or backbone for shift calculations.

4. Automatic Detection of hotspots using RMSF plots and generation of associated shift plots.

4. TrajMapQuick allows you to work on any continous chunk of your protein, say residues 300-360 of a 500-residues protein. This reduces time and allows one to focus.

Contributing

Contributions are welcome. Please submit a pull request with your changes.

License

MIT License

Contact

For questions or issues, please contact us @ Reslar Labs © 2026, or Dr. Oluyemi or Shadrach Eze.

Citation

If you use TrajMapQuick, please cite: SHEDOOMTC. (2026). TrajMapQuick: Towards Fast Trajectory Map Analysis and Visualization (v1.0). Zenodo. https://doi.org/10.5281/zenodo.20681061

Software:
DOI

Dataset:
DOI

Metadata

Release files for tmquick 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tmquick 1.0.1
File Size Uploaded Provenance Actions
tmquick-1.0.1.tar.gz 20.5 kB Without provenance Details for tmquick-1.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for tmquick 1.0.1
File Interpreter ABI Platform Actions
tmquick-1.0.1-py3-none-any.whl Python 3 none any Details for tmquick-1.0.1-py3-none-any.whl

Total release size: 44.6 kB

Release files / tmquick-1.0.1.tar.gz

Download URL tmquick-1.0.1.tar.gz
Size 20.5 kB
Tags Source
SHA-256 checksum
How to use checksums
e14a232006cf5cf99d37dd4b24f44804f9fe1b54a9c7821d09c49ebf1f84294f
BLAKE2b-256 checksum
How to use checksums
59f6a5dd1974b258d15bd58a9e02d48f9349d81d7e121efe073df54247a95e51
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.13

Release files / tmquick-1.0.1-py3-none-any.whl

Download URL tmquick-1.0.1-py3-none-any.whl
Size 24.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3e671d01b0e50a24371a3bac0b8f2d5c5707a00e3252ed45c89764a4a93c4646
BLAKE2b-256 checksum
How to use checksums
bbf836ce758eba496a0da77af828cc609519221509feab2b5bb3dae11991f3bf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.13

Security for tmquick 1.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page