<div dir="ltr">Hey :)<div><br></div><div>The index file only contains labels and numbers. The labels are for you to make sense of and allow easy referencing. There is nothing in the reference/trajectory/index that allows checking whether the indices match what you mean. </div>
<div><br></div><div>Cheers,</div><div><br></div><div>Tsjerk <br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Jan 31, 2014 at 4:16 AM, sryckbos <span dir="ltr">&lt;<a href="mailto:sryckbos@stanford.edu" target="_blank">sryckbos@stanford.edu</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">trjconv doesn&#39;t seem to check whether the .ndx file you specify corresponds<br>
at all with the .tpr and .xtc files you input.  I wrote a script that was<br>
using trjconv to remove the waters from many of my trajectories on several<br>
different systems.  I made an .ndx file for each of them, system1.ndx and<br>
system2.ndx, and planned to do something like this:<br>
<br>
echo Protein_ligand1|trjconv -s system1.tpr -f system1.xtc -o<br>
system1_dehyd.xtc -n system1.ndx<br>
<br>
and, separately, do<br>
<br>
echo Protein_ligand2|trjconv -s system2.tpr -f system2.xtc -o<br>
system2_dehyd.xtc -n system2.ndx<br>
<br>
Inadvertently, I forgot to change stuff in my second script, giving me a<br>
command like this<br>
<br>
echo Protein_ligand1|trjconv -s system2.tpr -f system2.xtc -o<br>
system2_dehyd.xtc -n system1.ndx<br>
<br>
Rather than flipping out and telling me that there isn&#39;t anything that<br>
corresponds to Protein_ligand1 in system2.tpr or system2.xtc, however, it<br>
gave me system2_dehyd.xtc as if nothing went wrong.  When I pulled<br>
coordinates from that xtc file, it just used the numbers that corresponded<br>
to Protein_ligand1 in the system2 files without looking at what it was<br>
actually pulling.<br>
<br>
Next I tried to break it.  system1 has slightly more atoms than system2, and<br>
so I figured if trjconv just ran out of atoms, it&#39;d throw an error.  Not<br>
really.  If I did this:<br>
<br>
echo System|trjconv -s system2.tpr -f system2.xtc -o system2_dehyd.xtc -n<br>
system1.ndx<br>
<br>
All I got was:<br>
<br>
Select a group: Selected 0: &#39;System&#39;<br>
Segmentation fault<br>
<br>
Finally, I figured if there was no ndx file, I wouldn&#39;t get this problem.<br>
Not so.  If I did<br>
<br>
echo System|trjconv -s system2.tpr -f system1.xtc -o test.xtc<br>
<br>
This time, I did get the following error:<br>
<br>
-------------------------------------------------------<br>
Program trjconv, VERSION 4.6<br>
Source code file:<br>
/home/sryckbos/Downloads/gromacs-4.6/src/tools/gmx_trjconv.c, line: 1312<br>
<br>
Fatal error:<br>
Index[33820] 33821 is larger than the number of atoms in the<br>
trajectory file (33820). There is a mismatch in the contents<br>
of your -f, -s and/or -n files.<br>
For more information and tips for troubleshooting, please check the GROMACS<br>
website at <a href="http://www.gromacs.org/Documentation/Errors" target="_blank">http://www.gromacs.org/Documentation/Errors</a><br>
-------------------------------------------------------<br>
<br>
BUT, if I reversed it,<br>
<br>
echo System|trjconv -s system1.tpr -f system2.xtc -o test2.xtc<br>
<br>
There was no error, and I got test2.xtc out without any problems.<br>
<br>
This seems like a pretty major bug to me, and presumably this isn&#39;t<br>
occurring because I&#39;m not up to date (didn&#39;t see anything about it in any of<br>
the release notes for the 4.6.x series, or on any of the mailing lists).<br>
Has anyone else experienced or noticed this issue?<br>
<br>
<br>
--<br>
View this message in context: <a href="http://gromacs.5086.x6.nabble.com/trjconv-doesn-t-check-if-the-tpr-xtc-and-ndx-files-provided-match-tp5014178.html" target="_blank">http://gromacs.5086.x6.nabble.com/trjconv-doesn-t-check-if-the-tpr-xtc-and-ndx-files-provided-match-tp5014178.html</a><br>

Sent from the GROMACS Developers Forum mailing list archive at Nabble.com.<br>
<span class="HOEnZb"><font color="#888888">--<br>
Gromacs Developers mailing list<br>
<br>
* Please search the archive at <a href="http://www.gromacs.org/Support/Mailing_Lists/GMX-developers_List" target="_blank">http://www.gromacs.org/Support/Mailing_Lists/GMX-developers_List</a> before posting!<br>
<br>
* Can&#39;t post? Read <a href="http://www.gromacs.org/Support/Mailing_Lists" target="_blank">http://www.gromacs.org/Support/Mailing_Lists</a><br>
<br>
* For (un)subscribe requests visit<br>
<a href="https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-developers" target="_blank">https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-developers</a> or send a mail to <a href="mailto:gmx-developers-request@gromacs.org">gmx-developers-request@gromacs.org</a>.<br>

</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br>Tsjerk A. Wassenaar, Ph.D.<br><br>
</div>