Hi,<div><br></div><div>On Sat, May 7, 2011 at 9:45 PM, Justin A. Lemkul <span dir="ltr">&lt;<a href="mailto:jalemkul@vt.edu" target="_blank">jalemkul@vt.edu</a>&gt;</span> wrote:</div><div><div class="gmail_quote"><br><blockquote class="gmail_quote" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204, 204, 204);border-left-style:solid;padding-left:1ex">

<div><br></div>Please clarify - do you wish to maintain the original triclinic representation (as -ur tric does) or do you wish to see the octahedral representation (as -pbc mol -ur compact gives)?  My answer was based on your request to &quot;keep the original unit shape.&quot;<div>

<br></div></blockquote><div><br></div><div>My original representation is truncated octahedron. Gromacs requires triclinic vectors and does not care about unit cell shape at the moment the md code starts. I wanted to keep MY original unit shape. </div>

<div><br></div></div></div><div><blockquote class="gmail_quote" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204, 204, 204);border-left-style:solid;padding-left:1ex">

<div><blockquote class="gmail_quote" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204, 204, 204);border-left-style:solid;padding-left:1ex">
<br></blockquote><br></div>For complicated systems (or sometimes even for simple ones), it is quite common that multiple iterations of trjconv are necessary.  A suggested workflow is indeed documented:<br><br><a href="http://www.gromacs.org/Documentation/Terminology/Periodic_Boundary_Conditions#Suggested_trjconv_workflow" target="_blank">http://www.gromacs.org/Documentation/Terminology/Periodic_Boundary_Conditions#Suggested_trjconv_workflow</a><br>

<br>The documentation must remain somewhat generic, as there are a number of specialty systems that can be considered.<br></blockquote><div><br></div><div>I thought the guidelines given by the trjconv specific manual were sufficient. I don&#39;t understand why people don&#39;t put this suggested workflow in the trjconv manual. It is confusing otherwise. It never came to me that one needed multiple usages of trjconv in order to achieve recentering around solute.</div>

</div><div><br></div><div>I followed these instructions and got what I wanted. Basically, this was my quick workflow:</div><div><br></div><div>=================================</div><div><div><div><div>psfinname=&quot;$prot-$shape-$flc&quot;</div>
<div>topfile=&quot;$prot-$shape-$flc.top&quot;</div><div>grofile=&quot;$shape-$fl-eq.gro&quot;  </div><div>inpfile=&quot;md.mdp&quot;  </div><div><br></div><div>name=&quot;run1&quot;</div><div>newname=&quot;run1-recen&quot;</div>
<div>indexfile=&quot;index-all.ndx&quot;</div><div>tclfile=&quot;extr-frame-traj.tcl&quot;</div><div><br></div><div>s=&quot;Protein-Nucleo&quot;</div><div>indsolute=`cat $indexfile | awk -v site=$s &#39;$1==&quot;[&quot;{i++}$2==site{print i-1}&#39;`</div>
<div>cp $name.xtc $newname.xtc</div><div><br></div><div>#===&gt; 1</div><div>intraj=&quot;$newname.xtc&quot;</div><div>outtraj=&quot;traj/$newname-whole.xtc&quot;</div><div>trjconv -f $intraj -s $name.tpr -n $indexfile -o $outtraj  -pbc whole &gt; log1 2&gt;&amp;1 &lt;&lt;EOF1</div>
<div>0</div><div>EOF1</div><div>#===&gt; 2</div><div>intraj=&quot;$outtraj&quot;</div><div>outtraj=&quot;traj/$newname-cluster.xtc&quot;</div><div>trjconv -f $intraj -s $name.tpr -n $indexfile -o $outtraj  -pbc cluster &gt; log2 2&gt;&amp;1 &lt;&lt;EOF2</div>
<div>$indsolute</div><div>0</div><div>EOF2</div><div>#===&gt; 3</div><div>intraj=&quot;$outtraj&quot;</div><div>outtraj=&quot;traj/$newname-nojump.xtc&quot;</div><div>trjconv -f $intraj -n $indexfile -o $outtraj  -pbc nojump &gt; log3 2&gt;&amp;1 &lt;&lt;EOF3</div>
<div>0</div><div>EOF3</div><div>#===&gt; 4</div><div>intraj=&quot;$outtraj&quot;</div><div>outtraj=&quot;traj/$newname-center.xtc&quot;</div><div>trjconv -f $intraj -n $indexfile -o $outtraj  -center &gt; log4 2&gt;&amp;1 &lt;&lt;EOF4</div>
<div>$indsolute</div><div>0</div><div>EOF4</div><div>#===&gt; 5</div><div>## Get first frame from centered .xtc</div><div>fr=1</div><div>pdbfilename=&quot;`echo $outtraj | awk &#39;BEGIN{FS=&quot;.&quot;}{print $1}&#39;`&quot;</div>
<div>pdbfile=&quot;$pdbfilename-${fr}ps.pdb&quot;</div><div>`which vmd` -dispdev text -e $tclfile -args $fr ${pathpsfin}/${psfinname}.psf $outtraj $pdbfilename &gt; /dev/null</div><div><br></div><div>cat $pdbfile | sed &#39;s/TIP3/SOL /&#39; | sed &#39;s/ OH2 SOL/ OW  SOL/&#39; | sed &#39;s/ H1  SOL/ HW1 SOL/&#39; | sed &#39;s/ H2  SOL/ HW2 SOL/&#39; | sed &#39;s/ SOD SOD/ NA  NA /g&#39; | sed &#39;s/ CLA CLA/ CL  CL /g&#39; | sed &#39;s/ HT1 MET/ H1  MET/&#39; | sed &#39;s/ HT2 MET/ H2  MET/&#39; | sed &#39;s/ HT3 MET/ H3  MET/&#39; &gt; $pdbfilename-${fr}ps-renamed.pdb</div>
<div><br></div><div>grompp -f $inpfile -c $pdbfilename-${fr}ps-renamed.pdb -n $indexfile -p $topfile -o $newname-center.tpr &gt; log5 2&gt;&amp;1</div></div></div></div><div><div>#===&gt; 6</div><div>intraj=&quot;$outtraj&quot;</div>
<div>outtraj=&quot;traj/$newname-compact.xtc&quot;</div><div>trjconv -s $newname-center.tpr -f $intraj -n $indexfile -o $outtraj  -pbc mol -ur compact  &gt; log6 2&gt;&amp;1 &lt;&lt;EOF6</div><div>0</div><div>EOF6</div></div>
<div>=================================</div><div><br></div><div><br></div><div>However, it seems a long process, and if I have a large number of trajectories, it might not be feasible. I actually do not know if all steps are necessary. Particularly, I did step #5 just to get a new *tpr file from the centered trajectory ... Is there a way to do that in a simpler way within Gromacs?</div>
<div><br></div><div><br></div><div><br><br><div class="gmail_quote">On Sun, May 8, 2011 at 4:06 AM, Tsjerk Wassenaar <span dir="ltr">&lt;<a href="mailto:tsjerkw@gmail.com" target="_blank">tsjerkw@gmail.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
Justin is very right to point at the workflow. In your case, the<br>
points 5 and 6 apply: centering, and putting things in some box. Maybe<br>
that doesn&#39;t work in one pass and you&#39;ll have to use trjconv twice.<br>
<div><br>
&gt;&gt; This does not work. Neither is the solute always surrounded by solvent for<br>
&gt;&gt; every frame (it goes out of the box) nor is the original unit cell<br>
&gt;&gt; (truncated octahedron) preserved.<br>
<br>
</div>You have to think out of the box with PBC :) The solute is always<br>
surrounded by solvent, except where it touches its own image, in which<br>
case you should consider throwing away and redo the run in a larger<br>
box. There is no out of the box where atoms can go to. Furthermore,<br>
the unit cell does not have shape, it only has translational relations<br>
(lattice vectors). </blockquote><div><br></div><div>It does not have a shape in Gromacs; otherwise it has. </div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
You can carve out any general shape you want, such<br>
as rectangular, truncated octahedron, rhombic dodecahedron. Note that<br>
only in special cases you can carve out regular instances of those<br>
(such as a cube for a rectangular brick).<br>
To understand this, here&#39;s a bit of an exercise:<br>
<br>
Draw three identical hexagons in contact with each other<br>
&gt;From one of the hexagons, draw vectors to the other two, and draw the<br>
parallellogram spanned by these vectors.<br>
Place a hexagon at the farthest node, and not how the parallellogram<br>
has exactly the same content as any of the hexagons.<br>
Now turn the parallellogram into a rectangular brick by translating a<br>
part of it, and note how the brick still has the same contents as a<br>
hexagon.<br>
Feeling confident that any shape will do, find some tilings from<br>
Escher and try to see how you can fit that into a parallellogram,<br>
rectangle, or hexagon :) Of course the coolest would be to use those<br>
to define a unit cell to put your atoms in :p<br></blockquote><div><br></div><div>I did not quite get why I needed all of this advice, but thanks for your input anyway. </div><div><br></div><div>Best,</div><div>Dimitar</div>
<div><br></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Groetjes,<br>
<br>
Tsjerk<br>
<br>
<br>
--<br>
Tsjerk A. Wassenaar, Ph.D.<br>
<br>
post-doctoral researcher<br>
Molecular Dynamics Group<br>
* Groningen Institute for Biomolecular Research and Biotechnology<br>
* Zernike Institute for Advanced Materials<br>
University of Groningen<br>
The Netherlands<br>
<div><div></div><div>--<br>
gmx-users mailing list    <a href="mailto:gmx-users@gromacs.org" target="_blank">gmx-users@gromacs.org</a><br>
<a href="http://lists.gromacs.org/mailman/listinfo/gmx-users" target="_blank">http://lists.gromacs.org/mailman/listinfo/gmx-users</a><br>
Please search the archive at <a href="http://www.gromacs.org/Support/Mailing_Lists/Search" target="_blank">http://www.gromacs.org/Support/Mailing_Lists/Search</a> before posting!<br>
Please don&#39;t post (un)subscribe requests to the list. Use the<br>
www interface or send it to <a href="mailto:gmx-users-request@gromacs.org" target="_blank">gmx-users-request@gromacs.org</a>.<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>
</div></div></blockquote></div><br><br clear="all"><br>
</div>