fixatomorder

Fix atom ordering so that all atoms in molecules are sequential.

fixatomorder [outprefix <prefix>] 
             [nobox] 
             [parmout <filename>] 
             [parmopts <comma-separated-list>] 
             [pdborder [hetatm <mask>]] (EXPERIMENTAL)

outprefix <prefix> Write re-ordered topology to <prefix>.<originalname>
[nobox] Remove any box information from the re-ordered topology.
parmout <filename> Write re-ordered topology to <filename>
parmopts <list> Options for writing topology file pdborder (EXPERIMENTAL) Try to reorder atoms according to PDB information.
pdborder (EXPERIMENTAL) Try to reorder atoms according to PDB information.
hetatm <mask> Mark atoms in mask as HETATM, order them after other atoms.

CPPTRAJ (and most of Amber) expects that atom indices in molecules to increase monotonically. However, occasionally atom indices in molecules can become disordered or non-sequential, in which case CPPTRAJ will print an error message such as the following:

Error: Atom 45 was assigned a lower molecule # (1) than previous atom (2).

and:

Error: Could not determine molecule information for <topology file>.

This command fixes atom ordering so that all atoms in molecules are sequential. The outprefix keyword will write out the re-ordered topology with name:

<name>.<original name>

For example, given an out of order topology named ‘outoforder.parm7’ and a corresponding trajectory ‘min1.crd’, the following will produce a reordered topology named ‘reorder.outoforder.parm7’ and a reordered trajectory named ‘reorder.mdcrd’:

parm outoforder.parm7 
trajin min1.crd 1 10 
fixatomorder outprefix reorder 
trajout reorder.mdcrd

If pdborder is specied, attempt to organize atoms by PDB information (i.e. Chain ID, original residue numbering, and insertion codes).

Atoms optionally specied by hetatm <mask> will be placed after all other atoms. Note that the pdborder keyword is still experimental, and requires that the Topology have PDB-type information present.