Re: [AMBER] Covariance Matrix of residues center of mass

From: David A Case <>
Date: Wed, 17 Jul 2019 12:30:56 -0400

On Wed, Jul 17, 2019, Guadalupe Alvarez wrote:

>I'm trying to compute the Covariance Matrix of residues center of mass, but
>the cpptraj function "matrix covar" only performs the calculation by atom,
>not by residue. Does anybody know a way for doing this?

You can use the "vector" command to get the centers of mass of various
groups, then use the "matrix covar" command on those. Here's an

first step:

parm ....
trajin ....
vector res1 center :1
vector res2 center :2
writedata vectraj trajfmt netcdf parmout resvectors.parm7 noorigin res*

This creates a "trajectory" with just the centers of mass of each
residue, along with the corresponding prmtop file.

Then you can read this in and analyze in a second cpptraj run:

parm resvectors.parm7
matrix covar .1-60 out corrmat.dat name rescovarmat
precision corrmat.dat 10 5 # experiment to see how much precision you need
diagmatrix rescovarmat out resvecs.dat name corrdiag vecs 50 # if you want

Change "60" above to however many vector commands you had in the first

It may be possible to combine both steps into a single cpptraj run, but
I've never done that. And Dan or others may know of a more elegant way
to do this.

...hope this helps....dac

AMBER mailing list
Received on Wed Jul 17 2019 - 10:00:03 PDT
Custom Search