pymbar
Python implementation of the multistate Bennett acceptance ratio (MBAR)
Science Score: 59.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
✓DOI references
Found 9 DOI reference(s) in README -
✓Academic publication links
Links to: ncbi.nlm.nih.gov, zenodo.org -
✓Committers with academic emails
6 of 22 committers (27.3%) from academic institutions -
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (13.7%) to scientific vocabulary
Keywords
Keywords from Contributors
Repository
Python implementation of the multistate Bennett acceptance ratio (MBAR)
Basic Info
- Host: GitHub
- Owner: choderalab
- License: mit
- Language: Python
- Default Branch: master
- Homepage: http://pymbar.readthedocs.io
- Size: 28.9 MB
Statistics
- Stars: 268
- Watchers: 24
- Forks: 94
- Open Issues: 133
- Releases: 16
Topics
Metadata Files
README.md
pymbar
Python implementation of the multistate Bennett acceptance ratio (MBAR) method for estimating expectations and free energy differences from equilibrium samples from multiple probability densities. See our docs.
Installation
The easiest way to install the pymbar release is via conda:
bash
conda install -c conda-forge pymbar
which will come with JAX to speed up the code. Or to get the non-JAX accelerated version:
bash
conda install -c conda-forge pymbar-core
You can also install JAX accelerated pymbar from the Python package index
using pip:
bash
pip install pymbar[jax]
or the non-jax-accelerated version with
bash
pip install pymbar
Whether you install the JAX accelerated or non-JAX-accelerated version does not
change any calls or how the code is run. The non-Jax version is smaller on disk due to smaller
dependencies, but may not run as fast.
The development version can be installed directly from github via pip:
```bash
Get the compressed tarball
pip install https://github.com/choderalab/pymbar/archive/master.tar.gz
Or obtain a temporary clone of the repo with git
pip install git+https://github.com/choderalab/pymbar.git ```
Usage
Basic usage involves importing pymbar and constructing an MBAR object from the reduced potential of simulation or experimental data.
Suppose we sample a 1D harmonic oscillator from a few thermodynamic states: ```python
from pymbar import testsystems xn, ukn, Nk, sn = testsystems.HarmonicOscillatorsTestCase().sample() ``
We have thensamplessampled oscillator positionsxn(with samples from all states concatenated), [reduced potentials](http://www.alchemistry.org/wiki/Multistate_Bennett_Acceptance_Ratio#Reduced_potential) in the(nstates,nsamples)matrixukn, number of samples per state in thensamplesarrayNk, and indicessn` denoting which thermodynamic state each sample was drawn from.
To analyze this data, we first initialize the MBAR object:
```python
mbar = MBAR(ukn, Nk) ```
Estimating dimensionless free energy differences between the sampled thermodynamic states and their associated uncertainties (standard errors) simply requires a call to compute_free_energy_differences():
```python
results = mbar.computefreeenergy_differences() ```
Here results is a dictionary with keys Deltaf_ij, dDeltaf, and Theta. Deltaf_ij[i,j] is the matrix of dimensionless free energy differences f_j - f_i, dDeltaf_ij[i,j] is the matrix of standard errors in this matrices estimate, and Theta is a covariance matrix that can be used to propagate error into quantities derived from the free energies.
Expectations and associated uncertainties can easily be estimated for observables A(x) for all states:
```python
Akn = xkn # use position of harmonic oscillator as observable results = mbar.computeexpectations(Akn) ```
where results is a dictionary with keys mu, sigma, and Theta, where mu[i] is the array of the estimate for the average of the observable for in state i, sigma[i] is the estimated standard deviation of the mu estimates, and Theta[i,j] is the covariance matrix of the log weights.
See the docstring help for these individual methods for more information on exact usage; in Python or IPython, you can view the docstrings with help().
JAX needs 64-bit mode
PyMBAR needs 64-bit floats to provide reliable answers. JAX by default uses 32-bit (Single) bitsize. PyMBAR will turn on JAX's 64-bit mode, which may cause issues with some separate uses of JAX in the same code as PyMBAR, such as existing Neural Network (NN) Models for machine learning.
Authors
- Kyle A. Beauchamp kyle.beauchamp@choderalab.org
- John D. Chodera john.chodera@choderalab.org
- Levi N. Naden lnaden@vt.edu
- Michael R. Shirts michael.shirts@colorado.edu
References
- Please cite the original MBAR paper:
Shirts MR and Chodera JD. Statistically optimal analysis of samples from multiple equilibrium states. J. Chem. Phys. 129:124105 (2008). DOI
- Some timeseries algorithms can be found in the following reference:
Chodera JD, Swope WC, Pitera JW, Seok C, and Dill KA. Use of the weighted histogram analysis method for the analysis of simulated and parallel tempering simulations. J. Chem. Theor. Comput. 3(1):26-41 (2007). DOI
- The automatic equilibration detection method provided in
pymbar.timeseries.detectEquilibration()is described here:
Chodera JD. A simple method for automated equilibration detection in molecular simulations. J. Chem. Theor. Comput. 12:1799, 2016. DOI
License
pymbar is free software and is licensed under the MIT license.
Thanks
We would especially like to thank a large number of people for helping us identify issues
and ways to improve pymbar, including Tommy Knotts, David Mobley, Himanshu Paliwal,
Zhiqiang Tan, Patrick Varilly, Todd Gingrich, Aaron Keys, Anna Schneider, Adrian Roitberg,
Nick Schafer, Thomas Speck, Troy van Voorhis, Gupreet Singh, Jason Wagoner, Gabriel Rocklin,
Yannick Spill, Ilya Chorny, Greg Bowman, Vincent Voelz, Peter Kasson, Dave Caplan, Sam Moors,
Carl Rogers, Josua Adelman, Javier Palacios, David Chandler, Andrew Jewett, Stefano Martiniani, and Antonia Mey.
Notes
alchemical-analysis.pydescribed in this publication has been relocated here.
Owner
- Name: Chodera lab // Memorial Sloan Kettering Cancer Center
- Login: choderalab
- Kind: organization
- Email: john.chodera@choderalab.org
- Location: Memorial Sloan-Kettering Cancer Center, Manhattan, NY
- Website: http://choderalab.org
- Repositories: 269
- Profile: https://github.com/choderalab
GitHub Events
Total
- Issues event: 11
- Watch event: 27
- Delete event: 1
- Issue comment event: 41
- Push event: 10
- Pull request review comment event: 4
- Pull request review event: 9
- Pull request event: 8
- Fork event: 4
- Create event: 1
Last Year
- Issues event: 11
- Watch event: 27
- Delete event: 1
- Issue comment event: 41
- Push event: 10
- Pull request review comment event: 4
- Pull request review event: 9
- Pull request event: 8
- Fork event: 4
- Create event: 1
Committers
Last synced: about 1 year ago
Top Committers
| Name | Commits | |
|---|---|---|
| Michael Shirts | m****s@g****m | 288 |
| kyleabeauchamp | k****p@g****m | 184 |
| Levi Naden | l****n@v****u | 126 |
| John Chodera (MSKCC) | c****j@m****g | 85 |
| Jaime RGP | j****e@g****m | 61 |
| Michael Shirts | m****s@v****u | 35 |
| Stefano Martiniani | s****i@g****m | 8 |
| ChayaSt | c****n@c****g | 5 |
| Mike Henry | 1****y | 5 |
| Matthew W. Thompson | m****n@p****m | 4 |
| Jennifer A Clark | j****3@g****m | 3 |
| Josh Fass | j****s@r****m | 2 |
| Richard Gowers | r****s@g****m | 2 |
| Robert McGibbon | r****o@g****m | 2 |
| Tucker Burgin | t****n@u****u | 1 |
| Bradley Dice | b****e@b****m | 1 |
| David Dotson | d****l@g****m | 1 |
| Forrest York | b****a | 1 |
| Iván Pulido | 2****s | 1 |
| Marc Schuh | s****c@s****t | 1 |
| James Barnett | j****4@t****u | 1 |
| Chris | c****4@u****u | 1 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 86
- Total pull requests: 89
- Average time to close issues: 10 months
- Average time to close pull requests: about 1 month
- Total issue authors: 42
- Total pull request authors: 19
- Average comments per issue: 3.03
- Average comments per pull request: 4.84
- Merged pull requests: 61
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 13
- Pull requests: 16
- Average time to close issues: about 13 hours
- Average time to close pull requests: 7 days
- Issue authors: 10
- Pull request authors: 6
- Average comments per issue: 0.54
- Average comments per pull request: 4.25
- Merged pull requests: 9
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- mrshirts (25)
- xiki-tempula (10)
- jaimergp (4)
- Lnaden (4)
- jchodera (2)
- mattwthompson (2)
- jaclark5 (2)
- shawnhsueh (2)
- hannahbaumann (2)
- francoviscarra (1)
- maxentile (1)
- badisa (1)
- mikemhenry (1)
- udlich (1)
- svandenhaute (1)
Pull Request Authors
- mrshirts (25)
- mikemhenry (12)
- Lnaden (10)
- jaimergp (8)
- jaclark5 (7)
- badisa (5)
- mattwthompson (4)
- zhang-ivy (3)
- schuhmc (2)
- nielskm (2)
- IAlibay (2)
- Nithishwer (2)
- shawnhsueh (1)
- jchodera (1)
- rosadche (1)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 2
-
Total downloads:
- pypi 15,577 last-month
- Total docker downloads: 101
-
Total dependent packages: 21
(may contain duplicates) -
Total dependent repositories: 45
(may contain duplicates) - Total versions: 23
- Total maintainers: 2
pypi.org: pymbar
Python implementation of the multistate Bennett acceptance ratio (MBAR) method
- Homepage: http://github.com/choderalab/pymbar
- Documentation: https://pymbar.readthedocs.io/
- License: MIT
-
Latest release: 4.0.3
published almost 2 years ago
Rankings
conda-forge.org: pymbar
- Homepage: http://github.com/choderalab/pymbar
- License: MIT
-
Latest release: 4.0.1
published over 3 years ago
Rankings
Dependencies
- numpy *
- numpydoc *
- pytest *
- scipy *
- sphinxcontrib-bibtex *
- actions/checkout v3 composite
- actions/checkout v1 composite
- codecov/codecov-action v1 composite
- mamba-org/provision-with-micromamba main composite
- jax *
- jaxlib *
- numexpr *
- numpy >=1.12
- scipy *

