[gmx-users] writing script to analyze gmx data

X.Periole X.Periole at rug.nl
Wed May 25 08:26:42 CEST 2005


On Wed, 25 May 2005 13:03:41 +0800
  "Jian Zou" <zouj01 at mails.tsinghua.edu.cn> wrote:
> Hi all,
> 
> I have a question about writing a script to analyze gmx 
>data..
> 
> some analysis utilities of gromacs need keyboard input 
>after running the command.
> 
> how could I incorporate this keyboard input into the 
>script?
> 
> 
> for example, I want use "g_dist" to calculate the 
>distance between Group 2
> and Group 5, I write the following script:
> 
> ----start of the script----
> #!/bin/sh
> g_dist -f md.trr -s b4md.tpr -n index.ndx -o dist.xvg
> ----end of the script----
> 
> the input file "md.trr", "b4md.tpr", "index.ndx"
> and output the distance between Group 2 and Group 5 into 
>the file
> "dist.xvg".
> 
> after running the script, it will prompt to select the 
>groups, I will input
> 2 and 5 for this case.
> 
> I want to write sth. to put these selection into the 
>script, then what
> should I do?
> 
> 
> Thanks a lot in advance.
> 
> 
A simple way is to put the choices of index into a file 
and
give it in the standard input. Ex:

g_dist -f traj.xtc -in index.ndx -o blbbal.xvg < toto

where toto would contain the two lines :
2
5

that would work. You can include that in a script ...

XAvier




More information about the gromacs.org_gmx-users mailing list