Re: [AMBER] ambpdb error

From: Jason Swails <jason.swails.gmail.com>
Date: Fri, 29 Apr 2016 13:22:33 -0400

On Fri, Apr 29, 2016 at 1:01 PM, Arati Paudyal <apsilwal123.gmail.com>
wrote:

> Dan,
>
> Thank you for the file. Please excuse my question again but I literally
> don't see any differences between the "fixed" file and the original one
> when I open in wordpad. Could you please elaborate a little bit more here.
> Adding a line and then removing it again will bring it to the same
> ​​
> situation, right? I think I am not understanding this in detail.
>

​This is something that doesn't matter to *users*, but does matter to
parsers and computers. The last line of the file that Dan sent you ends
with an "invisible" character \n, or a line feed or newline. These are the
characters that typical file readers and parsers use to indicate that a
line has ended. Naively, you can think about the number of these
characters representing the number of lines in your file. However, if your
last line is missing this end-of-line (EOL) character, then your line count
will be too small by exactly 1.

cpptraj's parser here is sensitive to those details for reasons that (I
believe) are related to how file formats are detected and how many frames
that trajectory holds (and what information that trajectory file holds).
In a restart file, there are 2 lines at the beginning (title and info
line), 2 coordinates per line for coordinates, and the same for velocities,
with an extra line at the end if there is unit cell dimensions. And it's a
fixed-format file (every coordinate takes exactly 12 characters with 7
decimal points). So cpptraj counts the number of bytes in the file which,
coupled with the number of atoms that are supposed to be in the file
format, should indicate to cpptraj exactly what data is present.

Lacking a newline (\n, or EOL) in the last line of your file screwed up
this count.

TL;DR -- the difference here is only of interest to computers, but there
*is* a difference. Use the "wc" program to see that the file Dan sent you
has one more character than your original trajectory.

ParmEd doesn't have this problem because it does not have to be (or,
rather, doesn't try to be) as smart as cpptraj does in determining file
contents.

HTH,
Jason

-- 
Jason M. Swails
_______________________________________________
AMBER mailing list
AMBER.ambermd.org
http://lists.ambermd.org/mailman/listinfo/amber
Received on Fri Apr 29 2016 - 10:30:07 PDT
Custom Search