MDTransport: Python Tool for Computing Transport Properties from GROMACS and LAMMPS Simulations
MDTransport is a powerful and flexible command-line tool designed to streamline the analysis of transport properties from Molecular Dynamics (MD) simulations. It provides a unified interface for post-processing trajectory data from both GROMACS and LAMMPS.
The following base dependencies are required:
python >= 3.9matplotlib >= 3.6pandas >= 2.0numpy >= 1.20scipy >= 1.10tqdm >= 4.60
Depending on the specific engine you wish to use for trajectory parsing, you may need one of the following:
Click to view optional installations (MDAnalysis, Chemfiles, Ovito)
-
MDAnalysis (Required for
--mdaoption)conda install -c conda-forge mdanalysis
pip install MDAnalysis
-
Chemfiles (Required for
--chemoption)conda install -c conda-forge chemfiles
pip install chemfiles
-
Ovito (Required for
--ovitooption)conda install -c conda-forge ovito
pip install ovito
MDTransport is available as a pre-compiled package for Linux, macOS, and Windows.
Via PyPI:
pip install MDTransport
Via Conda-forge:
conda install -c conda-forge mdtransport
You can install the latest development version directly from GitHub:
git clone https://github.com/ShahResearchGroup/MDTransport.git
cd MDTransport
pip install -e .
conda env create -f environment.yml conda activate mdt_env chmod +x mdt.py
| Flag | Description |
|---|---|
--gro |
Run GROMACS analysis. |
--lam |
Run LAMMPS analysis. |
| Flag | Engine | Description & Example |
|---|---|---|
--pdb |
GROMACS | Use PDB file to extract species data. |
--exe |
GROMACS | Use gmx to extract species data (e.g., --exe gmx or --exe gmx_mpi). |
--lamp |
LAMMPS | Use lammpstrj file to extract species data. |
--com |
LAMMPS | Use LAMMPS generated com.txt (e.g., --com /path/to/com.txt). |
--chem |
Both | Use Chemfiles to extract species data. |
--mda |
Both | Use MDAnalysis to extract species data. |
--ovito |
Both | Use Ovito to extract species data. |
| Flag | Description | Example |
|---|---|---|
--in |
Path to MDTransport input file | --in /path/to/input |
--itp |
Directory containing GROMACS ITP files | --itp /path/to/itp/ |
--tpr |
Path to GROMACS TPR file | --tpr /path/to/file.tpr |
--traj |
Path to trajectory file | --traj /path/to/file.trr |
--data |
Path to LAMMPS data file | --data /path/to/data |
--lam_in |
Path to LAMMPS input file | --lam_in /path/to/input |
--gro_path |
Path to GROMACS files directory | --gro_path /path/to/gromacs/ |
--lam_path |
Path to LAMMPS files directory | --lam_path /path/to/lammps/ |
| Flag | Description | Example |
|---|---|---|
--temp |
Temperature in Kelvin | --temp 298.0 |
--t_steps |
Time steps in ps | --t_steps 2 |
--n_delta |
Time window for time origins shifting in ps | --n_delta 1000 |
--t_window |
Time window for slope calculations in ps | --t_window 1000 |
--min_window |
Minimum time window for diffusivity calculations in ps | --min_window 1000 |
--n_steps |
Snapshots range in frames | --n_steps 0 20000 |
--fit_method |
MSD fitting method for diffusion calculations | --fit_method gls |
--msd_fit |
Time window (in ps) for MSD fitting: start end | --msd_fit 10000 40000 |
--steps |
Steps for time origin shifting | --steps 20 |
--dir |
Specify directions for msd/diffusion | --dir x y z |
--n |
Process every N-th frame | --n 5 |
--dump_frame |
LAMMPS trajectory dumping frame | --dump_frame 1000 |
--n_cores |
Number of CPU cores for parallel processing | --n_cores 8 |
--mp_mode |
Multi-processing initialization | --mp_mode fork |
| Flag | Description |
|---|---|
--msd |
Compute mean squared displacement and diffusion. |
--corr |
Calculate ion-ion correlations and Einstein conductivity. |
--onsg |
Calculate Onsager transport coefficients. |
--spda |
Spatial decomposition of ion-ion correlations. |
--en |
Calculate Einstein conductivity. |
--ne |
Calculate Nernst-Einstein conductivity. |
--smd |
Run Stefan-Maxwell diffusivity analysis. |
--pcl |
Calculate pair correlation lifetime. |
--cage_p |
Cage population analysis. |
--cage |
Calculate cage correlation lifetime. |
--veh |
Run transport mechanism analysis. |
--rdf |
Calculate radial distribution functions. |
--get_csv |
Parse and save trajectories data. |
| Flag | Description | Example |
|---|---|---|
--species |
Define species names and counts for LAMMPS | --species EMI 500 BF4 500 |
--resname |
Define species names | --resname EMI BF |
--skip_species |
Exclude Resnames from COM generation | --skip_species SOL |
--rcut |
Cutoff radius for analysis | --rcut 7.6 |
--rbin |
RDF bin size | --rbin 0.2 |
--ref_species |
Reference species for cage correlation | --ref_species EMI |
--cage_species |
Cage species for cage correlation | --cage_species BF |
--ana |
Run optional RDFs analysis | --ana |
--eh |
Enable Einstein-Helfand for TRA and ONSG analysis | --eh |
--rdf_mode |
Specify the RDF calculation mode | --rdf_mode com com |
--rdf_pairs |
Specify the RDF pairs | --rdf_pairs resname EMI type HR resname BF type F |
--msd_mode |
Specify the MSD calculation mode | --msd_mode com |
--msd_species |
Specify the MSD species | --msd_species type 1-6 type 7-12 |
--shell |
Solvation shell choice for SPDA | --shell first |
--species_charges |
Override net charges on each species | --species_charges EMI 0.8 |
Note:
[MODE]in the examples below refers to your chosen file parsing backend:
- GROMACS Modes:
--pdb --traj <pdb file> --itp <itp directory>OR--exe <gmx>OR--mdaOR--chemOR--ovito- LAMMPS Modes:
--lampOR--com <com file>OR--mdaOR--chemOR--ovito
GROMACS:
mdt --gro --msd [MODE] --t_steps <time steps> --skip_species <resname> --dir <x, y, z> --n_steps <start frame> <end frame> --min_window <min. time window>
LAMMPS:
mdt --lam --msd [MODE] --t_steps <time steps> --dir <x, y, z> --n <frame stride> --dump_frame <steps> --min_window <min. time window> --n_steps <start frame> <end frame>
GROMACS:
mdt --gro --msd [MODE] --t_steps <time steps> --min_window <min. time window> --dir <x, y, z> --msd_mode com --msd_species resname <resname> type <atom type> <atom type> --n_steps <start frame> <end frame>
LAMMPS:
mdt --lam --msd [MODE] --dump_frame <steps> --t_steps <time steps> --n <frame stride> --dir <x, y, z> --n_steps <start frame> <end frame> --min_window <min. time window> --msd_mode com --msd_species resname <resname> type 1 2
GROMACS:
mdt --gro --msd [MODE] --t_steps <time steps> --min_window <min. time window> --dir <x, y, z> --msd_mode atom --msd_species resname <resname> type <atom type> --n_steps <start frame> <end frame>
LAMMPS:
mdt --lam --msd [MODE] --dump_frame <steps> --t_steps <time steps> --n <frame stride> --dir <x, y, z> --n_steps <start frame> <end frame> --min_window <min. time window> --msd_mode atom --msd_species resname <resname> type <atom type>
GROMACS:
mdt --gro --ne [MODE] --t_steps <time steps> --skip_species <resname> --temp <temperature> --n_steps <start frame> <end frame> --min_window <min. time window>
LAMMPS:
mdt --lam --ne [MODE] --t_steps <time steps> --dump_frame <steps> --n <frame stride> --temp <temperature> --n_steps <start frame> <end frame> --min_window <min. time window>
GROMACS:
mdt --gro --en [MODE] --t_steps <time steps> --t_window <time window for slope> --n_steps <start frame> <end frame> --temp <temperature>
LAMMPS:
mdt --lam --en [MODE] --t_steps <time steps> --dump_frame <steps> --t_window <time window for slope> --n <frame stride> --n_steps <start frame> <end frame> --temp <temperature>
GROMACS:
mdt --gro --onsg [MODE] --t_steps <time steps> --t_window <time window for slope> --temp <temperature> --n_steps <start frame> <end frame> --n_delta <window>
LAMMPS:
mdt --lam --onsg [MODE] --t_steps <time steps> --dump_frame <steps> --temp <temperature> --n <frame stride> --t_window <time window for slope> --n_steps <start frame> <end frame> --n_delta <window>
GROMACS:
mdt --gro --smd [MODE] --t_steps <time steps> --temp <temperature> --n_steps <start frame> <end frame> --min_window <min. time window>
LAMMPS:
mdt --lam --smd [MODE] --t_steps <time steps> --dump_frame <steps> --n <frame stride> --temp <temperature> --n_steps <start frame> <end frame> --min_window <min. time window>
GROMACS:
mdt --gro --veh [MODE] --t_steps <time steps> --min_window <min. time window> --rcut <first solvation> --temp <temperature> --steps <time origin steps> --n_steps <start frame> <end frame> --resname <reference species> <target species>
LAMMPS:
mdt --lam --veh [MODE] --t_steps <time steps> --dump_frame <steps> --min_window <min. time window> --n <frame stride> --n_steps <start> <end> --temp <temperature> --rcut <first solvation> --steps <time origin steps> --resname <reference species> <target species>
GROMACS:
mdt --gro --corr [MODE] --t_steps <time steps> --n_delta <window for time origin shifting> --temp <temperature> --n_steps <start frame> <end frame> --t_window <time window for slope>
LAMMPS:
mdt --lam --corr [MODE] --t_steps <time steps> --dump_frame <steps> --n_delta <window for time origin shifting> --n <frame stride> --n_steps <start frame> <end frame> --temp <temperature> --t_window <time window>
GROMACS:
mdt --gro --spda [MODE] --t_steps <time steps> --n_delta <window for time origin shifting> --temp <temperature> --n_steps <start frame> <end frame> --t_window <time window for slope>
LAMMPS:
mdt --lam --spda [MODE] --t_steps <time steps> --dump_frame <steps> --n_delta <window for time origin shifting> --n <frame stride> --n_steps <start frame> <end frame> --temp <temperature> --t_window <time window>
COM-COM RDF:
mdt --gro --rdf [MODE] --t_steps <time steps> --n_steps <start> <end> --steps <time origins>
mdt --gro --rdf [MODE] --rdf_mode com com --rdf_pairs resname <res> type <type> <type> resname <res> type <type> <type>
mdt --lam --rdf [MODE] --n <frame stride> --t_steps <time steps> --n_steps <start> <end> --dump_frame <steps>
mdt --lam --rdf [MODE] --rdf_mode com com --rdf_pairs resname <res> type <type> <type> resname <res> type <type> <type>
ATOM-COM RDF:
mdt --gro --rdf [MODE] --rdf_mode atom com --rdf_pairs resname <res> type <type> resname <res> type <type> <type>
mdt --lam --rdf [MODE] --rdf_mode atom com --rdf_pairs resname <res> type <type> resname <res> type <type> <type>
ATOM-ATOM RDF:
mdt --gro --rdf [MODE] --rdf_mode atom atom --rdf_pairs resname <res> type <type> resname <res> type <type>
mdt --lam --rdf [MODE] --rdf_mode atom atom --rdf_pairs resname <res> type <type> resname <res> type <type>
GROMACS:
mdt --gro --cage_p [MODE] --t_steps <time steps> --n_steps <start frame> <end frame> --rcut <first solvation> --resname <reference species> <target species>
LAMMPS:
mdt --lam --cage_p [MODE] --n <frame stride> --dump_frame <steps> --species <resname> <numbers> --rcut <first solvation> --n_steps <start frame> <end frame> --t_steps <time steps> --resname <reference species> <target species>
GROMACS:
mdt --gro --cage [MODE] --ref_species <resname> --cage_species <resname> --n_steps <start frame> <end frame> --t_steps <time steps> --rcut <first solvation> --steps <time origin steps>
LAMMPS:
mdt --lam --cage [MODE] --t_steps <time steps> --dump_frame <steps> --ref_species <resname> --cage_species <resname> --n_steps <start frame> <end frame> --rcut <first solvation> --steps <time origin steps> --n <frame stride>
GROMACS:
mdt --gro --pcl [MODE] --t_steps <time steps> --n_steps <start frame> <end frame> --steps <time origin steps> --resname <reference species> <target species>
LAMMPS:
`mdt --lam --pcl [MODE] --dump_frame --t_steps --species --n --n_steps --steps --resname '
If you use MDTransport for your research, please cite: Ashutosh Verma, Amey S. Thorat, and Jindal K. Shah, "MDTransport: A Modular, Open-Source, Extensible Python Tool for Computing Transport Properties from GROMACS and LAMMPS Simulations." Journal of Chemical Information and Modeling, 2026, https://doi.org/10.1021/acs.jcim.6c00558