Re: [AMBER] ptraj closest water

From: Daniel Roe <>
Date: Mon, 18 Jul 2011 12:19:20 -0400


On Mon, Jul 18, 2011 at 12:00 PM, George Tzotzos <> wrote:
> Is there a way to produce only one new.pdb file?

If your intent is to create a single PDB file containing all of your
frames you can either write a script that will concatenate all of your
PDB files into a single file separated with MODEL X and ENDMDL
keywords, or just use cpptraj (this is the default way cpptraj writes
out PDB files).

If your intent is to only write 1 frame, you need to specify that in
your trajin command - numeric arguments are not processed for trajout

trajin prod_2ns.mdcrd 1 1
trajout test.pdb pdb

If you want to write out your entire trajectory as netcdf AND write
only 1 frame of PDB, you need to use cpptraj and the 'onlyframes'

trajin prod_2ns.mdcrd
trajout test.pdb pdb onlyframes 1
trajout prod_closest_WAT_2.mdcrd netcdf

This will create a PDB file containing only the first frame from
prod_2ns.mdcrd, as well as the specified output netcdf trajectory
containing all frames. Note that cpptraj does not use the "solvent"
command (right now solvent is assumed to be named :WAT so your script
should still run fine in cpptraj).

> Furthermore, if the working directory contains other trajectories (e.g. prod_4ns, prod_6ns, etc.), the script scans them all - although they are not specified in the first line of the script. Any suggestions why so?

This should not happen. Are you executing this as part of a larger
shell script? The trajin command of ptraj should only process the file
it is given. If you can, please post your entire ptraj output as an

Let me know if you have any more questions.


AMBER mailing list
Received on Mon Jul 18 2011 - 09:30:05 PDT
Custom Search