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
example:
first step:
parm ....
trajin ....
vector res1 center :1
vector res2 center :2
....
run
writedata resvectors.nc vectraj trajfmt netcdf parmout resvectors.parm7 noorigin res*
go
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
trajin resvectors.nc
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
....
go
Change "60" above to however many vector commands you had in the first
run.
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
AMBER.ambermd.org
http://lists.ambermd.org/mailman/listinfo/amber
Received on Wed Jul 17 2019 - 10:00:03 PDT