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

Allow overriding of n_equilibration_iterations and statistical_inefficiency args for computation of free energy #586

Merged
merged 5 commits into from
Jun 1, 2022

Conversation

zhang-ivy
Copy link
Contributor

@zhang-ivy zhang-ivy commented May 25, 2022

Description

The MultiStateSamplerAnalyzer automatically determines n_equilibration_iterations and statistical inefficiency (g_t) here.

I have discovered that for my barnase:barstar repex simulations, number_equilibrated (aka n_equilibration_iterations) is always 1, which is too small. I'd like to be able to manually feed in n_equilibration_iterations and/or statistical inefficiency before retrieving the free energy.

This PR allows overriding n_equilibration_iterations and statistical_inefficiency in the following way:

# Given a MultiStateReporter, create a MultiStateSamplerAnalyzer
analyzer = MultiStateSamplerAnalyzer(reporter, max_n_iterations=3000, n_equilibration_iterations=2001, statistical_inefficiency=10)

# Compute free energy
f_ij, df_ij = analyzer.get_free_energy()

Note that the changes in this PR only affect the determination of the decorrelated samples (which are inputed to MBAR to compute the free energy). It does not effect functions like read_energies() or generate_mixing_statistics()

Replaces #585

Todos

  • Implement feature / fix bug
  • Add tests
  • Update documentation as needed
  • Update changelogNotable points that this PR has either accomplished or will accomplish.

Status

  • Ready to go

@zhang-ivy zhang-ivy requested review from ijpulidos and mikemhenry May 25, 2022 19:24
Copy link
Contributor

@ijpulidos ijpulidos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks! Just some comments that I believe should be addressed.

openmmtools/multistate/multistateanalyzer.py Show resolved Hide resolved
@zhang-ivy
Copy link
Contributor Author

@ijpulidos : I've updated the docstring to clarify the paper / equations that the variable names come from. Should be ready for another review!

Copy link
Contributor

@ijpulidos ijpulidos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks!

@ijpulidos ijpulidos enabled auto-merge (squash) June 1, 2022 22:19
@ijpulidos ijpulidos added this to the 0.21.4 milestone Jun 1, 2022
@ijpulidos ijpulidos merged commit bd93fd1 into main Jun 1, 2022
@ijpulidos ijpulidos deleted the override-t0-gt-v2 branch June 1, 2022 22:53
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

Successfully merging this pull request may close these issues.

2 participants