Re: [AMBER] atom number same as line number for cpptraj

From: Jason Swails <>
Date: Wed, 23 Jul 2014 09:03:02 -0700

On Jul 23, 2014, at 8:23 AM, newamber list <> wrote:

> Dear Jason and Daniel,
> Thanks here are my replies:
>>> The line number trick won't work because molecules are separated by TER
> cards
> yes I removed all that extra lines, Just ATOM info is there
> Actually I want to do analysis on some atom whose coordinates (read from
> PDB) fall in some my selection criteria. This atom number in PDB is more
> than 99999 so if ATOM number is taken from PDB it will be actually wrong.
> So using line number should correspond to correct atom number. So my
> question: Is this line number (= atom number) should be the same atom
> number which cpptraj uses internal numbering?

We have already described how cpptraj numbers its atoms. It goes from 1 to N. I won't commit to an actual answer of your question since I don't know how you modified the file. The general answer is "no, because of extra lines like TER cards", but if you've removed them then it's possible you're correct.

It's far easier to just check yourself. Go to a handful of different lines in your file. For example, is atom 1024 on line 1024? Is atom 100,001 on line 100,001? This should be easy to determine since the numbering restarts on the line above. Is atom 105,501 on line 105,501? If the answer to all of these questions is "yes", then you can be confident that line numbers correspond to atom numbers. This is an example of a question where investigating yourself is far better than asking on a list.


Jason M. Swails
Rutgers University
Postdoctoral Researcher
AMBER mailing list
Received on Wed Jul 23 2014 - 09:30:03 PDT
Custom Search