Skip to content
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

[Feature Request] BAR style calculation #54

Open
akalpokas opened this issue Aug 30, 2024 · 1 comment
Open

[Feature Request] BAR style calculation #54

akalpokas opened this issue Aug 30, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@akalpokas
Copy link
Contributor

akalpokas commented Aug 30, 2024

Given the high impact of updateParametersInContext() code on the performance of FEP calculations with SOMD2 (benchmark openmm/openmm#4610) it would be a very useful feature to allow the user to calculate energy differences to a restricted number of λ-windows, for example only neighbouring ones, thus enabling a "BAR style" calculation. Even with currently proposed OpenMM optimizations, going from a 3 λ-window to a 99 λ-window calculation using RF and 1ps of sampling frequency results with a performance drop from ~900ns/day to ~220ns/day. For PME the performance drop is from ~287ns/day to ~125ns/day.

With a BAR style of a calculation, we could do a calculation involving 99 λ-windows at the computational cost of only 3 (MBAR is meant to be more accurate, although I do believe that in vast majority of cases this is negligible, while the performance gain here is substantial). This would help in use cases where higher number of λ-windows are consistently needed, for example ABFE or ring-breaking FEP. The way GROMACS implements this is by using a calc-lambda-neighbors parameter which controls how many neighbouring λ-windows the energy sampling calculation will be carried out with, with 1 meaning the only the adjacent windows, and -1 meaning every window. I don't think this is too hard to implement in SOMD2, although it will probably involve additional modifications to BioSimSpace.FreeEnergy.Relative.analyse code to support BAR type energy output files (alchemlyb has a BAR estimator, although it cannot produce overlap matrices, like the MBAR one).

@jmichel80
Copy link
Contributor

pymbar has a BAR estimator and can do overlap analyses https://pymbar.readthedocs.io/en/master/

could there be precision benefits in computing perturbed energies for 5-9 neighbouring windows ? The MBAR theory allows variable number of samples per thermodynamic state so it may be possible to padd square matrices and fake a full MBAR analysis.

@lohedges lohedges added the enhancement New feature or request label Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants