Reweighting using HISTOGRAM analysis.

3,617 views
Skip to first unread message

galmas

unread,
Nov 13, 2016, 6:56:57 AM11/13/16
to PLUMED users
Hi everybody,

Given that I performed a well-tempered metadynamics simulation with the REWEIGHTING_NGRID and REWEIGHTING_NHILLS options, is it possible to post-process my trajectory and use HISTOGRAM to get a reweighted histogram of the free energy?

Cheers,
Gal.

Gareth Tribello

unread,
Nov 14, 2016, 4:27:30 AM11/14/16
to plumed...@googlegroups.com
Hello

Yes you can do the reweighting.  Let’s suppose that you had an input for your metadynamics something like this:

d1: DISTANCE ATOMS=1,2
METAD ARG=d1 PACE=100 HEIGHT=1.2 SIGMA=0.02 BIASFACTOR=10 GRID_MIN=0 GRID_MAX=1 GRID_BIN=200 REWEIGHTING_NGRID=200 

and that you had output the MD trajectory every 100 steps to a file called traj.xyz

You can write a plumed input file (plumed_reweigh.dat) something like this:

d1: DISTANCE ATOMS=1,2
d2: DISTANCE ATOMS=3,4
METAD ARG=d1 PACE=1 HEIGHT=1.2 SIGMA=0.02 BIASFACTOR=10 GRID_MIN=0 GRID_MAX=1 GRID_BIN=200 REWEIGHTING_NGRID=200 

bias: REWEIGHT_METAD TEMP=300

HISTOGRAM …
   ARG=d2
   GRID_MIN=0.0
   GRID_MAX=1.0
   GRID_BIN=200
   LOGWEIGHTS=bias
   LABEL=hB
… HISTOGRAM

fes: CONVERT_TO_FES GRID=hB TEMP=300
DUMPGRID GRID=fes FILE=fes.dat

You then calculate the free energy surface by running driver with the command:

plumed driver —ixy traj.xyz —plumed plumed_reweigh.dat

The file (fes.dat) that will be output is the free energy as a function of the distance that was not biased (d2 in this case).  What we are essentially doing with the above calculation is rerunning the calculation so the bias is built up again from scratch.  In other words, we are using the trajectory to recalculate the positions of all the hills.  This is why we need to change the frequency with which hills are added in our input file.  As we output trajectory frames every 100 steps we need to add hills every one step of trajectory.  If we had output every 50 steps we would need to add a hill for metadynamics every 2 steps.  Now obviously, the above assumes that you output trajectory frames more frequently (or with the same frequency) than you added hills.  If you did not do that then the above will not work.

I hope this helps
Gareth



--
You received this message because you are subscribed to the Google Groups "PLUMED users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to plumed-users...@googlegroups.com.
To post to this group, send email to plumed...@googlegroups.com.
Visit this group at https://groups.google.com/group/plumed-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/plumed-users/d71341f0-7e0d-4ded-ba20-0d4c6cbc61e5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

galmas

unread,
Nov 14, 2016, 5:32:13 AM11/14/16
to PLUMED users
Thank you Gareth,
That was very helpful.

Now, if I'm studying a large system (which I am), writing my trajectory in the same pace I"m depositing Gaussians will result in very large files.
Do you know of any other methods I can use to reweight and extract an unbiased FES only based on my HILLS/COLVAR files?
Any help would be much appreciated.

Cheers,
Gal.

Gareth Tribello

unread,
Nov 14, 2016, 7:07:38 AM11/14/16
to plumed...@googlegroups.com
If you output the CV you want reweighted and the CV for metadynamics in the colvar file with the same pace that you are depositing Gaussians you can write a plumed input like this:

d1: READ FILE=colvar VALUES=d1 IGNORE_FORCES IGNORE_TIME
d2: READ FILE=colvar VALUES=d2 IGNORE_TIME

METAD ARG=d1 PACE=1 HEIGHT=1.2 SIGMA=0.02 BIASFACTOR=10 GRID_MIN=0 GRID_MAX=1 GRID_BIN=200 REWEIGHTING_NGRID=200 

bias: REWEIGHT_METAD TEMP=300

HISTOGRAM …
   ARG=d2
   GRID_MIN=0.0
   GRID_MAX=1.0
   GRID_BIN=200
   LOGWEIGHTS=bias
   LABEL=hB
… HISTOGRAM

fes: CONVERT_TO_FES GRID=hB TEMP=300
DUMPGRID GRID=fes FILE=fes.dat

Then 

plumed driver —noatoms —plumed plumed.dat

The above would be in your plumed.dat file here.

Gareth

galmas

unread,
Nov 14, 2016, 8:09:00 AM11/14/16
to PLUMED users
Great, that looks like it should do the trick!

Thank you very much Gareth!

Cheers,
Gal.

Azade yazdan

unread,
Jun 26, 2017, 8:48:11 AM6/26/17
to PLUMED users
Hello,

I have a couple of simulations ran by Plumed 2.2.2 and I'd like to use the reweight_metad option in version 2.3.2. When I use the version 2.3.2 to post process the trajectory, all I end up with are NAN or inf values. My input file is as follows. Is there something wrong that I am doing or simply version 2.3.2 should not be used to post process earlier outputs? Thanks in advance for your help.

Best,
Azade


#------------------------------------------------------------------------------------------------------SETUP
surface_ohb: GROUP ATOMS=10370-10510:2
surface_oht: GROUP ATOMS=10656-10798:2
surf: CENTER ATOMS=surface_ohb,surface_oht
#--------------------------------------------------------------------------------------------------------CVs
ala: COM ATOMS=10800-10812
ver_d_comp: DISTANCE ATOMS=surf,ala COMPONENTS

new_cv: DISTANCE ATOMS=surf,10800 COMPONENTS
#--------------------------------------------------------------------------------------------------------MTD
metad: METAD ARG=ver_d_comp.x PACE=1 SIGMA=0.05 HEIGHT=1.0 BIASFACTOR=15 GRID_MIN=0.0 GRID_MAX=1.46 GRID_BIN=100 REWEIGHTING_NGRID=100 TEMP=310

bias: REWEIGHT_METAD TEMP=310.0 

HISTOGRAM ...
ARG=new_cv.x
#USE_ALL_DATA
GRID_MIN=0.0
GRID_MAX=1.46
GRID_SPACING=0.05            
BANDWIDTH=0.05               
LOGWEIGHTS=bias
LABEL=hh
... HISTOGRAM

DUMPGRID GRID=hh FILE=histoB

ENDPLUMED

Giovanni Bussi

unread,
Jun 26, 2017, 8:51:45 AM6/26/17
to plumed...@googlegroups.com
Are you passing charges and masses to driver with --mc option? You should, if you need to compute a COM

Giovanni

To unsubscribe from this group and stop receiving emails from it, send an email to plumed-users+unsubscribe@googlegroups.com.

To post to this group, send email to plumed...@googlegroups.com.
Visit this group at https://groups.google.com/group/plumed-users.

Gareth Tribello

unread,
Jun 26, 2017, 8:58:45 AM6/26/17
to plumed...@googlegroups.com
Hello

Have you defined the masses used for the post processing by including a PhD file?  If you don’t do this you will get nans.

Also can you please just send one email at a time asking a question.  You have sent two separate emails in the last hour asking questions.  Obviously, an hour is not really long enough for one of us to reply.  Furthermore, it is now not clear if you now want an answer to the first email as you seem to have solved some of the problems you were having.

To be clear you should only really email this list once you have exhausted all other options.  By this I mean that prior to emailing the list you should have:

(1)  Read the relevant sections of the manual multiple times.
(2)  Looked for similar threads in the forum and seen if they give you any clues that help you solve the particular problem.
(3)  Read the relevant articles in the literature.  (many of your questions on reweighting have been discussed in the literature.)

It’s fine to email and ask but please do try everything you can think of prior to doing so.

Gareth    

Giovanni Bussi

unread,
Jun 26, 2017, 9:13:05 AM6/26/17
to plumed...@googlegroups.com
Let me add another comment to what Gareth said.

I don't know if this is the case, but in general when one posts a question and is able to find the answer him/herself before anyone else does it, one is supposed to:
1. Feel guilty because he/she likely asked too fast :-)
2. More importantly, post the solution as a reply to him/herself.

This is really fundamental for us since
1. It avoids others to write answers that are not needed.
2. It provides an extra Q&A for next users searching the mailing list.

Thanks!

Giovanni

To unsubscribe from this group and stop receiving emails from it, send an email to plumed-users+unsubscribe@googlegroups.com.
To post to this group, send email to plumed-users@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "PLUMED users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to plumed-users+unsubscribe@googlegroups.com.

To post to this group, send email to plumed...@googlegroups.com.
Visit this group at https://groups.google.com/group/plumed-users.

Azade yazdan

unread,
Jun 26, 2017, 11:07:06 AM6/26/17
to PLUMED users
Hi, 

Thank you both Giovanni and Gareth...You are both right about the cause of my problem. Providing masses and charges for the driver solved the problem and I was able to post process data obtained by v. 2.2.2 with v. 2.3.2.

Regarding the post that I deleted, I apologize for deleting it. More than finding the answer to the question, I realized that there was a missing word in the manual which confused me all along. Just to clear up everything, here is my earlier (and deleted question) regarding the reweight_metad:

---------------------------------------------------------------------------------------------------------
I have a few question regarding the example that is in the user manual for reweight_metad (v2.3.2; Page 297). The example is:

a: ANGLE ATOMS=1,2,3

x: DISTANCE ATOMS=1,2


METAD ARG=x PACE=100 SIGMA=0.1 HEIGHT=1.5 BIASFACTOR=5 GRID_MIN=0 GRID_MAX=10 GRID_BIN=100 REWEIGHTING_NGRID=100 as: REWEIGHT_METAD TEMP=300


HISTOGRAM ...

      ARG=a

       GRID_MIN=0.0

       GRID_MAX=pi

       GRID_BIN=100

       BANDWIDTH=0.1

       LOGWEIGHTS=bias

       LABEL=hB

... HISTOGRAM


DUMPGRID GRID=hB FILE=histoB STRIDE=1 FMT=%8.4f


1- Should this (reweight_metad) be defined in the metad command (as in the example) or in a separete line? because I don't see such option for the metad command in the manual.

I have been trying to use reweight_metad (in a separete line) but I just keep getting the error:" I cannot understand line: as:REWEIGHT_METAD TEMP=310.0"

2- If we are not using its label in the histogram, why do we define it at the first place? (then I assume it should be defined separately and should have a label?)

3- How reweight_metad is playing its role? when we call this command, does it modify the bias? since I don't see anywhere in the histogram where it used the reweight_bias label?



All the questions were cleared when I found out that:

- the  "as: REWEIGHT_METAD TEMP=300" should be defined in a separate line

- It is "bias: REWEIGHT_METAD TEMP=300" and not "as: ..."; the starting "bi" are missing in the manual.


Now, I was able to understand where we are actually taking the reweight_metad into account when using the histogram.

---------------------------------------------------------------------------------------------------------
I apologize again for any inconvenience I have caused. 


Best,

Azade

Giovanni Bussi

unread,
Jun 26, 2017, 11:13:17 AM6/26/17
to plumed...@googlegroups.com
Thanks, I just fixed the manual.

As we said at the workshop in Trieste, pointing us to typos in the manual is very useful

Giovanni

--
You received this message because you are subscribed to the Google Groups "PLUMED users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to plumed-users+unsubscribe@googlegroups.com.
To post to this group, send email to plumed...@googlegroups.com.
Visit this group at https://groups.google.com/group/plumed-users.

Swapnil Wagle

unread,
Feb 11, 2018, 9:13:40 AM2/11/18
to PLUMED users
Hi Gareth,

The process you decried (using IGNORE_TIME and IGNORE_FORCES) works for reweighting by reading data from COLVAR file. In my WT-MetaDynamics simulation, I have 2 CVs (named 'e2e' and 'dih') and I added the Hills with PACE 1000 and printed the CVs with PACE 100. I ran a 2D WT_MetaDynamics simulation to get reweighted FES with respect to the same two CVs.Now the reweighting part includes the plumed file as followed:
-----------------------------------------------------------------------------------------------------------------
e2e: READ FILE=COLVAR VALUES=e2e IGNORE_TIME IGNORE_FORCES
dih: READ FILE=COLVAR VALUES=dih IGNORE_TIME IGNORE_FORCES

metad: METAD ARG=e2e,dih PACE=1 HEIGHT=0.5 SIGMA=0.05,0.35 FILE=HILLS_REWEIGHTED BIASFACTOR=20.0 TEMP=300 GRID_MIN=0.3,15 GRID_MAX=6.7,39 GRID_BIN=640,140 REWEIGHTING_NGRID=640,140

bias: REWEIGHT_METAD TEMP=300

hB: HISTOGRAM ARG=e2e,dih GRID_MIN=0.3,15 GRID_MAX=6.7,39 GRID_BIN=640,140 LOGWEIGHTS=bias KERNEL=DISCRETE
DUMPGRID GRID=hB FILE=histoB
ff: CONVERT_TO_FES GRID=hB TEMP=300
DUMPGRID GRID=ff FILE=fes_reweighted.dat
-----------------------------------------------------------------------------------------------------------------

The idea of using 'PACE=1' is still not entirely clear to me. If I change the PACE of the METAD action in my post processing calculation (using plumed driver), I get the similar profiles of FES however they all have different energy values (and hence different energy differeces between different minima). I am not sure which value should I use and why: PACE=1 (as you suggested), PACE=10 (COLVAR/HILLS ratio) or PACE=1000 (as per in my WT-MEtaDynamics run). I take trajectory output every 0.5 ns since my system is too big, so it is hard for me to do reweighting based on the trajectory (I guess)!
Some help would be really appreciated.

Best,
Swapnil

My WT-MetaDynamics plumed file looks like this:

-----------------------------------------------------------------------------------------------------------------

e2e: DISTANCE ATOMS=38,387

DIHCOR ...
        ATOMS1=36,38,40,58,58,60,62,77
        ATOMS2=38,40,58,60,60,62,77,79
        ATOMS3=58,60,62,77,77,79,81,87
        ATOMS4=60,62,77,79,79,81,87,89
        ATOMS5=77,79,81,87,87,89,91,97
        ATOMS6=79,81,87,89,89,91,97,99
        ATOMS7=87,89,91,97,97,99,101,116
        ATOMS8=89,91,97,99,99,101,116,118
        ATOMS9=97,99,101,116,116,118,120,138
        ATOMS10=99,101,116,118,118,120,138,140
        ATOMS11=116,118,120,138,138,140,142,153
        ATOMS12=118,120,138,140,140,142,153,155
        ATOMS13=138,140,142,153,153,155,157,175
        ATOMS14=140,142,153,155,155,157,175,177
        ATOMS15=153,155,157,175,175,177,179,194
        ATOMS16=155,157,175,177,177,179,194,196
        ATOMS17=175,177,179,194,194,196,198,204
        ATOMS18=177,179,194,196,196,198,204,206
        ATOMS19=194,196,198,204,204,206,208,214
        ATOMS20=196,198,204,206,206,208,214,216
        ATOMS21=204,206,208,214,214,216,218,233
        ATOMS22=206,208,214,216,216,218,233,235
        ATOMS23=214,216,218,233,233,235,237,255
        ATOMS24=216,218,233,235,235,237,255,257
        ATOMS25=233,235,237,255,255,257,259,270
        ATOMS26=235,237,255,257,257,259,270,272
        ATOMS27=255,257,259,270,270,272,274,292
        ATOMS28=257,259,270,272,272,274,292,294
        ATOMS29=270,272,274,292,292,294,296,311
        ATOMS30=272,274,292,294,294,296,311,313
        ATOMS31=292,294,296,311,311,313,315,321
        ATOMS32=294,296,311,313,313,315,321,323
        ATOMS33=311,313,315,321,321,323,325,331
        ATOMS34=313,315,321,323,323,325,331,333
        ATOMS35=321,323,325,331,331,333,335,350
        ATOMS36=323,325,331,333,333,335,350,352
        ATOMS37=331,333,335,350,350,352,354,372
        ATOMS38=333,335,350,352,352,354,372,374
        ATOMS39=350,352,354,372,372,374,376,387
        ATOMS40=352,354,372,374,374,376,387,389
        LABEL=dih
... DIHCOR

metad: METAD ARG=e2e,dih PACE=1000 HEIGHT=0.5 SIGMA=0.05,0.35 FILE=HILLS BIASFACTOR=20.0 TEMP=300.0
#
#output commands
#
PRINT STRIDE=100 ARG=e2e,dih,metad.bias FILE=COLVAR

-----------------------------------------------------------------------------------------------------------------

Debabrata Pramanik

unread,
Apr 12, 2018, 12:04:43 AM4/12/18
to PLUMED users
Hi
I want to do reweighting to get FES as a function of some variable (without biasing that variable), whereas biasing other CVs in a metadynamics simulation. I am interested in a system having 100 thousand or more number of atoms. I want to save the output trajectory with pace more than 1000 or more steps, whereas depositing hills with pace 500, and saving output COLVAR with 10 steps or less. I want to start reweighting taking output COLVAR/HILLS file from metadynamics simulation. I have gone through the mailing list and tried to figure it out. But didn't get any solution. 
Above, it's been mentioned that if the pace of the output of the CV (want reweighted) and the CV for metadynamics in the colvar file are with the same pace of that depositing Gaussians, then one can write a plumed input like this (for example):

d1: READ FILE=colvar VALUES=d1 IGNORE_FORCES IGNORE_TIME
d2: READ FILE=colvar VALUES=d2 IGNORE_TIME

METAD ARG=d1 PACE=1 HEIGHT=1.2 SIGMA=0.02 BIASFACTOR=10 GRID_MIN=0 GRID_MAX=1 GRID_BIN=200 REWEIGHTING_NGRID=200 

bias: REWEIGHT_METAD TEMP=300

HISTOGRAM …
   ARG=d2
   GRID_MIN=0.0
   GRID_MAX=1.0
   GRID_BIN=200
   LOGWEIGHTS=bias
   LABEL=hB
… HISTOGRAM

fes: CONVERT_TO_FES GRID=hB TEMP=300
DUMPGRID GRID=fes FILE=fes.dat
Then 
plumed driver —noatoms —plumed plumed.dat
The above would be in your plumed.dat file here.


But what happens if the depositing pace of the Gaussians are different compared to the output pace of the reweighted variable and the CV in the COLVAR file?
Is there any way one can do it? It will be really helpful if I get some suggestions. 
Thanks!

regards,
Debabrata

Robert Coffman

unread,
Oct 23, 2023, 2:36:19 PM10/23/23
to PLUMED users
Hello Plumed Users,
Gareth said about reweighting a Metadynamics simulation using histogram analysis: "Now obviously, the above assumes that you output trajectory frames more frequently (or with the same frequency) than you added hills.  If you did not do that then the above will not work."
This is not obvious to me. Can someone please explain?
More to the point. Is there a way to use this analysis if I saved every 10ps in a trajectory but added the bias every 1ps during the Metadynamics run?

Thank you,

Robert

Gareth Tribello

unread,
Oct 23, 2023, 2:50:16 PM10/23/23
to plumed...@googlegroups.com
Hello 

Let's suppose that we ran a metadynamis simulation and output frames every 10 ps.  This means we have a series of Gaussian hills centered at:

s(10), s(20), s(30), s(40) etc....

Where s(t) indicates the value of the CV at time t ps.  So the above is the value of the CV after 10 ps, 20 ps, 30 ps and so on.

Now suppose that we output CVs to the colvar file every 20 ps.  This means we have:

s(20), s(40), s(60) and so on

If we want to recompute the metadynamics we cannot because we haven't stored s(10), s(30) and so on.

This is why I think you should always use a STRIDE for the colvar file that is less than the PACE for METAD.

Although, then again if you store the HILLS file you have all the Gaussians anyway so it is perhaps less of a problem than I indicated it was in my previous email.

I hope this helps
Gareth

Robert Coffman

unread,
Oct 25, 2023, 10:50:18 PM10/25/23
to PLUMED users
I apologize, I could have been more clear.
I saved the HILLS file at the same pace as the COLVAR file (Pace=500 and stride=500). I saved trajectory frames at 10 times less the rate of those (5000 steps/frame). I would now like to calculate a different CV than my original using the reweighted trajectory. I have found that I can run plumed driver using the HILLS file and REWEIGHT_METAD on the trajectory and get an output. However, because I have seen so often that the print stride, the pace and the rate of saving frames should all be the same, I am given doubt about those results. In addition, I do not know the inner workings of plumed.
So my question is: Is it appropriate to save the trajectory at a much slower rate (to save disk space) than the gaussian's are deposited and expect to be able to reweight the trajectory later using plumed?

Thanks,

Robert

Yiwei Wang

unread,
Sep 2, 2024, 11:03:14 PM9/2/24
to PLUMED users
Hi Gareth,

I have the same question as Robert had. I often record the trajectory at a rate of about 20 ps to save disk space since the simulation goes to an order of 10e6 ps, however the Gaussians are added every 1ps as suggested in the tutorial. I also learned from somewhere that the print stride of COLVAR file should be the same as the rate of recording trajectory, in which case the print stride for the COLVAR_REWEIGHT file should be 1. I performed quite a few WT-metadynamics simulations using this scheme and got seemingly reasonable results in histogram, but recently I somehow got unreasonable results, which has led me to reconsider the setup of metadynamics and reweighting.

Looking forward for your advice and thanks in advance.
Yiwei

Gareth Tribello

unread,
Sep 3, 2024, 2:53:18 AM9/3/24
to plumed...@googlegroups.com
Hello

This may be an answer to your question.  It is more of a collection of thoughts, though.  I hope it helps.

(1) Saving the positions of all the atoms as frequently is ideal in terms of being able to reanalyse the trajectory.  If you do this, then you don't lose any data.  You can thus calculate any CV you desire and do many things in the postprocessing stage.

(2) Storing the trajectory frequently is problematic because each trajectory frame contains a lot of data.  Storing all this data will quickly fill up your hard drive.

(3) Having the COLVAR stride be the same as the stride for outputting trajectory frames makes little sense.  The values of a few CVs is much less data than the positions of all the atoms.  Frequently outputting this small amount of data is not going to affect the performance of your simulation or fill your hard drive.  The more data you have the more analysis you can do.

In short, if you are analysing by doing post-processing you want to store as much data as you can.  If you have the data, you can always disregard it.  If you do not have the data then you cannot do anything with it.

I'm not sure if that is at all helpful.  I think it might just be stating the obvious.

Sorry
Gareth

Yiwei Wang

unread,
Sep 3, 2024, 4:37:52 AM9/3/24
to PLUMED users
Hi Gareth,

Thank you very much to your detailed reply! I understand the idea of collecting as much data as possible. 

Regarding the first two points you made, I am a little bit confused about the difference between "saving the positions" and "storing the trajectory", aren't them the same thing? The "rate of recording trajectory" I meant is the "nstxout-compressed" parameter in the mdp file for GROMACS. I kept the COLVAR stride to be the same as this parameter because plumed driver uses the .xtc file for reweighting, and I guess that every data point in the COLVAR file I want to reweight should have a corresponding data point in the xtc file? So for example, if I collect data points at 1, 2, 3 ... (ps) in the COLVAR file and only at 2, 4, 6 ... (ps) in the .xtc file, I think those at 1, 3, 5 ... (ps) will not be reweighted?

Many thanks again,
Yiwei

Gareth Tribello

unread,
Sep 3, 2024, 5:14:32 AM9/3/24
to plumed...@googlegroups.com
Hello

Saving the positions is the same as storing the trajectory yes.

As for the colvar file, my point was that outputting the colvar file with the same stride as you output the xtc file is pointless.   If you have the positions in the xtc file you have the data to calculate the value of the colvars for those points when you do your postprocessing.  You should thus output the colvar file more frequently than the trajectory so that you have more data on the values the colvar took during the simulation than you can get from just analysing the trajectory.

Gareth

Yiwei Wang

unread,
Sep 3, 2024, 5:36:39 AM9/3/24
to PLUMED users
Hi Gareth,

Thanks for your further explanation. Now I well understand your point. I just still have a question about practical reweighting . Concerning the reweighting method introduced in the tutorial, that is, using this command: plumed driver --mf_xtc traj_comp.xtc --plumed plumed_reweight.dat --kt 2.494339, will outputting the COLVAR file more frequently lead to incorrect reweighting results? As I understand from your latest reply, you seemed to indicate other ways of reweighting which seem more complicated.

Thanks,
Yiwei

Gareth Tribello

unread,
Sep 3, 2024, 6:02:33 AM9/3/24
to plumed...@googlegroups.com
No, outputting the colvar file more frequently will not give you wrong results with that command.  That command does whatever actions are defined in the plumed_reweight.dat file to the frames in traj_comp.xtc.  Unless you say to read frames from the COLVAR that was output during the simulation in plumed_reweight.dat you will be fine.

Gareth

Yiwei Wang

unread,
Sep 3, 2024, 6:02:35 AM9/3/24
to PLUMED users
To make an addition. I am inspired by a comment to another post of mine and I quote:"the value of the Stride in plumed file should reflect the same time-step as trajectory file (i.e., if  the coordinate deposition time is 10 ps and HILLs 2 ps, Stride must be 5 to align trajectory to HILLS)". Here the stride is in the plumed.dat file for reweighting. So I suppose if the colvar stride is more frequent than the trajectory, the stride for outputting the reweighted colvar should be changed as the quote said, is that right? As now I set the stride for reweighting to be 1 because the stride for colvar is the same as for trajectory.

Yiwei Wang

unread,
Sep 4, 2024, 3:21:45 AM9/4/24
to PLUMED users
Hi Gareth,

Apologies for chasing up but I am still not very certain after going through the long mailing list of this topic, which may involve different commands for earlier version of plumed. Below I just want to give a practical example of my problem, which may draw a model answer to this sort of question.

Let's say, if I output trajectory every 1000 steps, deposit Gaussians every 50 steps (PACE for METAD in plumed.dat file, 0.02 ps every step), then I should set STRIDE for PRINT in the plumed_reweight.dat file to be 20 (1000/50), is this correct? And the STRIDE for PRINT in plumed.dat file can be any value less than 50, which does not affect the above setting of 20?

Besides, I have noticed that in your earliest reply to this conversation in 2016, you set PACE=1 for METAD in the plumed_reweight.dat file. I guess this is equivalent to the STRIDE for PRINT for recent versions of plumed? As in recent tutorials PACE for METAD is set to be a very large number in the plumed_reweight.dat file.

Many thanks for your time,
Yiwei

Gareth Tribello

unread,
Sep 4, 2024, 6:58:20 AM9/4/24
to plumed...@googlegroups.com
Hello again

To respond to your points.  

Let's say, if I output trajectory every 1000 steps, deposit Gaussians every 50 steps (PACE for METAD in plumed.dat file, 0.02 ps every step), then I should set STRIDE for PRINT in the plumed_reweight.dat file to be 20 (1000/50), is this correct? And the STRIDE for PRINT in plumed.dat file can be any value less than 50, which does not affect the above setting of 20?

If this is the case, then you CANNOT use the reweighting method discussed in the earlier parts of this message.  To use that method, you need to know where all the Gaussians were deposited.  This information is NOT in your trajectory.  You would need to have outputted the trajectory every 50 steps i.e. with the same frequency as was used for the PACE in the metadynamics.  However, all is not lost as you can use the rewieghting method discussed here instead:



Besides, I have noticed that in your earliest reply to this conversation in 2016, you set PACE=1 for METAD in the plumed_reweight.dat file. I guess this is equivalent to the STRIDE for PRINT for recent versions of plumed? As in recent tutorials PACE for METAD is set to be a very large number in the plumed_reweight.dat file.

In those tutorials, PACE is set to a large number because we are using a different method for doing the reweighting.  You can read the details in this paper:


In the tutorials we are not using the method that is discussed in those papers and tutorials.  The method from this thread is discussed was introduced in the following paper:


Good luck
Gareth

Yiwei Wang

unread,
Sep 5, 2024, 5:40:46 AM9/5/24
to PLUMED users
Hi Gareth,

By saying "the reweighting method discussed in the earlier parts of this message", did you mean that uses trajectory file? That, is, is that the method using trajectory file should have the same frequency of outputting trajectory and adding Gaussians? If this is the case, then I may make the problem simpler as I am struggling to figure out a new reweighting method from the links you have shared. Then the problem becomes:

I chose PACE=50 for METAD because in your online masterclass it is said to add Gaussians every 1 ps, while I am simulating coarse-grained systems and the time-step is typically 0.02 ps rather than 0.002 ps for all-atom simulations. So is it still appropriate to add Gaussians every 500 steps, or 10 ps, for coarse-grained systems? If it is, then outputting trajectory every 500 steps is acceptable so that I can still use the reweighting method introduced in your masterclass for metadynamics.

Many thanks again,
Yiwei

Gareth Tribello

unread,
Sep 5, 2024, 7:31:02 AM9/5/24
to plumed...@googlegroups.com
Use the method from the masterclass for reweighting. Also please read the masterclass and the papers. I am not going to reply to any more emails from you. You have all the information you need to reweight your simulations and to understand the method you are using.

G

Reply all
Reply to author
Forward
0 new messages