reweighting tool - mismatch between number of fields in file and expected number

465 views
Skip to first unread message

Emma Rossi

unread,
Feb 11, 2022, 1:47:25 PM2/11/22
to PLUMED users
Hello everybody,
I am a new user of PLUMED and I would be very grateful if anyone would help me. 

I am experiencing troubles with PLUMED 2.7.3 reweighting postprocessing of a well-tempered metadynamics which I have run with COLVAR package of LAMMPS (so independently from PLUMED).

I ran the simulation with two collective variables and I rearranged the output HILLS file according to PLUMED format. I attach the first lines of the HILLS file just to give you an idea. It includes timestep, CV1, CV2, sigma1, sigma2, Hill height rescaled by the bias factor and bias factor.

 866000.0000000000     0.837953435792816     4.577514258171840                    0.1                    0.1     0.0018359952438337                      15
866001.0000000000     1.353966871263260     3.913243310022730                    0.1                    0.1     0.0004048424903755                      15
866002.0000000000     1.350017624780440     3.992784728129080                    0.1                    0.1     0.0004048240200989                      15
866003.0000000000     1.357628530810080     4.098782872355790                    0.1                    0.1     0.0004394898240608                      15
866004.0000000000     1.335918785412940     4.094592064941380                    0.1                    0.1     0.0004394466837711                      15
866005.0000000000     1.190443037047470     4.248959867999030                    0.1                    0.1     0.0003626215474602                      15
866006.0000000000     0.810513419941171     4.707652190937860                    0.1                    0.1     0.0016444342385551                      15

I would like to reweight on a specific angle which I defined in the plumed input file. I followed the tutorial 
The plumed input file is:

 # Activate MOLINFO functionalities
MOLINFO STRUCTURE=modellino.pdb
a: ANGLE ATOMS=29,33,37
groupO: GROUP ATOMS=30,31,32,34,35,36,38,39,40,41
groupZn: GROUP ATOMS=28
nc: COORDINATION GROUPA=groupO GROUPB=groupZn R_0=0.27
avd: DISTANCE ATOMS=37,28
metad: METAD ARG=nc,avd SIGMA=0.1,0.1 HEIGHT=0.000 BIASFACTOR=15 TEMP=300.0 PACE=100000 FILE=HILLS RESTART=YES 
PRINT ARG=a,metad.bias FILE=COLVAR_REWEIGHT STRIDE=1

I launched PLUMED with the following line:
plumed driver --mf_dcd meta_system_nvt.11.dcd --plumed plumed.dat --kt 0.5922 --length-units A

and I received the following error.
PLUMED:
PLUMED:
PLUMED: +++ PLUMED error
PLUMED: +++ at IFile.cpp:98, function PLMD::IFile& PLMD::IFile::advanceField()
PLUMED: +++ message follows +++
PLUMED: file HILLS: mismatch between number of fields in file and expected number
PLUMED:  this is the faulty line:
PLUMED: 866000.0000000000     0.837953435792816     4.577514258171840                    0.1                    0.1     0.0018359952438337                      15
PLUMED:
PLUMED: ################################################################################
PLUMED:
PLUMED:                                               Cycles        Total      Average      Minimum      Maximum
PLUMED:                                                    1     0.003448     0.003448     0.003448     0.003448
terminate called after throwing an instance of 'PLMD::Plumed::ExceptionError'
  what():  
+++ PLUMED error
+++ at IFile.cpp:98, function PLMD::IFile& PLMD::IFile::advanceField()
+++ message follows +++
file HILLS: mismatch between number of fields in file and expected number
 this is the faulty line:
866000.0000000000     0.837953435792816     4.577514258171840                    0.1                    0.1     0.0018359952438337                      15

I can not understand what is wrong with my HILLS file and I kindly ask you to let me notice any errors.

Thank you in advance for your kind patience and cooperation.
Best regards,
Emma Rossi

Massimiliano Bonomi

unread,
Feb 11, 2022, 1:49:15 PM2/11/22
to plumed...@googlegroups.com
Hi!

Can you show us the first line of the HILLS file starting with #! FIELDS?

Max
> --
> 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 view this discussion on the web visit https://groups.google.com/d/msgid/plumed-users/d69b1942-559d-4119-b1aa-e2bccfb85288n%40googlegroups.com.

Emma Rossi

unread,
Feb 11, 2022, 1:57:06 PM2/11/22
to plumed...@googlegroups.com
Hi Massimiliano,
thank you for your prompt reply.
I didn't know that a first line has to written on the top of HILLS file. So, my HILLS file starts as you can see from my previous message. Would you be so kind as to give a reference/instructions about the #! FIELDS, please?  

Emma 

You received this message because you are subscribed to a topic in the Google Groups "PLUMED users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/plumed-users/RkcRP1Gu25I/unsubscribe.
To unsubscribe from this group and all its topics, send an email to plumed-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/plumed-users/423B8E4D-0AD8-4F35-A8F9-CCA9C5DA374B%40gmail.com.

Massimiliano Bonomi

unread,
Feb 11, 2022, 2:07:53 PM2/11/22
to plumed...@googlegroups.com
Try to have a look at Exercise 1 here:


Max

Sent from my iPhone

On 11 Feb 2022, at 19:57, Emma Rossi <emma.r...@studenti.unipd.it> wrote:



Giacomo Fiorin

unread,
Feb 11, 2022, 3:09:11 PM2/11/22
to plumed...@googlegroups.com
Hello Emma, if you are using a "HILLS" file generated from the .hills.traj file that Colvars produces, check the version you used.

Up until early 2020, that file contained the full width (i.e. 2 sigma) instead of the half-width (i.e. sigma).  However, because that file isn't really used for any other purposes than to feed it to PLUMED's sum_hills, I changed it to be consistent with what one would expect for a "HILLS" file.  This change of convention doesn't affect the simulation, but is meant to simplify exactly the kind of thing you are doing (post-processing with PLUMED).


Also keep in mind that in Colvars the metadynamics bias is nearly always added from the discretized grid, and the discretization is different from PLUMED.  If you rebin consistently, you will get the same PMF as the one that was written out during the LAMMPS simulation, with differences smaller than the sampling error but not within machine precision (14 digits).  If you get a big difference that isn't explained otherwise, please let people know.

Happy 800th anniversary :-)

Giacomo


Emma Rossi

unread,
Feb 12, 2022, 12:23:38 PM2/12/22
to plumed...@googlegroups.com
Dear Max and Giacomo,
thank you for your kind suggestions.

Concerning the width section defined in hills.traj file generated by LAMMPS, I properly divided by 2 in order to get only sigma as requested by PLUMED. :)

I followed the tutorial you linked and I got the PLUMED outputs without any ERROR message. However, l have still a problem. I asked in the plumed.dat input to write angle (unbiased CV) and metad.bias in COLVAR_REWEIGHT output file, but actually the potential looks zero for any value of the angle. It seems strange and I can not figure out. I have attached a zip folder containing the input files along with the output. Have you any ideas about?

I take the opportunity to ask further infos about GRID_MIN, GRID_MAX and GRID_SPACING labels, which should refer to grid settings for the potential. 
Are min and max set according to the limit values that the biased CV can sample (Es: coordination number and average distance in my case GRID_MIN=0.0,0.0 and GRID_MAX=10.0,11.0)? I tried these keywords in the input and also in the HILLS file 
#! SET min_nc 0.0
#! SET max_nc 10.0
#! SET min_avd 0.0
#! SET max_avd 11.0
but I got the following error
ERROR: the system is looking for a value outside the grid along the 0 (nc) index. 

Do you know what is the problem in this case? What are the criteria to follow in setting this keywords?

I sincerely thank you for your patience and support :)

Best regards,
Emma Rossi




reweighting.zip

Massimiliano Bonomi

unread,
Feb 12, 2022, 12:30:48 PM2/12/22
to plumed...@googlegroups.com
Hi,

not sure what are the unit of measure in LAMMPS+COLVAR, but in PLUMED distances are in nanometers by default.
Look here to learn how to change to Ang:

https://www.plumed.org/doc-v2.6/user-doc/html/_u_n_i_t_s.html

Max
> To view this discussion on the web visit https://groups.google.com/d/msgid/plumed-users/CA%2BKefgUBNO%3DG%2B6k%3DOJz7naG6i69g1ZaB7pdMO6nUbnFU9MpTuA%40mail.gmail.com.
> <reweighting.zip>

Giacomo Fiorin

unread,
Feb 12, 2022, 12:46:37 PM2/12/22
to plumed...@googlegroups.com
Colvars uses  the same units as the host code, i.e. with LAMMPS it depends on what LAMMPS itself is using.

Most of the time one has "units real" in the LAMMPS input, meaning Å and kcal/mol in the Colvars quantities as well.

Giacomo

Reply all
Reply to author
Forward
0 new messages