Microstate Analysis Library

Documentation and examples using the microstate analysis library

Microstate Analysis Library Reference

Microstate Analysis Library Reference

Import library

Suppose the ms_analysis.py is in the current working directory or the Python site-packages directory.

from ms_analysis import *

Global constants

Once the library is loaded, two global constants (at temperature 298.15 K) are available:

ph2Kcal: Convert ph unit to Kcal/mol
Kcal2kT: Convert Kcal/mol to kT

Load a microstate file

Go to a working directory. The essential files for microstate analysis are:

You need to specify which file to load, such as ms_out/pH5eH0ms.txt. The name indicates the pH and Eh condition.

A monte carlo object is reqired to be initialized to hold the microstates with MC()

Finally, read the data into the object with readms() method.

Example:

cd ~/ms_analysis/4lzt
msfile = "ms_out/pH5eH0ms.txt"
mc = MC()
mc.readms(msfile)

Load partial Monte Carlo results. A Monte Carlo sampling is carried out 6 times and is numbered as 0, 1, 2, ..., 5. One can choose to load some of them:

mc.readms(msfile, MC=[1,2])

Data structure:

Conformer:

Conformer is a class object.

Variables:

Microstate:

Microstate is a class object.

Variables:
Function:

Charge_Microstate:

Charge_Microstate is a class object. If we only care about residue ionization, we can reduce conformer microstates to charge microstates.

Variables:
Function:

Subset_Microstate:

Subset_Microstate is a class object. If we only care about a selected group of residues, we can group microstates based on the conformer selection of these residues only.

Variables:
Function:

Free_res:

Free_ress is a class object. It holds information of a free residue.

Variables:

MC:

MC is a class object. It holds information of a Monte Carlo microstates output.

Variables:
Function:

Functions:

get_erange(microstates)

Get the energy range of given microstates.

Input:
Output:

A list of two numbers that are lower bound and higher bound of energey 

bin_mscounts_total(microstates, nbins=100, erange=[])

Divide microstates into bins based on energy and get the counts of total steps in each bin.

Input:
Output:

It returns two lists. The first list is the energy range in the form of lower bounds. The second list is number of microstate counts of each bin.

bin_mscounts_unique(microstates, nbins=100, erange=[])

Divide microstates into bins based on energy and get the counts of unique microstates in each bin.

Input:
Output:

It returns two lists. The first list is the energy range in the form of lower bounds. The second list is number of microstate counts of each bin.

get_count(microstates)

Divide microstates into bins based on energy and get the counts of unique microstates in each bin.

Input:
Output:

It returns two lists. The first list is the energy range in the form of lower bounds. The second list is number of microstate counts of each bin.

average_e(microstates)

Calculate the average energy of given microstates.

Input:
Output:

Average energy.


Code and example: