import sys
sys.path.append('../')
import pybmrb as pybmrb
by default the functions in this library will write output in a html file given as a parameter. It also has notebook mode which will generate embedded visualization in the notebook. Let's enable the notebook mode.
pybmrb._NOTEBOOK = True
Let's call the histogram method
h = pybmrb.Histogram()
Histograms are generated by fetching checmial shift data of a given amino acid or atom from BMRB database using BMRB-API.
help(h.hist)
The function hist may take any one of the parameters residue/atom/atom_list or two parameters residue and atom along with filtering and normalization parameters. The outfilename is used to generate visualizations as a stand alone html file.
BMRB contains chemical shifts of atom in different experimental conditions. In order to get a clean distribution, exoctic values(arising from say para-magnetic substances or different experimental conditions) should be removed. This is done by a filter based on standard deviation of that particularity distribution. For a given distribution, the values lie outside sd_limtxstandard deviation will be removed. By default this filter is enabled and the sd_litmit is set to 10
One can also plot probability density instead of count. This can be controlled by the parameter normalized. By default its false, which means it will plot the count/frequency.
Let's see some examples
h.hist(residue='GLY')
h.hist(residue='GLY',normalized=True)
h.hist(residue='GLY',atom='CA',filtered=False)
h.hist(residue='GLY',atom='CA')
h.hist(atom='CB')
h.hist(residue='TYR',atom='H*')
It is also possible to plot the chemical shift correlation of any two atom in a given amino acid. This will help us to understand the distribution of a particular resonance peak in a 2D correlation experiment.
Let's see some examples
h.hist2d(residue='CYS',atom1='CB',atom2='N')
h.hist2d(residue='CYS',atom1='CB',atom2='N',sd_limit=5)
h.hist2d('ASN','HD21','HD22')
One can also search in BMRB for chemical shift distribution of a particular atom in an amino acid with one or more known set of assigned chemical shift from the same residue. This is especially useful to restrict or define a search range for unassigned side chain atoms with back bone resonances are already assigned.
Here are some examples
h.conditional_hist(residue='CYS',atom='CB',atomlist=['N'],cslist=[118])
h.conditional_hist(residue='GLN',atom = 'HE21', atomlist = ['HE22'], cslist=[6.85])