Dear Justin and Chris<br><br>very thanks for your reply and guidance.<br><br>I did all the steps successfully. then I used (./my_tool -f final.xtc -o final.pdb -b 300 -e 350), the final.pdb file was created without problem. when I opened final.pdb file by text editor, order of waters and ions in final.pdb was like final.xtc (waters are before ions).<br>
my purpose was to reorder water molecules with Na+ ions in final.xtc file as<br><br>at first<br><br>1-1867                       complex (protein and dna)<br>1868 - 24085              SOL (water molecules)<br>24086 - 24099            Na+ (ions)<br>
<br>after reordering<br><br>1-1867                       complex (protein and dna)<br>1868 -1881                 Na+ (ions)<br>1882 - 24099              SOL (water molecules)<br><br>but this wasn&#39;t done. Is there problem in modification made in gmx_trjconv.c or same my_tool.c file:<br>
<br>####### Now go to line 1264 of the file and replace this:<br><br>               for(i=0; i&lt;nout; i++) {<br>                 copy_rvec(fr.x[index[i]],frout.x[i]);<br>                 if (bVels &amp;&amp; fr.bV) {<br>
                   copy_rvec(fr.v[index[i]],frout.v[i]);<br>                 }<br>                 if (bForce &amp;&amp; fr.bF) {<br>                   copy_rvec(fr.f[index[i]],frout.f[i]);<br>                 }<br>               }<br>
<br>####### with this:<br><br>               for(i=0; i&lt;=1866; i++) {<br>                 copy_rvec(fr.x[index[i]],frout.x[i]);<br>               }<br>               for(i=24085; i&lt;=24098; i++) {<br>                 copy_rvec(fr.x[index[i]],frout.x[i-22218]);<br>
               }<br>               for(i=1867; i&lt;=24084; i++) {<br>                 copy_rvec(fr.x[index[i]],frout.x[i+14]);<br>               }<br><br>               for(i=0; i&lt;nout; i++) {<br>                 if (bVels &amp;&amp; fr.bV) {<br>
                   copy_rvec(fr.v[index[i]],frout.v[i]);<br>                 }<br>                 if (bForce &amp;&amp; fr.bF) {<br>                   copy_rvec(fr.f[index[i]],frout.f[i]);<br>                 }<br>               }<br>
             }<br><br><br><br clear="all"><br>-- <br><pre style="font-family: arial,helvetica,sans-serif;">Leila Karami<br>Ph.D. student of Physical Chemistry<br>K.N. Toosi University of Technology<br>Theoretical Physical Chemistry Group</pre>
<br>