Atakanzsn / DynaBench

Tool for MD simulation analysis and visualization
2 stars 1 forks source link

DynaBench

The Dynabench package is an analysis pipeline for molecular dynamic simulations. The package runs analysis in three parts:

For detailed documentation, please visit https://dynabench.gitbook.io/dynabench

DynaBench Architecture

DynaBench calls several python packages and custom scripts to run Quality Control, Residue Based, and Interaction Based analysis. According to the results of the analysis, by merging some results, visualizations are made.

DynaBench (3)

DynaBench Output Files

DynaBench output files are stored in two folders: tables and figures. Analysis results are stored in the tables folder in .csv form while visualization are stored in the figures folder.

image

Usage

System Dependencies

Installation

We recommend you use git clone instead of download with .zip while installing the package. Downloading with .zip may cause problems in test pdbs.

Clone the repository

git lfs install
git clone https://github.com/Atakanzsn/DynaBench.git
cd DynaBench

Create DynaBench environment

conda env create -f requirements.yml
conda activate DynaBench

Create IpyKernel for DynaBench

python -m ipykernel install --user --name dynabench

Build the DynaBench

python setup.py build
python setup.py install

Build FoldX for Energy Analysis

DynaBench uses FoldX for energy analysis. You should download FoldX by yourself. While running Residue-Based analysis, you should give FoldX folder path which includes the FoldX executable to the function.

Tests

Please run the jupyter notebooks in the tests folder to test the package. They will create folders with tests at the end. Check outputs with the folder without the tests at the end. Outputs should be identical.

Run

You can run from a script or shell. To run from the terminal, you can either run with JSON file or you can choose options from the shell. If running from the terminal, please do not run inside the DynaBench folder. It may cause import errors.

Example Script

import DynaBench

#load trajectory .dcd and topology .pdb file
mol = DynaBench.dynabench(inp_file='your_trajectory_path', dcd_pdb='your_topology_path',
 split_models=False, show_time_as='Frame')

#define plotter class
draw = DynaBench.Plotter(job_name=mol.job_name)

#Quality control analysis and visualization
mol.run_quality_control(rmsd_data={'ref_struc':None, 'ref_frame':0})

draw.plot_rmsd(path=None)
draw.plot_rg(path=None)
#RMSF plot can be plotted after residue-based analysis due to marking of interface residues on the plot.

#Residue Based analysis and visualization

mol.run_res_based('foldx_folder_path')

draw.plot_rmsf(rmsf_path=None, intf_path=None)
draw.plot_int_energy(thereshold=50.0, res_path=None, intf_path=None)
draw.plot_biophys(path=None)

#Interaction Based analysis and visualization

mol.run_inter_based('foldx_folder_path')

draw.plot_pairwise_freq(path=None)

#Get .json files for analysis and plots.
mol._get_params_()
draw._get_params_()

Run from terminal

Complete run (Quality control, Residue-Based, and Interaction-Based analysis with all visualizations) with input file from the terminal:

With .pdb input

dynabench --input_file=input_file.pdb --commands=all_analysis,all_plots --foldx_path=foldx_folder_path

With .dcd input, stride value 20

dynabench --input_file=trajectory.dcd --commands=all_analysis,all_plots --dcd_pdb=topology.pdb --foldx_path=foldx_folder_path --stride=20

To run with JSON file from the terminal:

dynabench --table_json=table_params.json --plot_json=plot_params.json

For more options to run from terminal:

dynabench -h