Skip to content

Latest commit

 

History

History

MSM

Markov State Analysis

In this directory you find a script to perform the dynamical Markov state model analysis shown in Nagel et al. 2023 and the script perform_msm to reproduce the results.

Structural Contact Representation

Dihedral-Based States Contact-Based States
Contact Rep. conRep conRep

How to Estimate

The analysis is included in the Python package msmhelper and it can be used with its command-line interface. For more details and installation instructions please refer to the package documentation.

  1. Plot Contact Representation
    python -m msmhelper contact-rep \
        --grid 4 3 \  # number of rows and cols
        --contacts contacts \  # path to contacts file
        --clusters mosaic_clusters \  # path to MoSAIC cluster file
        --state macrostates  # path to macrostate trajectory
    In the following we are using the hp35.mindists2 as contacts and the corresponding MoSAIC clusters hp35.mindist2.mosaic_clusters. To apply the MoSAIC cluster analysis, please take a look at MoSAIC.

Timescale Analysis

Resulting Figures

All following figures are obtained using the Hummer-Szabo projection. To compare with the results obtained without the H-S projection, please refer to the images directory.

Dihedral-Based States Contact-Based States
CK-test ck-test cktest
Implied Timescales implied timescales implied timescales
Waiting Time Distribution wtd wtd
Waiting Times wts wts
Kinetic Networks knet knet

How to Estimate

All analysis tools are included in the Python package msmhelper and they can be used with its command-line interface. For more details and installation instructions please refer to the package documentation.

  1. Estimating the Chapman-Kolmogorov tests
    python -m msmhelper ck-test --frames-per-unit 5 --unit ns \  # specify unit
        --max-time 35000 \  # limit of x-axis in [frames]
        --lagtimes 50 100 150 250 500 \  # lagtimes given in [frames]
        --grid 4 3 \  # number of rows and cols
        --filename macrostates \  # path tp macrostate trajectory
        --microfilename microstates  # if this line is neglected, the HS-projection will not be used
  2. Estimating the implied timescales
    python -m msmhelper implied-timescales --frames-per-unit 5 --unit ns \  # specify unit
        --max-lagtime 210 \  # limit of x-axis in [frames]
        --n-lagtimes 3 \  # no of timescales to plot
        --ylog \  # use logscale
        --filename macrostates \  # path tp macrostate trajectory
        --microfilename microstates  # if this line is neglected, the HS-projection will not be used
  3. Estimating the waiting time distribution as a function of the lag time
    python -m msmhelper waiting-time-dist --frames-per-unit 5 --unit ns \  # specify unit
        --nsteps 100000000 \  # number of steps to propagate MCMC
        --start 12 --final 1 \  # states to start and end in
        --max-lagtime 210 \  # limit of x-axis in [frames]
        --filename macrostates \  # path tp macrostate trajectory
        --microfilename microstates  # if this line is neglected, the HS-projection will not be used
  4. Estimating the waiting time distribution for given lag times
    python -m msmhelper waiting-times --frames-per-unit 5 --unit ns \  # specify unit
        --nsteps 100000000 \  # number of steps to propagate MCMC
        --start 12 --final 1 \  # states to start and end in
        --lagtimes 50 100 200 \  # lagtimes to estimate waiting times from, in [frames]
        --filename macrostates \  # path tp macrostate trajectory
        --microfilename microstates  # if this line is neglected, the HS-projection will not be used
  5. Plotting the kinetic networks
    ./kinetic_network.py -u 8 -u 9 -u 10 -u 11 -f 0 -f 1 -f 2 -f 3 -f 4 \  # unfolded states and folded states (here contact-based)
        --tlag 50 \  # lag time, in [frames]
        --states_traj \  # path to macrostate trajectory
        --qoft  \ # path to fraction of contacts file

Reproduce the Results

To reproduce these results you simply have to run

# this will create automatically a new Python environment
bash perform_msm -c 1

This creates a Python environment with all needed dependencies in the directory create_msm_nagel23, and creates all figures. If more information on the executed commands is needed, please run the script in the verbose mode -v.