[gmx-users] Script for looping n simulations

Justin Lemkul jalemkul at vt.edu
Tue Mar 10 20:22:28 CET 2020



On 3/10/20 3:20 PM, Neena Susan Eappen wrote:
> Hi Justin,
>
> I tried that script out, but I want the output in a different way. So I have n log files (.log), and I want to extract potential energy value say from line x from all n log files. Is there a way I can export all these potential energy values into one text file with one script?

Yes, this is easy to do with standard Linux tools, but that is a topic 
for other forums. It is easier to get this information from .edr files 
directly from gmx energy.

-Justin

> Many thanks,
> Neena
> ________________________________
> From: Neena Susan Eappen <neena.susaneappen at mail.utoronto.ca>
> Sent: Saturday, February 22, 2020 4:28 PM
> To: gromacs.org_gmx-users at maillist.sys.kth.se <gromacs.org_gmx-users at maillist.sys.kth.se>
> Subject: Re: [gmx-users] Script for looping n simulations
>
> Thank you Miro, but I don't think I found what I wanted in your script. Let me be more clear: I ran n simulations in a loop, I have corresponding n energy files (.edr). I want to extract potential energy from each file. How would I go about that with a script?
>
> Many thanks,
> Neena
> ________________________________
> From: Neena Susan Eappen <neena.susaneappen at mail.utoronto.ca>
> Sent: Saturday, February 22, 2020 2:41 PM
> To: gromacs.org_gmx-users at maillist.sys.kth.se <gromacs.org_gmx-users at maillist.sys.kth.se>
> Subject: Re: [gmx-users] Script for looping n simulations
>
> Thank you Justin, just sharing the sample script here:
> --------------------
> #!/bin/bash
> for i in {1..n}
> do j=$((i+1))
> gmx grompp -f nvt.mdp -c em${i}.gro -r em${i}.gro -p topol.top -o nvt${j}.tpr
> gmx mdrun -deffnm nvt${j}
> gmx grompp -f md.mdp -c nvt${j}.gro -t nvt${j}.cpt -p topol.top -o md${j}.tpr
> gmx mdrun -deffnm md${j}
> done
> ----------------------
> Question: Now that I have n .edr files, is there a script I can write to extract say potential energy from these n files?
>
> Thank you for your time and knowledge,
> Neena
>
>
> ________________________________
> From: Neena Susan Eappen
> Sent: Saturday, February 15, 2020 4:44 PM
> To: gromacs.org_gmx-users at maillist.sys.kth.se <gromacs.org_gmx-users at maillist.sys.kth.se>
> Subject: [gmx-users] Script for looping n simulations
>
> Hello gromacs users,
>
> I was wondering how to write a script to repeat a simulation (equilibration and production) n times, with each cycle starting with structure from the end of previous cycle.
>
> Many thanks,
> Neena

-- 
==================================================

Justin A. Lemkul, Ph.D.
Assistant Professor
Office: 301 Fralin Hall
Lab: 303 Engel Hall

Virginia Tech Department of Biochemistry
340 West Campus Dr.
Blacksburg, VA 24061

jalemkul at vt.edu | (540) 231-3129
http://www.thelemkullab.com

==================================================



More information about the gromacs.org_gmx-users mailing list