[gmx-developers] trjconv doesn't check if the .tpr, .xtc, and .ndx files provided match

Mark Abraham mark.j.abraham at gmail.com
Fri Jan 31 11:58:09 CET 2014


On Jan 31, 2014 4:22 AM, "sryckbos" <sryckbos at stanford.edu> wrote:
>
> trjconv doesn't seem to check whether the .ndx file you specify
corresponds
> at all with the .tpr and .xtc files you input.

Hi,

Thanks for the report. As Tsjerk said, the only metadata in .xtc is the
number of atoms, so only if an index group references out of those bounds
is there a clear error that can be caught. We are aware of these and other
deficiencies in the file formats; one advantage of the TNG trajectory
format available in the upcoming GROMACS 5.0 is that it has embedded
molecule information, which broadens the scope for such sanity checks.
These kinds of checks are not implemented yet, because the scope and
historical implementation of trajectory-file handling in GROMACS is
mind-boggling.

> I wrote a script that was
> using trjconv to remove the waters from many of my trajectories on several
> different systems.  I made an .ndx file for each of them, system1.ndx and
> system2.ndx, and planned to do something like this:
>
> echo Protein_ligand1|trjconv -s system1.tpr -f system1.xtc -o
> system1_dehyd.xtc -n system1.ndx
>
> and, separately, do
>
> echo Protein_ligand2|trjconv -s system2.tpr -f system2.xtc -o
> system2_dehyd.xtc -n system2.ndx
>
> Inadvertently, I forgot to change stuff in my second script, giving me a
> command like this
>
> echo Protein_ligand1|trjconv -s system2.tpr -f system2.xtc -o
> system2_dehyd.xtc -n system1.ndx
>
> Rather than flipping out and telling me that there isn't anything that
> corresponds to Protein_ligand1 in system2.tpr or system2.xtc, however, it
> gave me system2_dehyd.xtc as if nothing went wrong.  When I pulled
> coordinates from that xtc file, it just used the numbers that corresponded
> to Protein_ligand1 in the system2 files without looking at what it was
> actually pulling.

Indeed, but as the tool cannot parse the name of the index group, only if a
group with that name was used in the .tpr could there be a basis for a
warning. The best solution is to implement a command-line selection like

trjconv -s -f -o -select "Protein and Ligand1"

This kind of thing is available for a few tools in GROMACS 5.0, but more
hands are needed to port the machinery to more tools. Contributions welcome!

That still won't prevent you from writing the wrong selection for the name
of your -o file, though...

> Next I tried to break it.  system1 has slightly more atoms than system2,
and
> so I figured if trjconv just ran out of atoms, it'd throw an error.  Not
> really.  If I did this:
>
> echo System|trjconv -s system2.tpr -f system2.xtc -o system2_dehyd.xtc -n
> system1.ndx
>
> All I got was:
>
> Select a group: Selected 0: 'System'
> Segmentation fault

Thanks, that is bad - enough information exists to give a sensible error
message.

> Finally, I figured if there was no ndx file, I wouldn't get this problem.
> Not so.  If I did
>
> echo System|trjconv -s system2.tpr -f system1.xtc -o test.xtc
>
> This time, I did get the following error:
>
> -------------------------------------------------------
> Program trjconv, VERSION 4.6
> Source code file:
> /home/sryckbos/Downloads/gromacs-4.6/src/tools/gmx_trjconv.c, line: 1312
>
> Fatal error:
> Index[33820] 33821 is larger than the number of atoms in the
> trajectory file (33820). There is a mismatch in the contents
> of your -f, -s and/or -n files.
> For more information and tips for troubleshooting, please check the
GROMACS
> website at http://www.gromacs.org/Documentation/Errors
> -------------------------------------------------------

Good

> BUT, if I reversed it,
>
> echo System|trjconv -s system1.tpr -f system2.xtc -o test2.xtc
>
> There was no error, and I got test2.xtc out without any problems.

This "supports" the standard usage of .xtc to contain a subset of the .tpr
atoms, as written from mdrun. But since it is a null operation, it should
give an error. It doesn't do so because trjconv has too much functionality,
which I am working on.

> This seems like a pretty major bug to me, and presumably this isn't
> occurring because I'm not up to date (didn't see anything about it in any
of
> the release notes for the 4.6.x series, or on any of the mailing lists).
> Has anyone else experienced or noticed this issue?

Yes you're sufficiently up to date. Whether a problem gets fixed basically
depends on whether it annoys a developer enough to provoke them to fix it.
Unfortunately experience mitigates making this kind of mistake, and this
particular group of problems is too large for a new developer to fix!

Mark

> --
> View this message in context:
http://gromacs.5086.x6.nabble.com/trjconv-doesn-t-check-if-the-tpr-xtc-and-ndx-files-provided-match-tp5014178.html
> Sent from the GROMACS Developers Forum mailing list archive at Nabble.com.
> --
> Gromacs Developers mailing list
>
> * Please search the archive at
http://www.gromacs.org/Support/Mailing_Lists/GMX-developers_List before
posting!
>
> * Can't post? Read http://www.gromacs.org/Support/Mailing_Lists
>
> * For (un)subscribe requests visit
> https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-developersor send a mail to
gmx-developers-request at gromacs.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://maillist.sys.kth.se/pipermail/gromacs.org_gmx-developers/attachments/20140131/ebc57a91/attachment.html>


More information about the gromacs.org_gmx-developers mailing list