[gmx-users] trjconv -pbc -center

Daniel Adriano Silva M dadriano at gmail.com
Fri Jun 19 03:27:05 CEST 2009


Hi,

I answered a very similar question last week but it appears that
gmx-users is not online by now: try to use this script. And be aware
to re-wrap code lines as my mail splits it. Please comment if it
actually works for you.

Best.
Daniel

***********
Usage notes:

- Just copy/and/paste the code on a textfile and make it executable
with "chmod 700", !!!take care of broken/split lines by email/post
artifacts!!!
- I use mdrun with -deffnm for the outputs; therefore this script is
made to work when all the output files have the same name.
- Do not forget to replace the *** field for the GROBIN variable on the code.
- On the code 0 and 1 are the index groups for system and protein
respectively. However, for any complex the trick to have a nice
representation is to center the system only on one of the proteins,
for example, for me:
             echo -e "del 1-14\n r 1-238\n r 1-239\n q\n" |
$GROBIN/make_ndx -f pre1_$NAME.gro -o pre1_$NAME.ndx
makes the trick, since it erases all the groups from my index, except
system, and then creates the group 1 only for one of my proteins
(residues 1-238) and additionally the group 2 used to output  my
complex in the absence of waters (residues 1-239).

To run use:
     ./scriptname
PATH-TO-DINAMIC/MDOUTPUT-NAME-WITHOUT-DOT-OR-EXTENSIONS  OUTPUT-NAME
Example:
     ./filterscript  /home/dsilva/dynamic/production/md  filteredmd

***********
CODE:
***********


#!/bin/bash
#Daniel Silva, script to filter trajectories....
       PATH=$1
       NAME=$2
       GROBIN=/usr/local/gromacs/bin   #MODIFY THIS LINE TO POINT TO
YOUR GROMACS BINARIES PATH
       /bin/cp $PATH.tpr ./$NAME-filtered.tpr
       echo -e "0\n"    | $GROBIN/trjconv -f $PATH -s
$NAME-filtered.tpr -pbc whole  -o pre1_$NAME
       echo -e "0\n"    | $GROBIN/trjconv -f $PATH -s
$NAME-filtered.tpr -pbc whole  -o pre1_$NAME.gro -e 0
### Modify the next line if you have any kind of complex, in order to
make group 1 pointing only to one of proteins in the complex.
(Example: echo -e "del 1-14\n r 1-238\n r 1-239\n q\n" |
$GROBIN/make_ndx -f pre1_$NAME.gro -o pre1_$NAME.ndx)
       echo -e "q\n" | $GROBIN/make_ndx -f pre1_$NAME.gro -o pre1_$NAME.ndx
       echo -e "1\n0\n" | $GROBIN/trjconv -f pre1_$NAME -s
$NAME-filtered.tpr -pbc atom -ur compact -center -n pre1_$NAME.ndx -o
pre2_$NAME
       echo -e "1\n0\n" | $GROBIN/trjconv -f pre2_$NAME -s
$NAME-filtered.tpr -fit rot+trans -n pre1_$NAME.ndx -o $NAME-filtered
       echo -e "0\n"    | $GROBIN/trjconv -f $NAME-filtered -s
$NAME-filtered.tpr -e 0 -n pre1_$NAME.ndx -o $NAME-filtered.gro
### If you also want to output trajectories without waters uncomment
the next two lines. Also, if you have complexes take care of the group
that you are sending to the output (Example, for me it needs to be
group 2 not 1; echo -e "1\n2\n" and echo -e "2\n", respectively for
the next two lines)
#       echo -e "1\n1\n" | $GROBIN/trjconv -f pre2_$NAME -s
$NAME-filtered.tpr -fit rot+trans -n pre1_$NAME.ndx -o
$NAME-filtered-NoHOH
#       echo -e "1\n"    | $GROBIN/trjconv -f $NAME-filtered -s
$NAME-filtered.tpr -e 0 -n pre1_$NAME.ndx -o $NAME-filtered-NoHOH.gro
       /bin/rm ./pre*_$NAME.*


************
###CODE END
************



2009/6/18 Justin A. Lemkul <jalemkul at vt.edu>:
>
>
> Chih-Ying Lin wrote:
>>
>> Hi
>> I have a protein+several ligand in the simulation box.
>> After 5ns, the protein drift to the right edge of the box and the
>> ligand drift to the left edge of the box. I supposed that the ligands
>> dock/attach on the protein.
>> I want to center the protein and see if the ligands dock/attach on the
>> protein.
>>
>> The command trjconv is used.
>> I have tried different option -pbc and -center.
>> Even though I center the protein, but the ligand is still away from the
>> protein.
>> It seems not make sense.
>>
>>
>> with option -pbc cluster
>> the computer was running and never end.
>>
>> so, how can i use trjconv command to center protein and to see the
>> ligand attaching on the protein?
>>
>
> Well, does the association you expect actually occur?  It seems to me that
> if you center the protein in the box, and the ligands do not associate, then
> you can't force it to happen with trjconv.
>
> -Justin
>
>>
>> Thank you
>> Lin
>>
>>
>>
>>
>> Option -pbc sets the type of periodic boundary condition treatment:
>> * mol puts the center of mass of molecules in the box.
>> * res puts the center of mass of residues in the box.
>> * atom puts all the atoms in the box.
>> * nojump checks if atoms jump across the box and then puts them back.
>> * cluster clusters all the atoms in the selected index such that they are
>> all
>> closest to the center of mass of the cluster which is iteratively updated.
>> Note that this will only give meaningful results if you in fact have a
>> cluster. Luckily that can be checked afterwards using a trajectory viewer.
>> Note also that if your molecules are broken this will not work either.
>> * whole only makes broken molecules whole.
>>
>>
>>
>>
>> Option -center centers the system in the box. The user can select the
>> group
>> which is used to determine the geometrical center. The location of the
>> center
>> is set with -boxcenter: tric: half of the sum of the box vectors, rect:
>> half
>> of the box diagonal, zero: zero. Use option -pbc mol in addition to
>> -center
>> when you want all molecules in the box after the centering.
>> _______________________________________________
>> gmx-users mailing list    gmx-users at gromacs.org
>> http://lists.gromacs.org/mailman/listinfo/gmx-users
>> Please search the archive at http://www.gromacs.org/search before posting!
>> Please don't post (un)subscribe requests to the list. Use the www
>> interface or send it to gmx-users-request at gromacs.org.
>> Can't post? Read http://www.gromacs.org/mailing_lists/users.php
>>
>
> --
> ========================================
>
> Justin A. Lemkul
> Ph.D. Candidate
> ICTAS Doctoral Scholar
> Department of Biochemistry
> Virginia Tech
> Blacksburg, VA
> jalemkul[at]vt.edu | (540) 231-9080
> http://www.bevanlab.biochem.vt.edu/Pages/Personal/justin
>
> ========================================
> _______________________________________________
> gmx-users mailing list    gmx-users at gromacs.org
> http://lists.gromacs.org/mailman/listinfo/gmx-users
> Please search the archive at http://www.gromacs.org/search before posting!
> Please don't post (un)subscribe requests to the list. Use the www interface
> or send it to gmx-users-request at gromacs.org.
> Can't post? Read http://www.gromacs.org/mailing_lists/users.php
>



More information about the gromacs.org_gmx-users mailing list