-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Differences between MBAR and BAR. #393
Comments
Thanks for the detailed report! Could you provide the code and data needed to reproduce the BAR estimates too? One thing we find often leads to this kind of error is incorrect units: BAR and MBAR will necessarily give almost identical output for two states no matter whether the energy units are correct (units of kT) or not, but once there are three states are more, the results will diverge if the energetics aren't self-consistent in the units you provide (which should be units of kT). One quick way to check this is to simply use exponential averaging ( |
Thanks very much for your reply! This is the original Actually I first used alchemistry-analysis to obtain the original TI , BAR , MBAR results. After I found they are inconsistent, I tried to use pymbar directly , and gromacs
|
So, it's rather hard to debug something occurring in alchemical-analysis, since it's in python2, which is not supported anymore. Could you try the same calculating with alchemlyb (https://alchemlyb.readthedocs.io/en/latest/)? And see what you get there? |
Thanks for your reply! ` import pandas as pd from alchemlyb.parsing.gmx import extract_dHdl, extract_u_nk if name == "main":
` |
Thanks! That will make it a lot easier to debug. Could you perhaps upload that as a file (or a .zip, if can't be uploaded to make sure I get the indentation right? It didn't copy over correctly. Also, if you post the command you used. |
OK, I think I have it working now! |
Thanks a lot ! These are the script and data. |
One question about the underlying data - I notice that the mass-dhdl is nonzero. Are the masses changing from state A to state B? If so, is the potential or total energy being printed out to the dhdl? |
The masses don't change from state A to state. In my mdp files, the settings are |
In the topology, are the A and B states different masses? And it is the total or potential energy that is printed out? And if so, do any of the atoms that have masses changing have constraints? The fact that the mass-lamdas are zero eliminates some of the concerns, but I'm just trying to eliminate the possibility there is something weird going on with the underlying GROMACS data. lambda-dependent masses haven't been tested nearly as much in GROMACS. |
In this case, A is benzol and B is oxylene. So there are dummy atoms in A which transform into H atoms in B. There are slight differences between their masses. I didn't set constraints in this case. In dhdl.xvg file, I didn't find potential energy and total energy. But I can find them in log file. Are there some incorrect settings ? |
Ah, OK, the masses are definitely changing. You can check the mdout.mdp - depending on the version, there should be a dhdl-print-energy energy setting that is either total or potential. What does it say? If it would be POSSIBLE to run this calculation again in 1) NVT and 2) with constant masses, that would be helpful for debugging. You can just leave the A masses constant; the free energies should be independent of the masses. It may be something else, but these changes will eliminate some possibilities. |
Did this ever get resolved? |
When performing FEP, I found there are significant differences between MBAR and BAR, as the figure shows.
The system is benzol and oxylene in water (solvated).
When only putting data of two adjacent states into MBAR, MBAR results are the same with BAR.
But putting data of all states, the gap appears.
This is my code
This is original file. The result of MBAR is -3.88 kbT, i.e, -9.61852 kj /mol. But results of BAR and TI are nearly -17 kJ/mol.
u.txt
In my view, MBAR and BAR are both unbiased estimators, and thus the estimation (free energy difference ) should be the same. Could you please give me some instructions ? Thanks !
The text was updated successfully, but these errors were encountered: