<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
    <title></title>
  </head>
  <body text="#000000" bgcolor="#ffffff">
    On 9/05/2011 2:01 PM, Dimitar Pachov wrote:
    <blockquote
      cite="mid:BANLkTikS_=k+EL+LUs+KcNfXuv9LF0k14A@mail.gmail.com"
      type="cite">Hi,
      <div><br>
      </div>
      <div>On Sat, May 7, 2011 at 9:45 PM, Justin A. Lemkul&nbsp;<span
          dir="ltr">&lt;<a moz-do-not-send="true"
            href="mailto:jalemkul@vt.edu" target="_blank">jalemkul@vt.edu</a>&gt;</span>&nbsp;wrote:</div>
      <div>
        <div class="gmail_quote"><br>
          <blockquote class="gmail_quote" style="margin: 0px 0px 0px
            0.8ex; border-left: 1px solid rgb(204, 204, 204);
            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)? &nbsp;My answer was based on your request to
            "keep the original unit shape."
            <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.&nbsp;</div>
          <div><br>
          </div>
        </div>
      </div>
      <div>
        <blockquote class="gmail_quote" style="margin: 0px 0px 0px
          0.8ex; border-left: 1px solid rgb(204, 204, 204);
          padding-left: 1ex;">
          <div>
            <blockquote class="gmail_quote" style="margin: 0px 0px 0px
              0.8ex; border-left: 1px solid rgb(204, 204, 204);
              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. &nbsp;A suggested workflow is indeed documented:<br>
          <br>
          <a moz-do-not-send="true"
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't understand why people don'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&nbsp;recentering&nbsp;around solute.</div>
      </div>
    </blockquote>
    <br>
    Fair point. I've updated the trjconv documentation to provide this
    hint and a suggestiong to consult the webpage.<br>
    <br>
    <blockquote
      cite="mid:BANLkTikS_=k+EL+LUs+KcNfXuv9LF0k14A@mail.gmail.com"
      type="cite">
      <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="$prot-$shape-$flc"</div>
            <div>topfile="$prot-$shape-$flc.top"</div>
            <div>grofile="$shape-$fl-eq.gro" &nbsp;</div>
            <div>inpfile="md.mdp" &nbsp;</div>
            <div><br>
            </div>
            <div>name="run1"</div>
            <div>newname="run1-recen"</div>
            <div>indexfile="index-all.ndx"</div>
            <div>tclfile="extr-frame-traj.tcl"</div>
            <div><br>
            </div>
            <div>s="Protein-Nucleo"</div>
            <div>indsolute=`cat $indexfile | awk -v site=$s
              '$1=="["{i++}$2==site{print i-1}'`</div>
            <div>cp $name.xtc $newname.xtc</div>
            <div><br>
            </div>
            <div>#===&gt; 1</div>
            <div>intraj="$newname.xtc"</div>
            <div>outtraj="traj/$newname-whole.xtc"</div>
            <div>trjconv -f $intraj -s $name.tpr -n $indexfile -o
              $outtraj &nbsp;-pbc whole &gt; log1 2&gt;&amp;1 &lt;&lt;EOF1</div>
            <div>0</div>
            <div>EOF1</div>
            <div>#===&gt; 2</div>
            <div>intraj="$outtraj"</div>
            <div>outtraj="traj/$newname-cluster.xtc"</div>
            <div>trjconv -f $intraj -s $name.tpr -n $indexfile -o
              $outtraj &nbsp;-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="$outtraj"</div>
            <div>outtraj="traj/$newname-nojump.xtc"</div>
            <div>trjconv -f $intraj -n $indexfile -o $outtraj &nbsp;-pbc
              nojump &gt; log3 2&gt;&amp;1 &lt;&lt;EOF3</div>
            <div>0</div>
            <div>EOF3</div>
            <div>#===&gt; 4</div>
            <div>intraj="$outtraj"</div>
            <div>outtraj="traj/$newname-center.xtc"</div>
            <div>trjconv -f $intraj -n $indexfile -o $outtraj &nbsp;-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="`echo $outtraj | awk 'BEGIN{FS="."}{print
              $1}'`"</div>
            <div>pdbfile="$pdbfilename-${fr}ps.pdb"</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 's/TIP3/SOL /' | sed 's/ OH2 SOL/ OW
              &nbsp;SOL/' | sed 's/ H1 &nbsp;SOL/ HW1 SOL/' | sed 's/ H2 &nbsp;SOL/ HW2
              SOL/' | sed 's/ SOD SOD/ NA &nbsp;NA /g' | sed 's/ CLA CLA/ CL
              &nbsp;CL /g' | sed 's/ HT1 MET/ H1 &nbsp;MET/' | sed 's/ HT2 MET/ H2
              &nbsp;MET/' | sed 's/ HT3 MET/ H3 &nbsp;MET/' &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="$outtraj"</div>
        <div>outtraj="traj/$newname-compact.xtc"</div>
        <div>trjconv -s $newname-center.tpr -f $intraj -n $indexfile -o
          $outtraj &nbsp;-pbc mol -ur compact &nbsp;&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>
    </blockquote>
    <br>
    What steps are necessary depends what your purpose is. trjconv -dump
    should do step #5. What are you generating the centered trajectory
    for? What are you generating another .tpr for?<br>
    <br>
    Mark<br>
  </body>
</html>