Date: Tue, 12 Mar 2002 10:30:51 -0800 (PST)
From: Thomas Cheatham
Subject: Re: combining trajectory file


> You may need to remove the title line from the 2nd trajectory on, otherwise,
> it wouldn't work correctly.

> > > I am using AMBER 6 recently for my simulation work. I divided my long
> > > simulation into several files but I have a problem in combining those files.
> > > I tried to use "cat" to cambine them, for example:
> > > cat md1.traj > md.traj
> > > cat md2.traj >> md.traj

As mentioned, although you can in principle simply remove the title, often
times in series of longer runs, in my experience (such as when the job is
killed due to wallclock limits while writing or disk overflow, etc),
sometimes the trajectory file is not written out completely for the final
frame of a given trajectory file. Although this is rare, if you simply
concatenate files together (after removing the titles) and have a partial
frame/configuration at the end of one of the trajectories, everything
after this point will be offset/incorrect.

ptraj can be used to concatenate the files (and even strip atoms like
solvent) and will also "check" each trajectory file it reads printing out
how many frames are found, whether inconsistencies are found (like *****'s
in the output due to overflow), etc. Although it is slower than simply
concatenating, it is likely more reliable.

An example input would be

trajin md1.traj
trajin md2.traj.gz
trajin md3.traj
trajout md.traj nobox
rms first mass out rms_backbone.dat @C,N,CA
strip :WAT

If you have troubles, let me know.