[gmx-users] writing a script to analyze gmx data (Jian Zou)

Kia Balali-Mood Kia.Balali-Mood at ed.ac.uk
Wed May 25 12:45:37 CEST 2005


For what it's worth, here's another way of automating things!

#!/bin/sh
echo 2 5 | g_dist -f md.trr -s b4md.tpr -n index.ndx -o dist.xvg

whereby 2 and 5 are ur selected groups. use echo and pipe it (|) that should
see u through ok!

best wishes

Kia
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Wed, 25 May 2005 13:03:41 +0800
> From: "Jian Zou" <zouj01 at mails.tsinghua.edu.cn>
> Subject: [gmx-users] writing script to analyze gmx data
> To: "gmx-users" <gmx-users at gromacs.org>
> Message-ID: <001b01c560e7$1f15a030$43256fa6 at tsinghuafd2d4a>
> Content-Type: text/plain; format=flowed; charset="Windows-1252";
> 	reply-type=original
>
> 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.
>
>
> Regards,
>
> Jian Zou
>
>
>
> ------------------------------
>
> Message: 2
> Date: Wed, 25 May 2005 13:17:19 +0800
> From: "Zhiguo Liu" <zgliu at iris3.simm.ac.cn>
> Subject: Re: [gmx-users] writing script to analyze gmx data
> To: "Discussion list for GROMACS user" <gmx-users at gromacs.org>
> Message-ID: <200505251819.NAA17614 at iris3.simm.ac.cn>
>
> Dear Jian Zou,
>
> 	That's easy, if you use bsh, just do as following:
>
> #!/bin/sh
> g_dist -f md.trr -s b4md.tpr -n index.ndx -o dist.xvg << EOF
> 2
> 5
> EOF
>
>
>
> ======= 2005-05-25 13:03:41 you 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.
> >
> >
> >Regards,
> >
> >Jian Zou
> >
> >_______________________________________________
> >gmx-users mailing list
> >gmx-users at gromacs.org
> >http://www.gromacs.org/mailman/listinfo/gmx-users
> >Please don't post (un)subscribe requests to the list. Use the
> >www interface or send it to gmx-users-request at gromacs.org.
> >
>
> = = = = = = = = = = = = = = = = = = = =
>
>
> Best regard!
>
>
> ¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡Zhiguo Liu
> ¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡zgliu at iris3.simm.ac.cn
> ¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡2005-05-25
>
>
>
>
> ------------------------------
>
> Message: 3
> Date: Wed, 25 May 2005 08:26:42 +0200
> From: "X.Periole" <X.Periole at rug.nl>
> Subject: Re: [gmx-users] writing script to analyze gmx data
> To: Discussion list for GROMACS users <gmx-users at gromacs.org>
> Message-ID: <web-4019530 at mail3.rug.nl>
> Content-Type: text/plain; charset="windows-1252"; format="flowed"
>
> 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
>
>

******************************************************************************
Kia Balali-Mood PhD
(Now moved to the Sansom group in Oxford!)
Laboratory of Membrane Biophysics
Division of Veterinary Biomedical Sciences
College of Medicine & Veterinary Medicine
University of Edinburgh
Summerhall
Edinburgh, EH9 1QH
Tel. +44 (0)131 650 6142
Fax. +44 (0)131 650 6576
sansom.biop.ox.ac.uk



More information about the gromacs.org_gmx-users mailing list