<!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 <span
dir="ltr"><<a moz-do-not-send="true"
href="mailto:jalemkul@vt.edu" target="_blank">jalemkul@vt.edu</a>></span> 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)? 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. </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. 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 recentering 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" </div>
<div>inpfile="md.mdp" </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>#===> 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 -pbc whole > log1 2>&1 <<EOF1</div>
<div>0</div>
<div>EOF1</div>
<div>#===> 2</div>
<div>intraj="$outtraj"</div>
<div>outtraj="traj/$newname-cluster.xtc"</div>
<div>trjconv -f $intraj -s $name.tpr -n $indexfile -o
$outtraj -pbc cluster > log2 2>&1 <<EOF2</div>
<div>$indsolute</div>
<div>0</div>
<div>EOF2</div>
<div>#===> 3</div>
<div>intraj="$outtraj"</div>
<div>outtraj="traj/$newname-nojump.xtc"</div>
<div>trjconv -f $intraj -n $indexfile -o $outtraj -pbc
nojump > log3 2>&1 <<EOF3</div>
<div>0</div>
<div>EOF3</div>
<div>#===> 4</div>
<div>intraj="$outtraj"</div>
<div>outtraj="traj/$newname-center.xtc"</div>
<div>trjconv -f $intraj -n $indexfile -o $outtraj -center
> log4 2>&1 <<EOF4</div>
<div>$indsolute</div>
<div>0</div>
<div>EOF4</div>
<div>#===> 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 >
/dev/null</div>
<div><br>
</div>
<div>cat $pdbfile | sed 's/TIP3/SOL /' | sed 's/ OH2 SOL/ OW
SOL/' | sed 's/ H1 SOL/ HW1 SOL/' | sed 's/ H2 SOL/ HW2
SOL/' | sed 's/ SOD SOD/ NA NA /g' | sed 's/ CLA CLA/ CL
CL /g' | sed 's/ HT1 MET/ H1 MET/' | sed 's/ HT2 MET/ H2
MET/' | sed 's/ HT3 MET/ H3 MET/' >
$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 > log5
2>&1</div>
</div>
</div>
</div>
<div>
<div>#===> 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 -pbc mol -ur compact > log6 2>&1
<<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>