cli documentation

This commit is contained in:
Daniel Bauer
2018-10-14 13:58:19 +02:00
parent 6d4160cee6
commit 22fa7709bb
3 changed files with 32 additions and 13 deletions

View File

@@ -1,7 +1,7 @@
[package] [package]
name = "wham" name = "wham"
version = "0.1.0" version = "0.1.0"
authors = ["danijoo <danijob88@googlemail.com>"] authors = ["D. Bauer <bauer@bio.tu-darmstadt.de>"]
[dependencies] [dependencies]
clap = {version="2.32.0", features=['yaml']} clap = {version="2.32.0", features=['yaml']}

View File

@@ -1,48 +1,68 @@
name: wham name: wham
version: "0.1.0" version: "0.1.0"
author: D. Bauer <bauer@cbs.tu-darmstadt.de> author: D. Bauer <bauer@bio.tu-darmstadt.de>
about: WHAM analysis about: |
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/timeseries_file1 x_1 x_2 x_N fc_1 fc_2 fc_N
/path/to/timeseries_file2 x_1 x_2 x_N fc_1 fc_2 fc_N
/path/to/timeseries_file3 x_1 x_2 x_N fc_1 fc_2 fc_N
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 x_1 x_2 x_N
time x_1 x_2 x_N
time x_1 x_2 x_N
The first column will be ignored and is followed by N reaction coordinates x.
Shipped under the GPLv3 license.
args: args:
- metadata: - metadata:
short: f short: f
long: file long: file
value_name: METADATA value_name: METADATA
help: Sets the metadata file
takes_value: true takes_value: true
required: true required: true
help: Path to the metadata file.
- min_hist: - min_hist:
long: min long: min
value_name: HIST_MIN value_name: HIST_MIN
takes_value: true takes_value: true
required: true required: true
allow_hyphen_values: true allow_hyphen_values: true
help: Histogram minima (comma separated for multiple dimensions).
- max_hist: - max_hist:
long: max long: max
value_name: HIST_MAX value_name: HIST_MAX
takes_value: true takes_value: true
required: true required: true
allow_hyphen_values: true allow_hyphen_values: true
help: Histogram maxima (comma separated)
- bins: - bins:
short: b short: b
long: bins long: bins
value_name: BINS value_name: BINS
takes_value: true takes_value: true
required: true required: true
help: Number of histogram bins (comma separated).
- tolerance: - tolerance:
short: t short: t
long: tolerance long: tolerance
value_name: TOLERANCE value_name: TOLERANCE
takes_value: true takes_value: true
required: false required: false
help: Abortion criteria for WHAM calculation. WHAM stops if abs(F_new - F_old) < tolerance (defaults to 0.000001).
- iterations: - iterations:
short: i short: i
long: iterations long: iterations
value_name: ITERATIONS value_name: ITERATIONS
takes_value: true takes_value: true
required: false required: false
help: Stop WHAM after this many iterations without convergence (defaults to 100,000).
- cyclic: - cyclic:
long: cyclic long: cyclic
help: For periodic reaction coordinates. If this is set, the first and last coordinate bin will be assumed to be neighbors for the bias calculation. help: 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.
- verbose: - verbose:
short: v short: v
long: verbose long: verbose
@@ -57,7 +77,6 @@ args:
- output: - output:
short: o short: o
long: output long: output
help: Free energy output file (defaults to "wham.out") help: Free energy output file (defaults to wham.out)
takes_value: true takes_value: true
required: false required: false

View File

@@ -21,11 +21,11 @@ fn cli() -> Result<Config, Box<Error>> {
let cyclic: bool = matches.is_present("cyclic"); let cyclic: bool = matches.is_present("cyclic");
let hist_min: Vec<f64> = matches.value_of("min_hist").unwrap() let hist_min: Vec<f64> = matches.value_of("min_hist").unwrap()
.split(':').map(|x| { x.parse().unwrap() }).collect(); .split(',').map(|x| { x.parse().unwrap() }).collect();
let hist_max: Vec<f64> = matches.value_of("max_hist").unwrap() let hist_max: Vec<f64> = matches.value_of("max_hist").unwrap()
.split(':').map(|x| { x.parse().unwrap() }).collect(); .split(',').map(|x| { x.parse().unwrap() }).collect();
let num_bins: Vec<usize> = matches.value_of("bins").unwrap() let num_bins: Vec<usize> = matches.value_of("bins").unwrap()
.split(':').map(|x| { x.parse().unwrap() }).collect(); .split(',').map(|x| { x.parse().unwrap() }).collect();
if num_bins.len() != hist_max.len() || num_bins.len() != hist_max.len() { if num_bins.len() != hist_max.len() || num_bins.len() != hist_max.len() {
eprintln!("Input dimensions do not match (min: {}, max: {}, bins: {})", eprintln!("Input dimensions do not match (min: {}, max: {}, bins: {})",