Closed GoogleCodeExporter closed 9 years ago
Thanks, will have a look. Two questions:
- You say that the above recipe (ts.frame = frame) will not set the mode index.
What does it set instead? Can you gmxdump the resulting trajectory (which still
has v and f). If the problem is that step starts at 0 but modes start at 1: How
about using the optional starting offset argument to enumerate():
for mode, coords in enumerate(newtraj, 1):
ts.frame = mode
...
i.e. starting the enumeration at 1 instead of 0?
- Is the reported time the eigenvalue or is it some arbitrary number?
Thanks.
Original comment by orbeckst
on 21 Sep 2011 at 2:07
GROMACS expect the mode number in step variable.
This way, it works:
for frame,mode in enumerate(modes[4:16]):
coords = mode.scaledToNorm(1.).array*10 #nm a angstroms
ts.lmbda = -1
if frame<=1:
ts._pos[:] = xav
else:
ts._pos[:] = coords
ts.frame = frame # manually change the frame number
ts.step = frame -1
if frame <= 1:
ts.time = frame-1
else:
ts.time = mode.frequency
W.write(ts) # convert angstrom to nm for gmx
Original comment by rcreh...@gmail.com
on 30 Sep 2011 at 9:42
Good that you figured out how to "reformat" the modes.
Do you think that there is anything in MDAnalysis that should be changed/added
to facilitate this conversion? If so, add it here. Otherwise I'll close the
report in a few days.
Original comment by orbeckst
on 30 Sep 2011 at 3:11
I guess that the only thing that needs to be changed is the documentation,
somehow stating that for a PCA trajectory the PC index goes into the ts.step.
Just to avoid other people opening new issues :-)
Original comment by rcreh...@gmail.com
on 30 Sep 2011 at 3:34
Ok, will do that and add your recipe to the docs.
Good that you found ts.step; I just looked at the source again and saw that
this is very specific to XTC/TRR and is not automatically set from frame ---
sorry for misleading you in my original example.
Many thanks again for the feedback and the solution!
Original comment by orbeckst
on 30 Sep 2011 at 4:38
added the recipe in r906, see
http://mdanalysis.googlecode.com/svn/trunk/doc/html/documentation_pages/coordina
tes/TRR.html#filling-a-trr-with-pca-modes
Original comment by orbeckst
on 5 Oct 2011 at 11:15
Original issue reported on code.google.com by
rcreh...@gmail.com
on 21 Sep 2011 at 10:06