https://github.com/dnlbauer/WHAM

An efficient, multithreaded weighted histogram analysis (WHAM) implementation for the post-processing of umbrella MD simulations.

https://github.com/dnlbauer/WHAM

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 5 DOI reference(s) in README
  • Academic publication links
    Links to: zenodo.org
  • Committers with academic emails
    1 of 6 committers (16.7%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (13.1%) to scientific vocabulary

Keywords from Contributors

interactive projection archival sequences observability autograding hacking shellcodes modular network-simulation
Last synced: 7 months ago · JSON representation

Repository

An efficient, multithreaded weighted histogram analysis (WHAM) implementation for the post-processing of umbrella MD simulations.

Basic Info
  • Host: GitHub
  • Owner: dnlbauer
  • License: gpl-3.0
  • Language: Rust
  • Default Branch: main
  • Homepage:
  • Size: 108 MB
Statistics
  • Stars: 27
  • Watchers: 3
  • Forks: 5
  • Open Issues: 4
  • Releases: 0
Created over 7 years ago · Last pushed about 2 years ago
Metadata Files
Readme License

README.md

Build Status crates.io DOI

Weighted Histogram Analysis Method (WHAM)

This is an fast implementation of the weighted histogram analysis method written in Rust. It allows the calculation of multidimensional free energy profiles from umbrella sampling simulations. For more details on the method, I suggest Roux, B. (1995). The calculation of the potential of mean force using computer simulations, CPC, 91(1), 275-282.

Features

  • Fast, especially for small systems
  • Multithreaded (automatically runs on all available cores)
  • Multidimensional (any number of collective variables are possible)
  • Autocorrelation to remove correlated samples
  • Error analysis via bootstrapping
  • Unit tested

Installation

Installation from source via cargo: ```bash

cargo installation

curl -sSf https://static.rust-lang.org/rustup.sh | sh

cargo install wham ```

Usage

wham has a convenient command line interface. You can see all options with wham -h:

``` wham 1.1.0 D. Bauer bauer@cbs.tu-darmstadt.de wham is a fast implementation of the weighted histogram analysis method (WHAM) written in Rust. It currently supports potential of mean force (PMF) calculations in multiple dimensions at constant temperature.

Metadata file format: /path/to/timeseriesfile1 x1 x2 xN fc1 fc2 fcN /path/to/timeseriesfile2 x1 x2 xN fc1 fc2 fcN /path/to/timeseriesfile3 x1 x2 xN fc1 fc2 fcN The first column is a path to a timeseries file _relative to the metadata file (see below). This is followed by the position of the umbrella potential x in N dimensions and the force constant fc in each dimension. Lines starting with a

are treated as comments and will not be parsed.

Timeseries file format: time x1 x2 xN time x1 x2 xN time x1 x2 x_N The first column will be ignored and is followed by N reaction coordinates x.

Shipped under the GPLv3 license.

USAGE: wham [FLAGS] [OPTIONS] --bins --max --file --min --temperature

FLAGS: -c, --cyclic For periodic reaction coordinates. If this is set, the first and last coordinate bin in each dimension are treated as neighbors for the bias calculation. -h, --help Prints help information -g, --uncorr Estimates statistical inefficiency of each timeseries via autocorrelation and removes correlated samples (default is off). -V, --version Prints version information -v, --verbose Enables verbose output.

OPTIONS: -b, --bins Number of histogram bins (comma separated). --bt Number of bayesian bootstrapping runs for error analysis by assigning random weights (defaults to 0). --seed Random seed for bootstrapping runs. --convdt Performs WHAM for slices with the given delta in time and returns an output file for each slice. THis is useful to check the result for convergence. Example: with --convdt 100 and a timeseries ranging from 0-300, free energy surfaces for slices 0-100, 0-200 and 0-300 will be given returned. --end Skip rows in timeseries with an index larger than this value (defaults to 1e+20) -i, --iterations Stop WHAM after this many iterations without convergence (defaults to 100,000). --max Histogram maxima (comma separated). Also accepts "pi". -f, --file Path to the metadata file. --min Histogram minima (comma separated for multiple dimensions). Also accepts "pi". -o, --output Free energy output file (defaults to wham.out). --start Skip rows in timeseries with an index smaller than this value (defaults to 0) -T, --temperature WHAM temperature in Kelvin. -t, --tolerance Abortion criteria for WHAM calculation. WHAM stops if abs(Fnew - Fold) < tolerance (defaults to 0.000001). ```

Examples

The example folder contains input and output files for two simple test systems:

  • 1d_cyclic: Phi torsion angle of dialanine in vaccum
  • 2d_cyclic: Phi and psi torsion angles of the same system

The command below will run the two dimensional example (simulation of dialanine phi and psi angle) and calculate the free energy based on the two collective variables in the range of -3.14 to 3.14, with 100 bins in each dimension and periodic collective variables:

```bash wham --max 3.14,3.14 --min -3.14,-3.14 -T 300 --bins 100,100 --cyclic -f example/2d/metadata.dat

Supplied WHAM options: Metadata=example/2d/metadata.dat, histmin=[-3.14, -3.14], histmax=[3.14, 3.14], bins=[100, 100] verbose=false, tolerance=0.000001, iterations=100000, temperature=300, cyclic=true Reading input files. 625 windows, 624262 datapoints Iteration 10: dF=0.389367172324539 Iteration 20: dF=0.21450559607810152 (...) Iteration 620: dF=0.0000005800554892309461 Iteration 630: dF=0.00000047424278621817084 Finished. Dumping final PMF (... pmf dump ...)

``` After convergence, final bias offsets (F) and the free energy will be dumped to stdout and the output file is written.

The output file contains the free energy and probability for each bin. Probabilities are normalized to sum to P=1.0 and the smallest free energy is set to 0 (with other free energies based on that). ```

coord1 coord2 Free Energy +/- Probability +/-

-3.108600 -3.108600 10.331716 0.000000 0.000095 0.000000 -3.045800 -3.108600 8.893231 0.000000 0.000170 0.000000 -2.983000 -3.108600 7.372765 0.000000 0.000312 0.000000 -2.920200 -3.108600 6.207354 0.000000 0.000498 0.000000 -2.857400 -3.108600 4.915298 0.000000 0.000836 0.000000 -2.794600 -3.108600 3.644738 0.000000 0.001392 0.000000 -2.731800 -3.108600 3.021743 0.000000 0.001787 0.000000 -2.669000 -3.108600 2.827463 0.000000 0.001932 0.000000 -2.606200 -3.108600 2.647531 0.000000 0.002076 0.000000 (...) ```

Error analysis

WHAM can perform error analysis using the bayesian bootstrapping method. Every simulation window is assumed to be an individual set of data points. By calculating probabilities N times with randomly assigned weights for each window, one can estimate the error as standard deviation between the N bootstrapping runs. For more details see Van der Spoel, D. et al. (2010). g_wham—A Free Weighted Histogram Analysis Implementation Including Robust Error and Autocorrelation Estimates, JCTC, 6(12), 3713-3720.

To perform bayesian bootstrapping in WHAM, use the -bt <RUNS> flag to perform individual bootstrapping runs. The error estimates of bin probabilities and free energy will be given as standard error (SE) in a separate column (+/-) in the output file. If no error analysis is performed, these columns are set to 0.0.

Autocorrelation analysis

With the --uncorr flag, WHAM calculates the autocorrelation time tau for all timeseries and all collective variables. Timeseries are then filtered based on their highest autocorrelation time to remove correlated samples from the dataset. This reduces the number of data points but can improve the accuracy of the result.

For filtering, the statistical inefficiency g is calculated: g = 1 + 2*tau, and only every gth element of the timeseries is used for unbiasing. A more detailed description of the method can be found in Chodera, J.D. et al. (2007). Use of the weighted histogram analysis method for the analysis of simulated and parallel tempering simulations, JCTC 3(1):26-41

License & Citing

WHAM is licensed under the GPL-3.0 license. Please read the LICENSE file in this repository for more information.

There's no publication for this WHAM implementation. However, there is a citeabe DOI. If you use this software for your work, please consider citing it: Bauer, D., WHAM - An efficient weighted histogram analysis implementation written in Rust, Zenodo. https://doi.org/10.5281/zenodo.1488597

Parts of this work, especially some perfomance optimizations and the I/O format, are inspired by the implementation of A. Grossfield (Grossfield, A, WHAM: the weighted histogram analysis method, http://membrane.urmc.rochester.edu/content/wham).

Owner

  • Name: Daniel Bauer
  • Login: dnlbauer
  • Kind: user
  • Location: Rhine-Main Area
  • Company: Senckenberg Society for Nature Research

🧬 Comp. Biologist | 💻 Data Science and Software Engineering | ⌨️ Keyboard Enthusiast

GitHub Events

Total
  • Issues event: 1
  • Watch event: 2
  • Issue comment event: 4
  • Fork event: 1
Last Year
  • Issues event: 1
  • Watch event: 2
  • Issue comment event: 4
  • Fork event: 1

Committers

Last synced: 9 months ago

All Time
  • Total Commits: 168
  • Total Committers: 6
  • Avg Commits per committer: 28.0
  • Development Distribution Score (DDS): 0.238
Past Year
  • Commits: 0
  • Committers: 0
  • Avg Commits per committer: 0.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Daniel Bauer b****r@c****e 128
Daniel Bauer d****o 23
Daniel Bauer b****r@t****s 7
Daniel Bauer 4****r 5
dependabot[bot] 4****] 3
danijoo d****o@h****t 2
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 8 months ago

All Time
  • Total issues: 7
  • Total pull requests: 10
  • Average time to close issues: 3 months
  • Average time to close pull requests: 5 days
  • Total issue authors: 6
  • Total pull request authors: 2
  • Average comments per issue: 3.29
  • Average comments per pull request: 0.2
  • Merged pull requests: 8
  • Bot issues: 0
  • Bot pull requests: 5
Past Year
  • Issues: 2
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 2
  • Pull request authors: 0
  • Average comments per issue: 3.5
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • interactyuvraj (2)
  • SoumyaCYZ (1)
  • Rulong-Ma (1)
  • burunduk57 (1)
  • Cynthia0807-learn (1)
  • tgmaxson (1)
Pull Request Authors
  • dependabot[bot] (8)
  • dnlbauer (4)
Top Labels
Issue Labels
wontfix (1)
Pull Request Labels
dependencies (8)

Dependencies

Cargo.lock cargo
  • addr2line 0.13.0
  • adler 0.2.3
  • ansi_term 0.11.0
  • assert_approx_eq 1.1.0
  • atty 0.2.14
  • autocfg 1.0.1
  • backtrace 0.3.53
  • bitflags 1.2.1
  • cfg-if 0.1.10
  • cfg-if 1.0.0
  • clap 2.33.3
  • const_fn 0.4.2
  • crossbeam-channel 0.5.0
  • crossbeam-deque 0.8.0
  • crossbeam-epoch 0.9.0
  • crossbeam-utils 0.8.0
  • either 1.6.1
  • error-chain 0.12.4
  • getrandom 0.1.15
  • gimli 0.22.0
  • hermit-abi 0.1.17
  • lazy_static 1.4.0
  • libc 0.2.80
  • memoffset 0.5.6
  • miniz_oxide 0.4.3
  • num_cpus 1.13.0
  • object 0.21.1
  • ppv-lite86 0.2.9
  • rand 0.7.3
  • rand_chacha 0.2.2
  • rand_core 0.5.1
  • rand_hc 0.2.0
  • rayon 1.5.0
  • rayon-core 1.9.0
  • rustc-demangle 0.1.18
  • scopeguard 1.1.0
  • strsim 0.8.0
  • textwrap 0.11.0
  • unicode-width 0.1.8
  • vec_map 0.8.2
  • version_check 0.9.2
  • wasi 0.9.0+wasi-snapshot-preview1
  • winapi 0.3.9
  • winapi-i686-pc-windows-gnu 0.4.0
  • winapi-x86_64-pc-windows-gnu 0.4.0
  • yaml-rust 0.3.5
Cargo.toml cargo
  • assert_approx_eq 1.1.0 development
  • clap 2.32.0
  • error-chain 0.12.0
  • rand 0.7.*
  • rayon 1.0.3
.github/workflows/build.yml actions
  • actions-rs/toolchain v1 composite
  • actions/checkout v3 composite
  • katyo/publish-crates v2 composite