-
Notifications
You must be signed in to change notification settings - Fork 51
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
NAMD parser does not take temperature as argument #75
Comments
I assume for right now that NAMD writes out energies in kcal/mol, based on NAMD 2.13: NAMD configuration parameters : Output Files
@vtlim @mrshirts can you confirm that the energies in NAMD FEP files are in kcal/mol (in particular our test files in the tyr2ala dataset)? |
- Gromacs - Amber - NAMD - see also alchemistry/alchemlyb#75
The energies in the NAMD FEP output files are in kcal/mol. The output file also includes a column for temperature for the present configuration. Could that lead to a difference causing the assertion error? |
Thanks for confirming. Currently, the temperature from the output file is not used, is it? I don't think that it would be correct to use the instantaneous temperature for kT – the Boltzmann factor comes from a Lagrange multiplier for system at constant T (i.e., constant average temperature) so this T should be the "target temperature" of the thermostat in the simulation. But maybe @mrshirts @davidlmobley want to correct me here. |
Correct kT is using the target temperature.
Instantaneous "temperature" is a quantity that averages to the target
temperature over a long enough time (or should if things are working
correctly!), but the instantaneous value is not really relevant to
anything.
…On Mon, Apr 15, 2019 at 12:44 PM Oliver Beckstein ***@***.***> wrote:
Thanks for confirming.
Currently, the temperature from the output file is not used, is it?
I don't think that it would be correct to use the instantaneous
temperature for kT – the Boltzmann factor comes from a Lagrange multiplier
for system at constant T (i.e., constant average temperature) so this T
should be the "target temperature" of the thermostat in the simulation. But
maybe @mrshirts <https://github.com/mrshirts> @davidlmobley
<https://github.com/davidlmobley> want to correct me here.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#75 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABATPVD23G3ABOVVML2HFFTPQTEITANCNFSM4HF3C6EQ>
.
|
Agreed, yes, that we don't want to use the instantaneous temperature. But we do want to allow people to use the correct temperature in their analysis. |
@orbeckst I'm trying to understand where the error is coming from. In the Travis message there are the lines:
where 10.117 is approximately the input value for the test from 6.031 kcal/mol, so is this message saying that the internal test is returning about 11 kT? |
EDIT: short answer to your question: yes @vtlim when you look at alchemlyb/src/alchemlyb/tests/test_fep_estimators.py Lines 137 to 149 in f095296
alchemlyb/src/alchemlyb/tests/test_fep_estimators.py Lines 98 to 103 in f095296
The only real change that I made to alchemlyb/src/alchemlyb/parsing/namd.py Line 54 in f095296
|
I think the difference might be BAR should take in reduced energies but the previous answer I provided to the test had the energies in kcal/mol. |
In principle, all we are doing here is attaching different units. I haven't looked at the BAR code itself but the equations should not really care if you were to set "1 kT = 1 kcal/mol". From the Amber parser and the MBAR case I know that all that happened was a change of units on the end result. |
Might that affect the weighting factors of the BAR algorithm? |
Did your run your data through |
@orbeckst I can try EDIT: I read the earlier message too quickly before responding but just to clarify I have not used alchemical-analysis on my data -- I don't think it supports NAMD. I was using a standalone code modified from a labmate. |
Thanks. How should we continue here? |
I'm not sure the best approach to move forward at the moment. I tested a few different versions on the NAMD tutorial files and saw a range of outputs.
|
Is alc-no reduce the current alchemlyb NAMD parser that does not return reduced energies whereas alc-reduce kT is the one from PR #76? Is parseFEP the other code? EDIT: If my interpretation is correct and results from PR #76 are inconsistent with both the tutorial value and another code then it suggests that there's something wrong with PR #76. (I'd still liked to know if there's anything in BAR that would be problematic when the units change.) EDIT 2: tut03_tyr2ala (hydrated) is a strange case: it seems to be the only one for which alc-no reduce disagrees substantially from the tutorial value but agrees with parseFEP. @vtlim do you know what BAR code the tutorial and |
Yes.
That result was strange to me as well, since the tutorial file says that the data is parsed and analyzed by the ParseFEP in plugin in VMD. |
For a start someone has to go through the BAR equations and figure out what happens when one changes the units. |
The BAR and MBAR operate on dimensionless quantities: kT must be in the same units as the energies. Otherwise beta*U becomes something different. . . If BOTH the energies and kT change units, then everything is valid, except of course the free energies will be in those different units. Currently the software modules assume you are passing in the beta*U quantities (already nondimensionalized). So you multiply the results by whatever kT you divided the energies by before you passed them into BAR. |
- Gromacs - Amber - NAMD - see also alchemistry/alchemlyb#75
I had a look again and once I converted the new NAMD kT parser values in the table in #75 (comment) to kcal/mol, there's general agreement
The exception is still the tutorial value for tut03_tyr2ala (hydrated) of 11.7 kcal/mol but the independent in-house parser + VMD parseFEP also gives 6.8368 kcal/mol so I am inclined to trust the alchemical analysis value. When I run the test ( With the new reference value the tests should pass. The table was generated from #75 (comment) with the following code: import pandas as pd
df = pd.DataFrame({'source': ['tut02_sphere', 'tut03_tyr2ala (hydrated)', 'tut03_tyr2ala (isolated)', 'tut04_crown (bound)', 'tut04_crown (free)'], 'tutorial': [-77.6, +11.7, +4.0, +61.5, +54.1], 'alc-no reduce': [-77.1184, 7.1821 , 3.1243, 57.6449 , 53.4546], 'alc-reduce kT (300K)': [-129.4463, 12.4539, 5.2648, 97.1911, 89.9684], 'parseFEP': [-77.4451, 6.8368, 3.9506, 57.9465, 53.4001]})
kB = 1.9872041e-3
kT = kB * 300
df2 = df.assign(**{"alc-reduce kcal/mol (300K)": lambda x: kT*x["alc-reduce kT (300K)"]})
df2 |
- changed the test reference value to the value produced by the NAMD parser + BAR (alchemlyb) implementation - see #75 (comment) for discussion and background - close #75
- changed the test reference value to the value produced by the NAMD parser + BAR (alchemlyb) implementation - see #75 (comment) for discussion and background - close #75
- changed the test reference value to the value produced by the NAMD parser + BAR (alchemlyb) implementation - see #75 (comment) for discussion and background - close #75
The NAMD parser #7 (for FEP) does not take
T
as an argument and does not returnu_nk
in proper units of kT.The text was updated successfully, but these errors were encountered: