[gmx-users] Using trjcat to subdivide a trajectory into two trajectories (depending on a criterion)

Christian Seifert cseifert at bph.ruhr-uni-bochum.de
Tue Mar 9 14:49:18 CET 2010


I have a protein, which jumps between two states during a long
simulation. The two states are: open and close.

I used g_mindist to find out in which state the protein is at any given
time. My results are two lists of times.
e.g. (timeframe: 20ps):
open: 0ps 20ps 40ps 100ps 120ps
close: 60ps 80ps 140ps 160ps

Now, I want to subdivide my trajectory into two trajectories:
Protein.xtc <- This is the long trajectory
Protein_open.xtc <- This should be a trajectory of ONLY the open
Protein_close.xtc <- This should be a trajectory of ONLY the close

This is what I tried:
> # Generate the Protein_open with the first frames:
> trjcat -f Protein.xtc -o Protein_open.xtc -b 0 -e 40
> # Elongate Protein_open:
> trjcat -f Protein_open.xtc Protein.xtc -o Protein_open.xtc -b 100 -e

This seems to work (at least a bit), but I lose some frames (lose means:
the number of frames in Protein_open.xtc does not equal the number of
times in my open state list). And gmxcheck tells me, that some timesteps
do not match (e.g.: Reading frame     190 time 19240.000   
Timesteps at t=19260 don't match (20, 60)).

It gets even worse, when I try to do the same with the close state,
because then Protein_close.xtc does not start with time 0ps, but with
time 60ps.

Another problem appears, when I want to start with a trajectory, which
consists only of a single timestep. The produced trajectory seems to be
invalid. I guess, that a .xtc file consits of (at least) two structures.

Does someone has any suggestions?
I tried several combinations of -settime, -demux and -cat but could not
solve this.


M. Sc. Christian Seifert
Molecular Biomechanics Group
Schloß-Wolfsbrunnenweg 35
69118 Heidelberg

phone: +49-6221-533254
fax: +49 6221 533298
email: christian.seifert at h-its.org

Amtsgericht Mannheim / HRB 337446
Managing Directors: 
Dr. h.c. Klaus Tschira
Prof. Dr.-Ing. Andreas Reuter

More information about the gromacs.org_gmx-users mailing list