Re: [AMBER] question of analyze matrix command of ptraj

From: Daniel Roe <>
Date: Mon, 9 Sep 2013 10:41:53 -0600


On Mon, Sep 9, 2013 at 4:52 AM, 张明焜 <> wrote:
> my question is why the number of eigenvalue is always equil to the number
> of frames of mdcrd,just like if
> trajin prod2.mdcrd 1 200 20
> matrix mwcovar name mwcvmat out mwcvmat.dat
> analyze matrix mwcvmat out evecs.dat vecs 21

The reason is that since you are generating each element of your
covariance matrix from only 10 samples, the number of non-zero
eigenvalues from diagonalizing that matrix will be limited to at most
10. If for some reason you want to get the eigenvectors corresponding
to the zero eigenvalues anyway you can use cpptraj, which doesn't
check the # of snapshots used to generate the matrix.

> beside,eigenvalues caculated from Ptraj and Matlab is a little
> different,like below:

Without knowing exactly how you're calculating the eigenvalues in
Matlab it's tough to say where the differences stem from. If your
input to Matlab is the output from ptraj it could just be related to
the precision of the numbers you are using; inside ptraj/cpptraj the
numbers are full double precision, but they are printed out with less
precision (note that you can change the output precision of
matrix/modes data sets in cpptraj with the 'precision' command).

One last note: if you do not RMS-fit to something like the average
structure prior to the 'matrix' command your covariance matrix will
contain contributions from overall rotational/translational motion,
which may not be what you want.


Daniel R. Roe, PhD
Department of Medicinal Chemistry
University of Utah
30 South 2000 East, Room 201
Salt Lake City, UT 84112-5820
(801) 587-9652
(801) 585-9119 (Fax)
AMBER mailing list
Received on Mon Sep 09 2013 - 10:00:03 PDT
Custom Search