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

Add methods to compute overlap and effective sample sizes for BAR? #427

Closed
jchodera opened this issue Jan 12, 2022 · 4 comments
Closed

Add methods to compute overlap and effective sample sizes for BAR? #427

jchodera opened this issue Jan 12, 2022 · 4 comments
Assignees

Comments

@jchodera
Copy link
Member

@mrshirts : What do you think about adding a corresponding computeOverlap() method for BAR? This could help users identify when the BAR uncertainty estimate will be unreliable.

@mrshirts
Copy link
Collaborator

I shouldn't be too tough, since the right way is, I think, to just run it through MBAR with 2 states and write a wrapper around it.

@jchodera
Copy link
Member Author

jchodera commented Feb 1, 2022

It would also be great to add a method to compute the effective number of samples.

@jchodera jchodera changed the title Add computeOverlap for BAR? Add methods to compute overlap and effective sample sizes for BAR? Feb 1, 2022
@mrshirts
Copy link
Collaborator

mrshirts commented Feb 1, 2022

Again, would just require calling MBAR as well as BAR and adding that information. THOUGH - actually might be a bit harder, since MBAR wants energies, not energy differences. Maybe would take some more playing around.

@jchodera
Copy link
Member Author

jchodera commented Feb 2, 2022

THOUGH - actually might be a bit harder, since MBAR wants energies, not energy differences.

This is not a problem---we did something similar for the MBAR paper with the double optical trap.

We would just form a u_kn matrix where the first N_f values of w_f = u_kn[1,0:N_f] - u_kn[0,0:N_f] and the second N_r values have w_r = u_kn[0,N_f:(N_f+N_r)] - u_kn[1,N_f:(N_f+N_r)]. I think this would be

u_kn = np.zeros([2, N_f + N_r])
u_kn[1,0:N_f] = w_f
u_kn[0,N_f:(N_f+N_r)] = w_r

You can easily check you have it right by computing the free energy difference between the two states 0 and 1 and confirming it reproduces BAR

I may have k and n swapped, but the fact that this is a bit tricky for others to tackle is another reason to wrap the logic in a convenient method within BAR.

@jchodera jchodera self-assigned this Feb 28, 2022
jchodera added a commit that referenced this issue Mar 14, 2022
Fix #427 : Add BAR compute overlap method
mrshirts added a commit that referenced this issue Jun 27, 2022
Add bar_overlap function from 3.0.8, PR #427
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants