<div class="gmail_quote">Hi Mark,</div><div class="gmail_quote"><br></div><div class="gmail_quote">Thanks for your answer. I was not being clear in my first mail. Please see below.</div><div class="gmail_quote"><br></div><div class="gmail_quote">
On Fri, Sep 24, 2010 at 10:37 AM, Mark Abraham <span dir="ltr">&lt;<a href="mailto:mark.abraham@anu.edu.au" target="_blank">mark.abraham@anu.edu.au</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div></div><div><br><br>----- Original Message -----<br>From: Martin Kamp Jensen &lt;<a href="mailto:martin.kamp.jensen@gmail.com" target="_blank">martin.kamp.jensen@gmail.com</a>&gt;<br>

Date: Friday, September 24, 2010 18:23<br>Subject: [gmx-developers] Interface - energy value from peptide conformation<br>To: <a href="mailto:gmx-developers@gromacs.org" target="_blank">gmx-developers@gromacs.org</a><br>
<br>
<font style="font-style:normal;font-weight:normal;background-color:rgb(245, 248, 240);font-size:14px">&gt; </font>Hello,<div><br></div><div><font style="font-style:normal;font-weight:normal;background-color:rgb(245, 248, 240);font-size:14px">&gt; </font>I just started experimenting with GROMACS and I would like to interface with it to get energy values for different conformations of peptides. When debugging my way through the energy minimization part of the gmxdemo tutorial, I ended up in the following method of the mdlib/minimize.c file:</div>

 <div><font style="font-style:normal;font-weight:normal;background-color:rgb(245, 248, 240);font-size:14px">&gt; </font><br><div><div><font style="font-style:normal;font-weight:normal;background-color:rgb(245, 248, 240);font-size:14px">&gt; </font>static void evaluate_energy(FILE *fplog,bool bVerbose,t_commrec *cr,</div>

<div><span style="white-space:pre-wrap"><font style="font-style:normal;font-weight:normal;background-color:rgb(245, 248, 240);font-size:14px">&gt; </font>                        </span>    t_state *state_global,gmx_mtop_t *top_global,</div><div>

<span style="white-space:pre-wrap"><font style="font-style:normal;font-weight:normal;background-color:rgb(245, 248, 240);font-size:14px">&gt; </font>                        </span>    em_state_t *ems,rvec **buf,gmx_localtop_t *top,</div> <div>

<span style="white-space:pre-wrap"><font style="font-style:normal;font-weight:normal;background-color:rgb(245, 248, 240);font-size:14px">&gt; </font>                        </span>    t_inputrec *inputrec,</div><div><span style="white-space:pre-wrap"><font style="font-style:normal;font-weight:normal;background-color:rgb(245, 248, 240);font-size:14px">&gt; </font>                        </span>    t_nrnb *nrnb,gmx_wallcycle_t wcycle,</div>

<div><span style="white-space:pre-wrap"><font style="font-style:normal;font-weight:normal;background-color:rgb(245, 248, 240);font-size:14px">&gt; </font>                        </span>    gmx_vsite_t *vsite,gmx_constr_t constr,</div> <div><span style="white-space:pre-wrap"><font style="font-style:normal;font-weight:normal;background-color:rgb(245, 248, 240);font-size:14px">&gt; </font>                        </span>    t_fcdata *fcd,</div>

<div><span style="white-space:pre-wrap"><font style="font-style:normal;font-weight:normal;background-color:rgb(245, 248, 240);font-size:14px">&gt; </font>                        </span>    t_graph *graph,t_mdatoms *mdatoms,</div><div><span style="white-space:pre-wrap"><font style="font-style:normal;font-weight:normal;background-color:rgb(245, 248, 240);font-size:14px">&gt; </font>                        </span>    t_forcerec *fr, rvec mu_tot,</div>

 <div><span style="white-space:pre-wrap"><font style="font-style:normal;font-weight:normal;background-color:rgb(245, 248, 240);font-size:14px">&gt; </font>                        </span>    gmx_enerdata_t *enerd,tensor vir,tensor pres,</div>
<div>
<span style="white-space:pre-wrap"><font style="font-style:normal;font-weight:normal;background-color:rgb(245, 248, 240);font-size:14px">&gt; </font>                        </span>    int count,bool bFirst)</div></div><div><font style="font-style:normal;font-weight:normal;background-color:rgb(245, 248, 240);font-size:14px">&gt; </font><br>

</div><div><font style="font-style:normal;font-weight:normal;background-color:rgb(245, 248, 240);font-size:14px">&gt; </font>I&#39;m not very experienced with C/C++, but the fact that this method is static means that I cannot just call it from another C program (or e.g. a Java program) without changing GROMACS. I guess a naive way would be setting up an energy minimization and just running one step, but that is a lot of overhead and not very clean. Do you have any pointers for me?</div>

 </div><div><font style="font-style:normal;font-weight:normal;background-color:rgb(245, 248, 240);font-size:14px">&gt; </font><br></div></div></div><div><div><div></div><div><font style="font-style:normal;font-weight:normal;background-color:rgb(245, 248, 240);font-size:14px">&gt; </font>(Actually, what I want to do is navigate the energy landscape of peptides by changing the torsion angles. This means that I will need to look up energy values very frequently.)<br>

<br></div></div>The elegant way to do that is to write your series of conformations to a pseudo-trajectory (in whichever of GROMACS many trajectory formats is convenient to you), and then invoke mdrun -rerun on that trajectory with a suitable .tpr. Then you either parse the .log file or the output .edr file for the energies. This should keep the overhead quite low.<br>

</div></blockquote><div><br></div><div>This seems like a good idea when you have all the conformations for which you want to look up energy values. The thing is, I need to get an energy value, then do some work outside of GROMACS, get a new energy value, etc.</div>

<div><br></div><div>Imagine you have two conformations in the energy landscape, both are local minima. Then I would like to find out how a conformation should change to get from one to another while trying to ensure low energy values for the intermediate conformations. This will require the use of heuristics that will need to look up the energy value in each step where a conformation will be changed slightly from one towards another.</div>

<div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><br>Mark<br></div>
<br>--<br>
gmx-developers mailing list<br>
<a href="mailto:gmx-developers@gromacs.org" target="_blank">gmx-developers@gromacs.org</a><br>
<a href="http://lists.gromacs.org/mailman/listinfo/gmx-developers" target="_blank">http://lists.gromacs.org/mailman/listinfo/gmx-developers</a><br>
Please don&#39;t post (un)subscribe requests to the list. Use the<br>
www interface or send it to <a href="mailto:gmx-developers-request@gromacs.org" target="_blank">gmx-developers-request@gromacs.org</a>.<br></blockquote></div><br>
<div>Regards,</div><div>Martin.</div>