This is a suggestion for a mdanalysis improvement: to be able to generate
trajectories of Gromacs PCA's.
PCA are trr files without forces and velocities (only positions, which
represent PCA vectors). The mode index is numbered in "step".
These are the first few lines of gmxdump -f pca.trr...
natoms= 1252 step= 1 time=3.2866406e+00 lambda= 0
box (3x3):
box[ 0]={ 0.00000e+00, 0.00000e+00, 0.00000e+00}
box[ 1]={ 0.00000e+00, 0.00000e+00, 0.00000e+00}
box[ 2]={ 0.00000e+00, 0.00000e+00, 0.00000e+00}
x (1252x3):
x[ 0]={ 2.32158e-02, 1.46866e-03, -7.98529e-03}
x[ 1]={ 2.24531e-02, 3.62402e-03, -8.81686e-03}
x[ 2]={ 1.76530e-02, 5.75658e-03, -6.89898e-03}
x[ 3]={ 1.40843e-02, 1.05042e-02, -5.93055e-03}
x[ 4]={ 7.69775e-03, 1.05042e-02, -4.27620e-03}
x[ 5]={ 5.82995e-03, 1.53628e-02, -2.67087e-03}
Presently, one can generate a trajectory from some given coordinates as:
# iterate over the new frames to write trajectory
for frame,coords in enumerate(newtraj):
ts._pos[:] = coords # change coords of current in-memory time step
ts.frame = frame # manually change the frame number
W.write(ts)
W.close()
But that puts zero velocities and does not include the mode index. That renders
the trajectory unacceptable to Gromacs as a PCA trr file.
Original issue reported on code.google.com by
rcreh...@gmail.comon 21 Sep 2011 at 10:06