MBG wiki | RecentChanges | Blog | 2024-03-19 | 2024-03-18

Variance-covariance and cross-correlation analysis

carma again :

carma -v -cov -write CA.psf CA.dcd
gv CA.dcd.varcov.ps
carma -v -cov -dot -write CA.psf CA.dcd
gv CA.dcd.varcov.ps

and for cross-correlations :

carma -v -cov -dot -norm -write CA.psf CA.dcd
gv CA.dcd.varcov.ps

giving something like :

 cross-correlation image

Variance-covariance and correlation images do benefit from the inclusion of colour. The reason, of course, is that you can use the hue to differentiate between correlated and anti-correlated motions. For example, the image below is from Fig.1 of Lange, Grubmuller & de Groot, Angew. Chem. Int. Ed. (2005), 44 and depicts a correlation matrix derived from an NMR ensemble for the B1 domain of protein G :

 Protein G, NMR correlation matrix

You can produce such a figure from the raw data produced by carma using programs with gnuplot or kuplot. For example, using gnuplot it will be something like :

#
# carma -v -cov -dot -norm -write CAs.dcd CAs.psf
# cat > script

set pm3d
set view 0,0
set size square 3.0,3.0
unset key
set output 'coloured.png'
set terminal png large crop
set palette defined ( 0 "blue", 1 "cyan", 2 "green", 3 "yellow", 4 "red" )
splot [0:55] [0:55] "CAs.dcd.varcov.dat" matrix with pm3d palette

<CTRL-D>
#
# gnuplot < script
# display coloured.png
#

giving something like :

 variance covariance color map from carma and gnuplot

If you want to artificially increase the contrast of the image, there is the standard way of multiplying the correlation coefficients with the sigmoidal function :

$$ 
W(x) = \frac{2}{1+\exp(-\lambda x)}-1
 $$

where λ is an adjustable parameter determining the contrast. The following plots of W(x) and of a map calculated with different values for λ may shed some light :

plot [-1.0:1.0] 2/(1+exp(-5.5*x))-1;

 covariance maps calculated with different lambda values

Using this sigmoidal weighting has been incorporated to carma. Just use a '-sigm λ' flag in the spirit of :

carma -v -cov -dot -norm -sigm 5.5 -write CAs.dcd CAs.psf

Needless to say that there are numerous gnuplot options that you can play with. For example :

#
# cat > script


set pm3d
set view 0,0
set size square 3.0,3.0
unset key
set output 'coloured.png'
set terminal png giant crop
set dgrid3d 112,112,8
splot [0:55] [0:55] "CAs.dcd.varcov.dat" matrix with pm3d palette

<CTRL-D>
#
# gnuplot < script
# display coloured.png
#

Giving :

 variance covariance color map from carma and gnuplot sigmoidal weights 2

If you feel that these graphs are boring, you can always do much better with dx :

 variance covariance color map from carma and dx