[gmx-users] Energy between desired selected molecules

Mark Abraham mark.j.abraham at gmail.com
Wed Jul 13 10:15:23 CEST 2016


Hi,

If you're selecting different molecules for different frames, then simple
mdrun -rerun can't cope, because the energy groups are constant over the
rerun. Probably you want something like

make a tpr that will evaluate the energy for each pair (e.g. with tpbconv
and a static selection in an index group)
for each frame of the trajectory
  make dynamic selection
  use selection to get molecule subset of frame via trjconv
  use mdrun -rerun with the above tpr and the subset of the frame

Mark

On Wed, Jul 13, 2016 at 9:59 AM Faezeh Pousaneh <fpoosaneh at gmail.com> wrote:

> Dear Justin,
>
> I have a question regarding my last question (below which was 'obtaining
> energy for different selections').
>
> My selection is a molecule within specific z of the box. I want the
> selected z remains fix for whole energy calculation. I realized that mdrun
> -rerun does not update the position of the selection for all frames.
> Therefore, I guess one needs first to make a 'dynamic' selection from
> g_select. The resulted index file then contains  selections for all frames
> written frame by frame. Now, I suppose one can go for mdrun -rerun with the
> given index file. However, my question now is how properly re-name the
> energy groups in .mdp file according to the index file which has so many
> frames?
>
> Thank you for help.
>
> Best regards
>
>
> On Fri, Jul 1, 2016 at 4:20 PM, Faezeh Pousaneh <fpoosaneh at gmail.com>
> wrote:
>
> > Thank you again :)
> >
> >
> > Best regards
> >
> >
> > On Fri, Jul 1, 2016 at 4:17 PM, Justin Lemkul <jalemkul at vt.edu> wrote:
> >
> >>
> >>
> >> On 7/1/16 10:05 AM, Faezeh Pousaneh wrote:
> >>
> >>> Thank you Justin and Mark for the help. I could obtain.
> >>>
> >>> More details for someone with similar question:
> >>>
> >>> 1- First I defined the molecules (resnr 1 to 4) I wanted to look at
> >>> (from
> >>> existing simulation: production.tpr  6000wat.gro) :
> >>>
> >>> g_select -f 6000wat.gro -s production.tpr -on index.ndx
> >>>
> >>> resnr 1 to 4
> >>>
> >>> resnr 5 to 6000
> >>>
> >>> (all other renaming molecules also must be defined as next group,
> >>> resnr 5 to 6000)
> >>>
> >>> 2- Then I looked at the name of groups created in the index file and
> >>> changed the current .mdp file to include those groups:
> >>>
> >>>
> >> For the sake of correctness in the archive, don't do this:
> >>
> >> tc-grps                   =  resnr_5_to_6000     resnr_1_to_4
> >>>
> >>
> >> For the purpose of a re-run, tc-grps being split this way has no effect.
> >> But one should absolutely not divide thermostatting groups in this way.
> >>
> >> I feel it is important to point out so that (1) people don't make this a
> >> common practice and (2) you don't start re-using .mdp files with these
> >> settings.
> >>
> >> This is all you need to accomplish what you want in terms of the energy:
> >>
> >> energygrps            =  resnr_5_to_6000    resnr_1_to_4
> >>>
> >>>
> >> The rest of the .mdp file should be the same as your original run.
> >>
> >> -Justin
> >>
> >>
> >> 3- Finally rerun
> >>>
> >>> grompp -f new.mdp -c 6000wat.gro -p topol.top -o new.tpr -n index.ndx
> >>> mdrun -rerun traj.xtc -s new.tpr -mn index.ndx
> >>>
> >>> 4- So, if you now run g_energy you'll find those specified groups
> >>> energies.
> >>>
> >>>
> >>>
> >>> Best regards
> >>>
> >>>
> >>> On Fri, Jul 1, 2016 at 2:38 PM, Justin Lemkul <jalemkul at vt.edu> wrote:
> >>>
> >>>
> >>>>
> >>>> On 7/1/16 8:36 AM, Faezeh Pousaneh wrote:
> >>>>
> >>>> Thank you both, I am close to solve it. The remaining problem is when
> I
> >>>>> mdrun -rerun, it tells the number of atoms in old trajectory is not
> the
> >>>>> same as chosen index file.
> >>>>>
> >>>>> Number of atoms in trajectory (24000) does not match the run input
> file
> >>>>>
> >>>>>>
> >>>>>> (16)
> >>>>>
> >>>>>
> >>>>> Your .tpr file needs to contain the same system that you ran before.
> >>>> The
> >>>> only thing that changes is the energygrps setting in the .mdp file.
> >>>>
> >>>> -Justin
> >>>>
> >>>>
> >>>> can you help me?
> >>>>
> >>>>> Best regards
> >>>>>
> >>>>>
> >>>>> On Fri, Jul 1, 2016 at 2:19 PM, Mark Abraham <
> mark.j.abraham at gmail.com
> >>>>> >
> >>>>> wrote:
> >>>>>
> >>>>> Hi,
> >>>>>
> >>>>>>
> >>>>>> Yes as Justin says, a group is a few molecules that you selected :-)
> >>>>>>
> >>>>>> Mark
> >>>>>>
> >>>>>> On Fri, 1 Jul 2016 14:00 Justin Lemkul <jalemkul at vt.edu> wrote:
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>> On 7/1/16 7:55 AM, Faezeh Pousaneh wrote:
> >>>>>>>
> >>>>>>> Thank you Mark, I see. But what is the solution then? The way you
> >>>>>>>>
> >>>>>>>> proposed
> >>>>>>>
> >>>>>>>
> >>>>>>>> ''You can make a new .tpr file with those
> >>>>>>>> energy groups and use mdrun -rerun on the old trajectory,
> however.''
> >>>>>>>>
> >>>>>>>>  is not my answer, since I do not want the energy for a ''group''
> of
> >>>>>>>> molecules, rather for specified combination of few molecules I
> >>>>>>>> define
> >>>>>>>>
> >>>>>>>> from
> >>>>>>>
> >>>>>>> g_select.
> >>>>>>>>
> >>>>>>>>
> >>>>>>>> The only function available is to define energygrps in the .mdp
> >>>>>>> file,
> >>>>>>> supply an
> >>>>>>> index file with those groups (e.g. from g_select) and do as Mark
> says
> >>>>>>> and
> >>>>>>> re-calculate those interaction energies with mdrun -rerun on the
> >>>>>>> existing
> >>>>>>> trajectory.  The short-range nonbonded interaction energies between
> >>>>>>> those
> >>>>>>> groups
> >>>>>>> will be written to their own terms in a new .edr file.
> >>>>>>>
> >>>>>>> -Justin
> >>>>>>>
> >>>>>>>
> >>>>>>> Best regards
> >>>>>>>>
> >>>>>>>>
> >>>>>>>> On Fri, Jul 1, 2016 at 11:20 AM, Mark Abraham <
> >>>>>>>>
> >>>>>>>> mark.j.abraham at gmail.com>
> >>>>>>>
> >>>>>>
> >>>>>> wrote:
> >>>>>>>
> >>>>>>>>
> >>>>>>>> Hi,
> >>>>>>>>
> >>>>>>>>>
> >>>>>>>>> The .edr file contains only what was written during the
> simulation,
> >>>>>>>>>
> >>>>>>>>> and
> >>>>>>>>
> >>>>>>>
> >>>>>> that was for any energy groups defined before that run. You're
> trying
> >>>>>>>
> >>>>>>>>
> >>>>>>>>> to
> >>>>>>>>
> >>>>>>>
> >>>>>> ask it to make an arbitrary repartition, which it can't do unless it
> >>>>>>>
> >>>>>>>> recorded every component of the energy for every frame (which
> would
> >>>>>>>>>
> >>>>>>>>> take
> >>>>>>>>
> >>>>>>>
> >>>>>> forever and use lots of disk). You can make a new .tpr file with
> those
> >>>>>>>
> >>>>>>>> energy groups and use mdrun -rerun on the old trajectory, however.
> >>>>>>>>>
> >>>>>>>>> Mark
> >>>>>>>>>
> >>>>>>>>> On Fri, Jul 1, 2016 at 9:41 AM Faezeh Pousaneh <
> >>>>>>>>> fpoosaneh at gmail.com>
> >>>>>>>>> wrote:
> >>>>>>>>>
> >>>>>>>>> Hi
> >>>>>>>>>
> >>>>>>>>>>
> >>>>>>>>>> Does someone know how to obtain energy between specific
> molecules
> >>>>>>>>>> in
> >>>>>>>>>>
> >>>>>>>>>> the
> >>>>>>>>>
> >>>>>>>>
> >>>>>>> system?
> >>>>>>>>
> >>>>>>>>>
> >>>>>>>>>> What I did and seems not be correct is:
> >>>>>>>>>> 1- I obtained the molecules I wanted to look at:
> >>>>>>>>>> g_select_mpi -f 600gro.gro -s production.tpr -on
> >>>>>>>>>>
> >>>>>>>>>> 2- Then I produced a .tpr file for the chosen
> selection,index.ndx,
> >>>>>>>>>> tpbconv -s production.tpr -n index.ndx -o tpxout.tpr
> >>>>>>>>>>
> >>>>>>>>>> 3- Finally put the created .tpr file as an input for g_energy
> >>>>>>>>>> g_energy -f ener.edr -s tpxout.tpr  (either, g_energy -s
> >>>>>>>>>> tpxout.tpr)
> >>>>>>>>>>
> >>>>>>>>>> But that is not the solution, since it gives energy for whole
> >>>>>>>>>> system.
> >>>>>>>>>> Best regards
> >>>>>>>>>> --
> >>>>>>>>>> Gromacs Users mailing list
> >>>>>>>>>>
> >>>>>>>>>> * Please search the archive at
> >>>>>>>>>> http://www.gromacs.org/Support/Mailing_Lists/GMX-Users_List
> >>>>>>>>>> before
> >>>>>>>>>> posting!
> >>>>>>>>>>
> >>>>>>>>>> * Can't post? Read http://www.gromacs.org/Support/Mailing_Lists
> >>>>>>>>>>
> >>>>>>>>>> * For (un)subscribe requests visit
> >>>>>>>>>>
> https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-users
> >>>>>>>>>>
> >>>>>>>>>> or
> >>>>>>>>>
> >>>>>>>>
> >>>>>> send a mail to gmx-users-request at gromacs.org.
> >>>>>>>
> >>>>>>>>
> >>>>>>>>>> --
> >>>>>>>>>>
> >>>>>>>>> Gromacs Users mailing list
> >>>>>>>>>
> >>>>>>>>> * Please search the archive at
> >>>>>>>>> http://www.gromacs.org/Support/Mailing_Lists/GMX-Users_List
> before
> >>>>>>>>> posting!
> >>>>>>>>>
> >>>>>>>>> * Can't post? Read http://www.gromacs.org/Support/Mailing_Lists
> >>>>>>>>>
> >>>>>>>>> * For (un)subscribe requests visit
> >>>>>>>>>
> https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-users
> >>>>>>>>> or
> >>>>>>>>> send a mail to gmx-users-request at gromacs.org.
> >>>>>>>>>
> >>>>>>>>>
> >>>>>>>>> --
> >>>>>>> ==================================================
> >>>>>>>
> >>>>>>> Justin A. Lemkul, Ph.D.
> >>>>>>> Ruth L. Kirschstein NRSA Postdoctoral Fellow
> >>>>>>>
> >>>>>>> Department of Pharmaceutical Sciences
> >>>>>>> School of Pharmacy
> >>>>>>> Health Sciences Facility II, Room 629
> >>>>>>> University of Maryland, Baltimore
> >>>>>>> 20 Penn St.
> >>>>>>> Baltimore, MD 21201
> >>>>>>>
> >>>>>>> jalemkul at outerbanks.umaryland.edu | (410) 706-7441
> >>>>>>> http://mackerell.umaryland.edu/~jalemkul
> >>>>>>>
> >>>>>>> ==================================================
> >>>>>>> --
> >>>>>>> Gromacs Users mailing list
> >>>>>>>
> >>>>>>> * Please search the archive at
> >>>>>>> http://www.gromacs.org/Support/Mailing_Lists/GMX-Users_List before
> >>>>>>> posting!
> >>>>>>>
> >>>>>>> * Can't post? Read http://www.gromacs.org/Support/Mailing_Lists
> >>>>>>>
> >>>>>>> * For (un)subscribe requests visit
> >>>>>>> https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-users
> >>>>>>> or
> >>>>>>> send a mail to gmx-users-request at gromacs.org.
> >>>>>>>
> >>>>>>> --
> >>>>>>>
> >>>>>> Gromacs Users mailing list
> >>>>>>
> >>>>>> * Please search the archive at
> >>>>>> http://www.gromacs.org/Support/Mailing_Lists/GMX-Users_List before
> >>>>>> posting!
> >>>>>>
> >>>>>> * Can't post? Read http://www.gromacs.org/Support/Mailing_Lists
> >>>>>>
> >>>>>> * For (un)subscribe requests visit
> >>>>>> https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-users
> or
> >>>>>> send a mail to gmx-users-request at gromacs.org.
> >>>>>>
> >>>>>>
> >>>>>> --
> >>>> ==================================================
> >>>>
> >>>> Justin A. Lemkul, Ph.D.
> >>>> Ruth L. Kirschstein NRSA Postdoctoral Fellow
> >>>>
> >>>> Department of Pharmaceutical Sciences
> >>>> School of Pharmacy
> >>>> Health Sciences Facility II, Room 629
> >>>> University of Maryland, Baltimore
> >>>> 20 Penn St.
> >>>> Baltimore, MD 21201
> >>>>
> >>>> jalemkul at outerbanks.umaryland.edu | (410) 706-7441
> >>>> http://mackerell.umaryland.edu/~jalemkul
> >>>>
> >>>> ==================================================
> >>>> --
> >>>> Gromacs Users mailing list
> >>>>
> >>>> * Please search the archive at
> >>>> http://www.gromacs.org/Support/Mailing_Lists/GMX-Users_List before
> >>>> posting!
> >>>>
> >>>> * Can't post? Read http://www.gromacs.org/Support/Mailing_Lists
> >>>>
> >>>> * For (un)subscribe requests visit
> >>>> https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-users or
> >>>> send a mail to gmx-users-request at gromacs.org.
> >>>>
> >>>>
> >> --
> >> ==================================================
> >>
> >> Justin A. Lemkul, Ph.D.
> >> Ruth L. Kirschstein NRSA Postdoctoral Fellow
> >>
> >> Department of Pharmaceutical Sciences
> >> School of Pharmacy
> >> Health Sciences Facility II, Room 629
> >> University of Maryland, Baltimore
> >> 20 Penn St.
> >> Baltimore, MD 21201
> >>
> >> jalemkul at outerbanks.umaryland.edu | (410) 706-7441
> >> http://mackerell.umaryland.edu/~jalemkul
> >>
> >> ==================================================
> >> --
> >> Gromacs Users mailing list
> >>
> >> * Please search the archive at
> >> http://www.gromacs.org/Support/Mailing_Lists/GMX-Users_List before
> >> posting!
> >>
> >> * Can't post? Read http://www.gromacs.org/Support/Mailing_Lists
> >>
> >> * For (un)subscribe requests visit
> >> https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-users or
> >> send a mail to gmx-users-request at gromacs.org.
> >>
> >
> >
> --
> Gromacs Users mailing list
>
> * Please search the archive at
> http://www.gromacs.org/Support/Mailing_Lists/GMX-Users_List before
> posting!
>
> * Can't post? Read http://www.gromacs.org/Support/Mailing_Lists
>
> * For (un)subscribe requests visit
> https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-users or
> send a mail to gmx-users-request at gromacs.org.
>


More information about the gromacs.org_gmx-users mailing list