27 Commits
v1.0.0 ... main

Author SHA1 Message Date
dependabot[bot]
a366d89713 Bump rayon from 1.8.0 to 1.8.1 (#13)
Bumps [rayon](https://github.com/rayon-rs/rayon) from 1.8.0 to 1.8.1.
- [Changelog](https://github.com/rayon-rs/rayon/blob/master/RELEASES.md)
- [Commits](https://github.com/rayon-rs/rayon/compare/rayon-core-v1.8.0...rayon-core-v1.8.1)

---
updated-dependencies:
- dependency-name: rayon
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-17 20:31:17 +01:00
Daniel Bauer
545c0ecbd3 bump version (#7) 2023-10-27 08:02:27 +02:00
dependabot[bot]
23548dadfb Bump rand from 0.7.3 to 0.8.5 (#8) 2023-10-27 06:00:48 +00:00
dependabot[bot]
6f0a00ace9 Bump clap from 2.34.0 to 3.2.25 (#9)
Bumps [clap](https://github.com/clap-rs/clap) from 2.34.0 to 3.2.25.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/v3.2.25/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/v2.34.0...v3.2.25)

---
updated-dependencies:
- dependency-name: clap
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-27 07:43:40 +02:00
Daniel Bauer
0c4e015aa5 dependabot (#6) 2023-10-27 07:39:46 +02:00
daniel
9392a3365c remove unneccessary format in assert 2023-10-27 07:37:06 +02:00
daniel
3532d474ed update dependencies 2023-10-27 07:29:39 +02:00
Daniel Bauer
f8ca61d5d0 git actions (#5)
* add build action

* publish job
2023-10-27 07:25:38 +02:00
Daniel Bauer
b143f7a65a unignore slow tests 2021-07-22 17:36:04 +02:00
Daniel Bauer
6f35f15e46 faster tests (2) 2021-07-22 16:34:43 +02:00
Daniel Bauer
b6881a6db1 code formatting 2021-07-22 15:48:14 +02:00
Daniel Bauer
ec7024a285 Squashed commit of the following:
commit 07e5a0a1a5cef7b99ac8602fa39226ddce175b67
Author: Daniel Bauer <bauer@cbs.tu-darmstadt.de>
Date:   Thu Jul 22 12:48:35 2021 +0200

    version up

commit 4c58f5a42c091a480473809f8fdb5c4f361b8883
Author: Daniel Bauer <bauer@cbs.tu-darmstadt.de>
Date:   Thu Jul 22 12:22:01 2021 +0200

    test convdt needs start/end

commit fad1c0c4fca3cffe91db32c7e4d91139a6513a9f
Author: Daniel Bauer <bauer@cbs.tu-darmstadt.de>
Date:   Thu Jul 22 12:14:21 2021 +0200

    unit test for empty timeseries

commit cdf520aad6e70ea22d96363d28c1110d3d5bc3e0
Author: Daniel Bauer <bauer@cbs.tu-darmstadt.de>
Date:   Thu Jul 22 11:51:12 2021 +0200

    refractored convdt slices; fix issue with incomplete convdt slices

commit 5b33d9cb61b59ead4a22f03ae3981175feb25770
Author: Daniel Bauer <bauer@cbs.tu-darmstadt.de>
Date:   Thu Jul 22 10:37:13 2021 +0200

    test dataset for convdt

commit 023bba0a0d46929b3ea4c2ede075b851deb7b779
Author: Daniel Bauer <bauer@cbs.tu-darmstadt.de>
Date:   Thu Jul 22 10:36:45 2021 +0200

    force --start and --end with --convdt
2021-07-22 12:52:50 +02:00
Daniel Bauer
b6f338058a faster tests 2021-07-21 23:25:10 +02:00
Daniel Bauer
e0d2c1375a test convdt 2021-07-21 23:10:09 +02:00
Daniel Bauer
8802979a8e delete test files 2021-07-21 22:43:32 +02:00
Daniel Bauer
2d32d795f5 fix unit tests 2021-07-21 22:43:25 +02:00
Daniel Bauer
35ca1b1317 version up 2021-07-21 16:47:32 +02:00
Daniel Bauer
d9a219a36a better verbose output during dataset generation and flag to ignore empty histograms 2021-07-21 16:45:58 +02:00
Daniel Bauer
2c565dee28 remove some debug statements 2021-07-19 08:32:57 +02:00
Daniel Bauer
c05becea22 version up 2021-07-17 14:44:09 +02:00
Daniel Bauer
c27dbb7ab5 test g=1 for correlation 2021-07-17 14:42:21 +02:00
Daniel Bauer
c9e18ebda9 Squashed commit of the following:
commit eaebf0dcbb259decbc0d8f5bbffa62244303f6c7
Author: Daniel Bauer <bauer@cbs.tu-darmstadt.de>
Date:   Sat Jul 17 14:12:30 2021 +0200

    error for empty timeseries

commit 1fe5383c5079ca6c0ad102d4e2cb32d5b1227e80
Author: Daniel Bauer <bauer@cbs.tu-darmstadt.de>
Date:   Sat Jul 17 14:09:13 2021 +0200

    refractored convdt slices calculation

commit 0b1fb7fb6a72edc50b013b59623551b2ccab6913
Author: Daniel Bauer <bauer@cbs.tu-darmstadt.de>
Date:   Sat Jul 17 13:27:59 2021 +0200

    fix histogram building without convdt

commit f9882ca4cece57451cd2971d0993a2d3621b0cdf
Author: Daniel Bauer <bauer@cbs.tu-darmstadt.de>
Date:   Sat Jul 17 12:53:06 2021 +0200

    fix tests not compiling

commit e6550e20bde3824f8199432b08777be41fc79fa8
Author: Daniel Bauer <bauer@cbs.tu-darmstadt.de>
Date:   Sat Jul 17 12:43:36 2021 +0200

    refractoring

commit 18c77a9b6694d491ef23cebb3918ccda8fcc44a5
Author: Daniel Bauer <bauer@cbs.tu-darmstadt.de>
Date:   Fri Jul 16 08:16:34 2021 +0200

    run and output for multiple datasets

commit 069f318f72207c416387007435eeff9867494e7a
Author: Daniel Bauer <bauer@cbs.tu-darmstadt.de>
Date:   Fri Jul 16 07:58:01 2021 +0200

    cleanup io.rs

commit 10efa428a0c6bf490c9f2d7a4c1df185de402a11
Author: Daniel Bauer <bauer@cbs.tu-darmstadt.de>
Date:   Thu Jul 15 19:27:22 2021 +0200

    parse multiple datasets with convdt
2021-07-17 14:14:25 +02:00
Daniel Bauer
0b5d0ebecd test time boundaries 2021-07-17 13:31:36 +02:00
Daniel Bauer
091b1f1382 TODO 2021-07-17 13:04:42 +02:00
Daniel Bauer
9849c00321 cargo ignore examples 2021-07-17 11:30:42 +02:00
daniel
034586d08e inlined autocorrelation calculation for better performance 2020-10-26 11:24:48 +01:00
Daniel Bauer
cc4448f1d8 Update README.md 2020-10-26 10:53:57 +01:00
26 changed files with 5683 additions and 740 deletions

7
.github/dependabot.yml vendored Normal file
View File

@@ -0,0 +1,7 @@
version: 2
updates:
- package-ecosystem: "cargo"
directory: "/"
schedule:
interval: "monthly"
rebase-strategy: "disabled"

45
.github/workflows/build.yml vendored Normal file
View File

@@ -0,0 +1,45 @@
name: Cargo Build and Test
on:
push:
branches: [ "main" ]
pull_request:
concurrency:
group: ${{ github.head_ref || github.run_id }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
jobs:
build_and_test:
name: WHAM Test
runs-on: ubuntu-latest
strategy:
matrix:
toolchain:
- stable
- beta
- nightly
steps:
- uses: actions/checkout@v3
- run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }}
- run: cargo build --verbose
- run: cargo test --verbose
publish:
name: WHAM Publish
runs-on: ubuntu-latest
needs: [build_and_test]
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- uses: katyo/publish-crates@v2
with:
registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }}
ignore-unpublished-changes: true
dry-run: ${{ github.event_name != 'push' }}

272
Cargo.lock generated
View File

@@ -1,28 +1,21 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 3
[[package]]
name = "addr2line"
version = "0.13.0"
version = "0.21.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1b6a2d3371669ab3ca9797670853d61402b03d0b4b9ebf33d677dfa720203072"
checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb"
dependencies = [
"gimli",
]
[[package]]
name = "adler"
version = "0.2.3"
version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ee2a4ec343196209d6594e19543ae87a39f96d5534d7174822a3ad825dd6ed7e"
[[package]]
name = "ansi_term"
version = "0.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b"
dependencies = [
"winapi",
]
checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe"
[[package]]
name = "assert_approx_eq"
@@ -43,18 +36,19 @@ dependencies = [
[[package]]
name = "autocfg"
version = "1.0.1"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a"
checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa"
[[package]]
name = "backtrace"
version = "0.3.53"
version = "0.3.69"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "707b586e0e2f247cbde68cdd2c3ce69ea7b7be43e1c5b426e37c9319c4b9838e"
checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837"
dependencies = [
"addr2line",
"cfg-if 1.0.0",
"cc",
"cfg-if",
"libc",
"miniz_oxide",
"object",
@@ -63,15 +57,18 @@ dependencies = [
[[package]]
name = "bitflags"
version = "1.2.1"
version = "1.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693"
checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
[[package]]
name = "cfg-if"
version = "0.1.10"
name = "cc"
version = "1.0.83"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822"
checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0"
dependencies = [
"libc",
]
[[package]]
name = "cfg-if"
@@ -81,78 +78,67 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
[[package]]
name = "clap"
version = "2.33.3"
version = "3.2.25"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "37e58ac78573c40708d45522f0d80fa2f01cc4f9b4e2bf749807255454312002"
checksum = "4ea181bf566f71cb9a5d17a59e1871af638180a18fb0035c92ae62b705207123"
dependencies = [
"ansi_term",
"atty",
"bitflags",
"clap_lex",
"indexmap",
"strsim",
"termcolor",
"textwrap",
"unicode-width",
"vec_map",
"yaml-rust",
]
[[package]]
name = "const_fn"
version = "0.4.2"
name = "clap_lex"
version = "0.2.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ce90df4c658c62f12d78f7508cf92f9173e5184a539c10bfe54a3107b3ffd0f2"
[[package]]
name = "crossbeam-channel"
version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dca26ee1f8d361640700bde38b2c37d8c22b3ce2d360e1fc1c74ea4b0aa7d775"
checksum = "2850f2f5a82cbf437dd5af4d49848fbdfc27c157c3d010345776f952765261c5"
dependencies = [
"cfg-if 1.0.0",
"crossbeam-utils",
"os_str_bytes",
]
[[package]]
name = "crossbeam-deque"
version = "0.8.0"
version = "0.8.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "94af6efb46fef72616855b036a624cf27ba656ffc9be1b9a3c931cfc7749a9a9"
checksum = "ce6fd6f855243022dcecf8702fef0c297d4338e226845fe067f6341ad9fa0cef"
dependencies = [
"cfg-if 1.0.0",
"cfg-if",
"crossbeam-epoch",
"crossbeam-utils",
]
[[package]]
name = "crossbeam-epoch"
version = "0.9.0"
version = "0.9.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ec0f606a85340376eef0d6d8fec399e6d4a544d648386c6645eb6d0653b27d9f"
checksum = "ae211234986c545741a7dc064309f67ee1e5ad243d0e48335adc0484d960bcc7"
dependencies = [
"cfg-if 1.0.0",
"const_fn",
"autocfg",
"cfg-if",
"crossbeam-utils",
"lazy_static",
"memoffset",
"scopeguard",
]
[[package]]
name = "crossbeam-utils"
version = "0.8.0"
version = "0.8.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ec91540d98355f690a86367e566ecad2e9e579f230230eb7c21398372be73ea5"
checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294"
dependencies = [
"autocfg",
"cfg-if 1.0.0",
"const_fn",
"lazy_static",
"cfg-if",
]
[[package]]
name = "either"
version = "1.6.1"
version = "1.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457"
checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07"
[[package]]
name = "error-chain"
@@ -166,101 +152,119 @@ dependencies = [
[[package]]
name = "getrandom"
version = "0.1.15"
version = "0.2.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fc587bc0ec293155d5bfa6b9891ec18a1e330c234f896ea47fbada4cadbe47e6"
checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427"
dependencies = [
"cfg-if 0.1.10",
"cfg-if",
"libc",
"wasi",
]
[[package]]
name = "gimli"
version = "0.22.0"
version = "0.28.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "aaf91faf136cb47367fa430cd46e37a788775e7fa104f8b4bcb3861dc389b724"
checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0"
[[package]]
name = "hashbrown"
version = "0.12.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888"
[[package]]
name = "hermit-abi"
version = "0.1.17"
version = "0.1.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5aca5565f760fb5b220e499d72710ed156fdb74e631659e99377d9ebfbd13ae8"
checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33"
dependencies = [
"libc",
]
[[package]]
name = "lazy_static"
version = "1.4.0"
name = "indexmap"
version = "1.9.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99"
dependencies = [
"autocfg",
"hashbrown",
]
[[package]]
name = "libc"
version = "0.2.80"
version = "0.2.149"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4d58d1b70b004888f764dfbf6a26a3b0342a1632d33968e4a179d8011c760614"
checksum = "a08173bc88b7955d1b3145aa561539096c421ac8debde8cbc3612ec635fee29b"
[[package]]
name = "linked-hash-map"
version = "0.5.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f"
[[package]]
name = "memchr"
version = "2.6.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167"
[[package]]
name = "memoffset"
version = "0.5.6"
version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "043175f069eda7b85febe4a74abbaeff828d9f8b448515d3151a14a3542811aa"
checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c"
dependencies = [
"autocfg",
]
[[package]]
name = "miniz_oxide"
version = "0.4.3"
version = "0.7.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0f2d26ec3309788e423cfbf68ad1800f061638098d76a83681af979dc4eda19d"
checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7"
dependencies = [
"adler",
"autocfg",
]
[[package]]
name = "num_cpus"
version = "1.13.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "05499f3756671c15885fee9034446956fff3f243d6077b91e5767df161f766b3"
dependencies = [
"hermit-abi",
"libc",
]
[[package]]
name = "object"
version = "0.21.1"
version = "0.32.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "37fd5004feb2ce328a52b0b3d01dbf4ffff72583493900ed15f22d4111c51693"
checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0"
dependencies = [
"memchr",
]
[[package]]
name = "os_str_bytes"
version = "6.6.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e2355d85b9a3786f481747ced0e0ff2ba35213a1f9bd406ed906554d7af805a1"
[[package]]
name = "ppv-lite86"
version = "0.2.9"
version = "0.2.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c36fa947111f5c62a733b652544dd0016a43ce89619538a8ef92724a6f501a20"
checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de"
[[package]]
name = "rand"
version = "0.7.3"
version = "0.8.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03"
checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404"
dependencies = [
"getrandom",
"libc",
"rand_chacha",
"rand_core",
"rand_hc",
]
[[package]]
name = "rand_chacha"
version = "0.2.2"
version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402"
checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88"
dependencies = [
"ppv-lite86",
"rand_core",
@@ -268,101 +272,81 @@ dependencies = [
[[package]]
name = "rand_core"
version = "0.5.1"
version = "0.6.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19"
checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c"
dependencies = [
"getrandom",
]
[[package]]
name = "rand_hc"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c"
dependencies = [
"rand_core",
]
[[package]]
name = "rayon"
version = "1.5.0"
version = "1.8.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8b0d8e0819fadc20c74ea8373106ead0600e3a67ef1fe8da56e39b9ae7275674"
checksum = "fa7237101a77a10773db45d62004a272517633fbcc3df19d96455ede1122e051"
dependencies = [
"autocfg",
"crossbeam-deque",
"either",
"rayon-core",
]
[[package]]
name = "rayon-core"
version = "1.9.0"
version = "1.12.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9ab346ac5921dc62ffa9f89b7a773907511cdfa5490c572ae9be1be33e8afa4a"
checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2"
dependencies = [
"crossbeam-channel",
"crossbeam-deque",
"crossbeam-utils",
"lazy_static",
"num_cpus",
]
[[package]]
name = "rustc-demangle"
version = "0.1.18"
version = "0.1.23"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6e3bad0ee36814ca07d7968269dd4b7ec89ec2da10c4bb613928d3077083c232"
checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76"
[[package]]
name = "scopeguard"
version = "1.1.0"
version = "1.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd"
checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"
[[package]]
name = "strsim"
version = "0.8.0"
version = "0.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a"
checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623"
[[package]]
name = "textwrap"
version = "0.11.0"
name = "termcolor"
version = "1.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060"
checksum = "6093bad37da69aab9d123a8091e4be0aa4a03e4d601ec641c327398315f62b64"
dependencies = [
"unicode-width",
"winapi-util",
]
[[package]]
name = "unicode-width"
version = "0.1.8"
name = "textwrap"
version = "0.16.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9337591893a19b88d8d87f2cec1e73fad5cdfd10e5a6f349f498ad6ea2ffb1e3"
[[package]]
name = "vec_map"
version = "0.8.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191"
checksum = "222a222a5bfe1bba4a77b45ec488a741b3cb8872e5e499451fd7d0129c9c7c3d"
[[package]]
name = "version_check"
version = "0.9.2"
version = "0.9.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b5a972e5669d67ba988ce3dc826706fb0a8b01471c088cb0b6110b805cc36aed"
checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f"
[[package]]
name = "wasi"
version = "0.9.0+wasi-snapshot-preview1"
version = "0.11.0+wasi-snapshot-preview1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519"
checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423"
[[package]]
name = "wham"
version = "1.0.0"
version = "1.1.4"
dependencies = [
"assert_approx_eq",
"clap",
@@ -387,6 +371,15 @@ version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
[[package]]
name = "winapi-util"
version = "0.1.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596"
dependencies = [
"winapi",
]
[[package]]
name = "winapi-x86_64-pc-windows-gnu"
version = "0.4.0"
@@ -395,6 +388,9 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
[[package]]
name = "yaml-rust"
version = "0.3.5"
version = "0.4.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e66366e18dc58b46801afbf2ca7661a9f59cc8c5962c29892b6039b4f86fa992"
checksum = "56c1936c4cc7a1c9ab21a1ebb602eb942ba868cbd44a99cb7cdc5892335e1c85"
dependencies = [
"linked-hash-map",
]

View File

@@ -1,6 +1,6 @@
[package]
name = "wham"
version = "1.0.0"
version = "1.1.4"
authors = ["Daniel Bauer <bauer@cbs.tu-darmstadt.de>"]
description = "An implementation of the weighted histogram analysis method"
license = "GPL-3.0"
@@ -8,12 +8,15 @@ repository = "https://github.com/danijoo/WHAM"
readme = "README.md"
categories = ["science", "command-line-utilities", "algorithms"]
keywords = ["math", "statistics", "histogram", "bioinformatics", "molecular-dynamics"]
exclude = [
"example/*"
]
[dependencies]
clap = {version="2.32.0", features=['yaml']}
clap = {version="3.2.25", features=['yaml']}
error-chain = "0.12.0"
rand = "0.7.*"
rayon = "1.0.3"
rand = "0.8.*"
rayon = "1.8.1"
[dev-dependencies]
assert_approx_eq = "1.1.0"

View File

@@ -20,12 +20,6 @@ Features
Installation
---
WHAM requires the GSL library to be installed:
```bash
# on debian/ubuntu:
sudo apt-get install libgsl0-dev
```
Installation from source via cargo:
```bash
# cargo installation
@@ -40,8 +34,8 @@ wham has a convenient command line interface. You can see all options with
```wham -h```:
```
wham 1.0.0
D. Bauer <bauer@bio.tu-darmstadt.de>
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.
@@ -62,7 +56,7 @@ The first column will be ignored and is followed by N reaction coordinates x.
Shipped under the GPLv3 license.
USAGE:
wham [FLAGS] [OPTIONS] --bins <BINS> --max <HIST_MAX> --file <METADATA> --min <HIST_MIN> --temperature <temperature>
wham [FLAGS] [OPTIONS] --bins <BINS> --max <HIST_MAX> --file <METADATA> --min <HIST_MIN> --temperature <temperature>
FLAGS:
-c, --cyclic For periodic reaction coordinates. If this is set, the first and last coordinate bin in each
@@ -78,6 +72,10 @@ OPTIONS:
--bt <bootstrap> Number of bayesian bootstrapping runs for error analysis by assigning random
weights (defaults to 0).
--seed <bootstrap_seed> Random seed for bootstrapping runs.
--convdt <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 <end> Skip rows in timeseries with an index larger than this value (defaults to 1e+20)
-i, --iterations <ITERATIONS> Stop WHAM after this many iterations without convergence (defaults to 100,000).
--max <HIST_MAX> Histogram maxima (comma separated). Also accepts "pi".
@@ -155,11 +153,6 @@ timeseries is used for unbiasing. A more detailed description of the method can
*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*
TODO
---
- Replica exchange
License & Citing
---
WHAM is licensed under the GPL-3.0 license. Please read the LICENSE file in this

View File

@@ -1,101 +1,101 @@
#coord1 Free Energy +/- Probability +/-
-3.110177 7.158102 0.071438 0.003494 0.000068
-3.047345 5.365727 0.069449 0.007168 0.000135
-2.984513 3.873190 0.067495 0.013039 0.000232
-2.921681 2.953162 0.067589 0.018855 0.000343
-2.858849 1.949554 0.064640 0.028195 0.000480
-2.796017 1.391747 0.063570 0.035261 0.000584
-2.733186 1.128270 0.061710 0.039189 0.000620
-2.670354 0.839970 0.060445 0.043991 0.000667
-2.607522 0.624769 0.060762 0.047955 0.000739
-2.544690 0.663757 0.060786 0.047211 0.000731
-2.481858 1.051932 0.059774 0.040407 0.000617
-2.419026 1.463048 0.060422 0.034267 0.000527
-2.356194 1.990616 0.055242 0.027734 0.000360
-2.293363 2.190692 0.044458 0.025597 0.000210
-2.230531 2.553036 0.042144 0.022136 0.000159
-2.167699 2.572522 0.043313 0.021964 0.000165
-2.104867 2.472360 0.039799 0.022863 0.000157
-2.042035 2.517562 0.036792 0.022453 0.000203
-1.979203 2.469778 0.036324 0.022887 0.000237
-1.916372 2.223125 0.049496 0.025266 0.000565
-1.853540 2.080157 0.039205 0.026756 0.000453
-1.790708 1.793841 0.041488 0.030011 0.000558
-1.727876 1.458784 0.042362 0.034326 0.000565
-1.665044 0.914441 0.037561 0.042697 0.000682
-1.602212 0.303813 0.028701 0.054540 0.000761
-1.539380 0.268335 0.025765 0.055321 0.000771
-1.476549 0.000000 0.023371 0.061604 0.000866
-1.413717 0.537061 0.026370 0.049671 0.000715
-1.350885 1.439940 0.025620 0.034586 0.000547
-1.288053 2.391838 0.027653 0.023614 0.000393
-1.225221 3.779470 0.027093 0.013538 0.000229
-1.162389 5.685555 0.027762 0.006305 0.000111
-1.099557 7.661896 0.028996 0.002855 0.000051
-1.036726 9.946594 0.032118 0.001142 0.000021
-0.973894 12.359408 0.042801 0.000434 0.000009
-0.911062 14.954655 0.052443 0.000153 0.000004
-0.848230 17.742242 0.063261 0.000050 0.000002
-0.785398 20.555785 0.068133 0.000016 0.000001
-0.722566 22.811160 0.075518 0.000007 0.000000
-0.659734 25.178094 0.086226 0.000003 0.000000
-0.596903 26.442288 0.091783 0.000002 0.000000
-0.534071 27.897565 0.093175 0.000001 0.000000
-0.471239 29.062473 0.096027 0.000001 0.000000
-0.408407 30.384521 0.096855 0.000000 0.000000
-0.345575 31.638454 0.099956 0.000000 0.000000
-0.282743 32.817727 0.107689 0.000000 0.000000
-0.219911 33.770369 0.108946 0.000000 0.000000
-0.157080 34.505503 0.112902 0.000000 0.000000
-0.094248 35.431659 0.120856 0.000000 0.000000
-0.031416 35.615810 0.122046 0.000000 0.000000
0.031416 35.561946 0.118225 0.000000 0.000000
0.094248 35.382089 0.108652 0.000000 0.000000
0.157080 34.934827 0.118384 0.000000 0.000000
0.219911 33.673460 0.119195 0.000000 0.000000
0.282743 32.731563 0.121592 0.000000 0.000000
0.345575 31.261855 0.129698 0.000000 0.000000
0.408407 29.717377 0.139789 0.000000 0.000000
0.471239 28.076620 0.137289 0.000001 0.000000
0.534071 26.481097 0.135712 0.000002 0.000000
0.596903 24.487358 0.135156 0.000003 0.000000
0.659734 22.344251 0.131027 0.000008 0.000000
0.722566 20.241543 0.133145 0.000018 0.000001
0.785398 18.341869 0.131952 0.000039 0.000002
0.848230 16.261582 0.134676 0.000091 0.000006
0.911062 14.301801 0.134417 0.000199 0.000013
0.973894 12.603788 0.131018 0.000394 0.000024
1.036726 11.249601 0.131276 0.000678 0.000043
1.099557 10.087886 0.132498 0.001079 0.000070
1.162389 9.443303 0.132990 0.001398 0.000092
1.225221 9.152799 0.132250 0.001570 0.000104
1.288053 9.331937 0.133178 0.001462 0.000099
1.350885 9.905546 0.133357 0.001161 0.000078
1.413717 11.042050 0.133807 0.000736 0.000051
1.476549 12.598167 0.132722 0.000395 0.000027
1.539380 14.520167 0.131816 0.000183 0.000012
1.602212 16.569783 0.131773 0.000080 0.000005
1.665044 18.687390 0.132601 0.000034 0.000002
1.727876 20.775408 0.133867 0.000015 0.000001
1.790708 22.905200 0.129265 0.000006 0.000000
1.853540 24.643852 0.128894 0.000003 0.000000
1.916372 26.301740 0.130266 0.000002 0.000000
1.979203 27.372071 0.128620 0.000001 0.000000
2.042035 28.697726 0.133263 0.000001 0.000000
2.104867 29.417901 0.133513 0.000000 0.000000
2.167699 30.008351 0.130925 0.000000 0.000000
2.230531 30.406016 0.124398 0.000000 0.000000
2.293363 30.171275 0.122493 0.000000 0.000000
2.356194 29.884646 0.130278 0.000000 0.000000
2.419026 29.428153 0.130844 0.000000 0.000000
2.481858 28.546982 0.148114 0.000001 0.000000
2.544690 27.757520 0.133045 0.000001 0.000000
2.607522 26.505787 0.134364 0.000001 0.000000
2.670354 24.491866 0.115061 0.000003 0.000000
2.733186 22.320664 0.110036 0.000008 0.000000
2.796017 20.052723 0.107894 0.000020 0.000001
2.858849 17.655650 0.105964 0.000052 0.000002
2.921681 15.471590 0.107005 0.000125 0.000005
2.984513 13.138167 0.099378 0.000318 0.000012
3.047345 11.092386 0.087770 0.000722 0.000022
3.110177 9.065722 0.077092 0.001626 0.000038
-3.110177 7.158102 0.000000 0.003494 0.000000
-3.047345 5.365727 0.000000 0.007168 0.000000
-2.984513 3.873190 0.000000 0.013039 0.000000
-2.921681 2.953162 0.000000 0.018855 0.000000
-2.858849 1.949554 0.000000 0.028195 0.000000
-2.796017 1.391747 0.000000 0.035261 0.000000
-2.733186 1.128270 0.000000 0.039189 0.000000
-2.670354 0.839970 0.000000 0.043991 0.000000
-2.607522 0.624769 0.000000 0.047955 0.000000
-2.544690 0.663757 0.000000 0.047211 0.000000
-2.481858 1.051932 0.000000 0.040407 0.000000
-2.419026 1.463048 0.000000 0.034267 0.000000
-2.356194 1.990616 0.000000 0.027734 0.000000
-2.293363 2.190692 0.000000 0.025597 0.000000
-2.230531 2.553036 0.000000 0.022136 0.000000
-2.167699 2.572522 0.000000 0.021964 0.000000
-2.104867 2.472360 0.000000 0.022863 0.000000
-2.042035 2.517562 0.000000 0.022453 0.000000
-1.979203 2.469778 0.000000 0.022887 0.000000
-1.916372 2.223125 0.000000 0.025266 0.000000
-1.853540 2.080157 0.000000 0.026756 0.000000
-1.790708 1.793841 0.000000 0.030011 0.000000
-1.727876 1.458784 0.000000 0.034326 0.000000
-1.665044 0.914441 0.000000 0.042697 0.000000
-1.602212 0.303813 0.000000 0.054540 0.000000
-1.539380 0.268335 0.000000 0.055321 0.000000
-1.476549 0.000000 0.000000 0.061604 0.000000
-1.413717 0.537061 0.000000 0.049671 0.000000
-1.350885 1.439940 0.000000 0.034586 0.000000
-1.288053 2.391838 0.000000 0.023614 0.000000
-1.225221 3.779470 0.000000 0.013538 0.000000
-1.162389 5.685555 0.000000 0.006305 0.000000
-1.099557 7.661896 0.000000 0.002855 0.000000
-1.036726 9.946594 0.000000 0.001142 0.000000
-0.973894 12.359408 0.000000 0.000434 0.000000
-0.911062 14.954655 0.000000 0.000153 0.000000
-0.848230 17.742242 0.000000 0.000050 0.000000
-0.785398 20.555785 0.000000 0.000016 0.000000
-0.722566 22.811160 0.000000 0.000007 0.000000
-0.659734 25.178094 0.000000 0.000003 0.000000
-0.596903 26.442288 0.000000 0.000002 0.000000
-0.534071 27.897565 0.000000 0.000001 0.000000
-0.471239 29.062473 0.000000 0.000001 0.000000
-0.408407 30.384521 0.000000 0.000000 0.000000
-0.345575 31.638454 0.000000 0.000000 0.000000
-0.282743 32.817727 0.000000 0.000000 0.000000
-0.219911 33.770369 0.000000 0.000000 0.000000
-0.157080 34.505503 0.000000 0.000000 0.000000
-0.094248 35.431659 0.000000 0.000000 0.000000
-0.031416 35.615810 0.000000 0.000000 0.000000
0.031416 35.561946 0.000000 0.000000 0.000000
0.094248 35.382089 0.000000 0.000000 0.000000
0.157080 34.934827 0.000000 0.000000 0.000000
0.219911 33.673460 0.000000 0.000000 0.000000
0.282743 32.731563 0.000000 0.000000 0.000000
0.345575 31.261855 0.000000 0.000000 0.000000
0.408407 29.717377 0.000000 0.000000 0.000000
0.471239 28.076620 0.000000 0.000001 0.000000
0.534071 26.481097 0.000000 0.000002 0.000000
0.596903 24.487358 0.000000 0.000003 0.000000
0.659734 22.344251 0.000000 0.000008 0.000000
0.722566 20.241543 0.000000 0.000018 0.000000
0.785398 18.341869 0.000000 0.000039 0.000000
0.848230 16.261582 0.000000 0.000091 0.000000
0.911062 14.301801 0.000000 0.000199 0.000000
0.973894 12.603788 0.000000 0.000394 0.000000
1.036726 11.249601 0.000000 0.000678 0.000000
1.099557 10.087886 0.000000 0.001079 0.000000
1.162389 9.443303 0.000000 0.001398 0.000000
1.225221 9.152799 0.000000 0.001570 0.000000
1.288053 9.331937 0.000000 0.001462 0.000000
1.350885 9.905546 0.000000 0.001161 0.000000
1.413717 11.042050 0.000000 0.000736 0.000000
1.476549 12.598167 0.000000 0.000395 0.000000
1.539380 14.520167 0.000000 0.000183 0.000000
1.602212 16.569783 0.000000 0.000080 0.000000
1.665044 18.687390 0.000000 0.000034 0.000000
1.727876 20.775408 0.000000 0.000015 0.000000
1.790708 22.905200 0.000000 0.000006 0.000000
1.853540 24.643852 0.000000 0.000003 0.000000
1.916372 26.301740 0.000000 0.000002 0.000000
1.979203 27.372071 0.000000 0.000001 0.000000
2.042035 28.697726 0.000000 0.000001 0.000000
2.104867 29.417901 0.000000 0.000000 0.000000
2.167699 30.008351 0.000000 0.000000 0.000000
2.230531 30.406016 0.000000 0.000000 0.000000
2.293363 30.171275 0.000000 0.000000 0.000000
2.356194 29.884646 0.000000 0.000000 0.000000
2.419026 29.428153 0.000000 0.000000 0.000000
2.481858 28.546982 0.000000 0.000001 0.000000
2.544690 27.757520 0.000000 0.000001 0.000000
2.607522 26.505787 0.000000 0.000001 0.000000
2.670354 24.491866 0.000000 0.000003 0.000000
2.733186 22.320664 0.000000 0.000008 0.000000
2.796017 20.052723 0.000000 0.000020 0.000000
2.858849 17.655650 0.000000 0.000052 0.000000
2.921681 15.471590 0.000000 0.000125 0.000000
2.984513 13.138167 0.000000 0.000318 0.000000
3.047345 11.092386 0.000000 0.000722 0.000000
3.110177 9.065722 0.000000 0.001626 0.000000

View File

@@ -0,0 +1,101 @@
#coord1 Free Energy +/- Probability +/-
-3.110177 7.158102 0.066061 0.003494 0.000070
-3.047345 5.365727 0.066577 0.007168 0.000135
-2.984513 3.873190 0.064431 0.013039 0.000233
-2.921681 2.953162 0.065142 0.018855 0.000334
-2.858849 1.949554 0.064047 0.028195 0.000483
-2.796017 1.391747 0.062115 0.035261 0.000594
-2.733186 1.128270 0.059763 0.039189 0.000647
-2.670354 0.839970 0.059287 0.043991 0.000712
-2.607522 0.624769 0.058500 0.047955 0.000797
-2.544690 0.663757 0.058265 0.047211 0.000798
-2.481858 1.051932 0.056788 0.040407 0.000664
-2.419026 1.463048 0.059709 0.034267 0.000622
-2.356194 1.990616 0.053483 0.027734 0.000423
-2.293363 2.190692 0.043319 0.025597 0.000266
-2.230531 2.553036 0.039698 0.022136 0.000187
-2.167699 2.572522 0.039097 0.021964 0.000156
-2.104867 2.472360 0.036596 0.022863 0.000147
-2.042035 2.517562 0.037999 0.022453 0.000209
-1.979203 2.469778 0.038176 0.022887 0.000241
-1.916372 2.223125 0.047408 0.025266 0.000449
-1.853540 2.080157 0.037957 0.026756 0.000373
-1.790708 1.793841 0.037537 0.030011 0.000435
-1.727876 1.458784 0.038048 0.034326 0.000494
-1.665044 0.914441 0.036602 0.042697 0.000617
-1.602212 0.303813 0.033286 0.054540 0.000762
-1.539380 0.268335 0.032947 0.055321 0.000800
-1.476549 0.000000 0.032532 0.061604 0.000915
-1.413717 0.537061 0.035421 0.049671 0.000786
-1.350885 1.439940 0.036002 0.034586 0.000580
-1.288053 2.391838 0.038449 0.023614 0.000426
-1.225221 3.779470 0.038521 0.013538 0.000246
-1.162389 5.685555 0.039935 0.006305 0.000119
-1.099557 7.661896 0.039852 0.002855 0.000054
-1.036726 9.946594 0.041239 0.001142 0.000022
-0.973894 12.359408 0.044291 0.000434 0.000009
-0.911062 14.954655 0.049774 0.000153 0.000003
-0.848230 17.742242 0.059250 0.000050 0.000001
-0.785398 20.555785 0.065401 0.000016 0.000001
-0.722566 22.811160 0.073860 0.000007 0.000000
-0.659734 25.178094 0.086184 0.000003 0.000000
-0.596903 26.442288 0.091674 0.000002 0.000000
-0.534071 27.897565 0.091810 0.000001 0.000000
-0.471239 29.062473 0.093492 0.000001 0.000000
-0.408407 30.384521 0.091621 0.000000 0.000000
-0.345575 31.638454 0.094954 0.000000 0.000000
-0.282743 32.817727 0.104975 0.000000 0.000000
-0.219911 33.770369 0.107367 0.000000 0.000000
-0.157080 34.505503 0.107448 0.000000 0.000000
-0.094248 35.431659 0.122770 0.000000 0.000000
-0.031416 35.615810 0.123003 0.000000 0.000000
0.031416 35.561946 0.119921 0.000000 0.000000
0.094248 35.382089 0.107837 0.000000 0.000000
0.157080 34.934827 0.112907 0.000000 0.000000
0.219911 33.673460 0.107974 0.000000 0.000000
0.282743 32.731563 0.106959 0.000000 0.000000
0.345575 31.261855 0.107235 0.000000 0.000000
0.408407 29.717377 0.110897 0.000000 0.000000
0.471239 28.076620 0.110736 0.000001 0.000000
0.534071 26.481097 0.110570 0.000002 0.000000
0.596903 24.487358 0.110678 0.000003 0.000000
0.659734 22.344251 0.108746 0.000008 0.000000
0.722566 20.241543 0.110764 0.000018 0.000001
0.785398 18.341869 0.110562 0.000039 0.000002
0.848230 16.261582 0.113400 0.000091 0.000005
0.911062 14.301801 0.113555 0.000199 0.000010
0.973894 12.603788 0.113740 0.000394 0.000020
1.036726 11.249601 0.113019 0.000678 0.000035
1.099557 10.087886 0.112748 0.001079 0.000056
1.162389 9.443303 0.111507 0.001398 0.000072
1.225221 9.152799 0.110347 0.001570 0.000081
1.288053 9.331937 0.110858 0.001462 0.000076
1.350885 9.905546 0.111592 0.001161 0.000061
1.413717 11.042050 0.111362 0.000736 0.000039
1.476549 12.598167 0.111371 0.000395 0.000021
1.539380 14.520167 0.110164 0.000183 0.000010
1.602212 16.569783 0.110233 0.000080 0.000004
1.665044 18.687390 0.110987 0.000034 0.000002
1.727876 20.775408 0.112748 0.000015 0.000001
1.790708 22.905200 0.107353 0.000006 0.000000
1.853540 24.643852 0.109825 0.000003 0.000000
1.916372 26.301740 0.109608 0.000002 0.000000
1.979203 27.372071 0.108712 0.000001 0.000000
2.042035 28.697726 0.112741 0.000001 0.000000
2.104867 29.417901 0.111171 0.000000 0.000000
2.167699 30.008351 0.111253 0.000000 0.000000
2.230531 30.406016 0.109443 0.000000 0.000000
2.293363 30.171275 0.109685 0.000000 0.000000
2.356194 29.884646 0.123195 0.000000 0.000000
2.419026 29.428153 0.121519 0.000000 0.000000
2.481858 28.546982 0.142684 0.000001 0.000000
2.544690 27.757520 0.125824 0.000001 0.000000
2.607522 26.505787 0.127311 0.000001 0.000000
2.670354 24.491866 0.105644 0.000003 0.000000
2.733186 22.320664 0.094847 0.000008 0.000000
2.796017 20.052723 0.089885 0.000020 0.000001
2.858849 17.655650 0.087837 0.000052 0.000002
2.921681 15.471590 0.087834 0.000125 0.000005
2.984513 13.138167 0.081947 0.000318 0.000011
3.047345 11.092386 0.074513 0.000722 0.000020
3.110177 9.065722 0.068298 0.001626 0.000036

View File

@@ -1,6 +1,6 @@
name: wham
version: "1.0.0"
author: D. Bauer <bauer@cbs.tu-darmstadt.de>
version: "1.1.3"
author: D. Bauer <bauer@bio.tu-darmstadt.de>
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.
@@ -106,4 +106,14 @@ args:
long: uncorr
help: Estimates statistical inefficiency of each timeseries via autocorrelation and removes correlated samples (default is off).
takes_value: false
required: false
required: false
- convdt:
long: convdt
help: "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."
takes_value: true
required: false
- ignore_empty:
long: ignore_empty
help: If this is set, do not fail if a histogram is empty.
takes_value: false
required: false

View File

@@ -8,11 +8,14 @@ use super::statistics;
// Method for the Analysis of Simulated and Parallel Tempering Simulations, JCTC"
pub fn statistical_ineff(timeseries: &[f64]) -> f64 {
let n = timeseries.len();
let autocorr = autocorrelation(timeseries);
let mean = statistics::mean(timeseries);
let d_mean = timeseries.iter().map(|x| x-mean).collect::<Vec<f64>>();
let cov = statistics::autocov(timeseries);
let mut g = 1.0;
for t in 1..(n-1) {
let c = autocorr[t-1];
let tmp = d_mean[0..n-t].iter().zip(d_mean[t..n].iter()).map(|(x,y)| x*y);
let c = tmp.map(|x| x+x).sum::<f64>() / (2.0 * (n as f64 - t as f64)*cov);
if c <= 0.0 {
break;
}
@@ -25,22 +28,6 @@ pub fn statistical_ineff(timeseries: &[f64]) -> f64 {
}
}
// calculates the autocorrelation of a simeseries
fn autocorrelation(timeseries: &[f64]) -> Vec<f64> {
let n = timeseries.len();
let mean = statistics::mean(timeseries);
let d_mean = timeseries.iter().map(|x| x-mean).collect::<Vec<f64>>();
let cov = statistics::autocov(timeseries);
let mut autocorr = Vec::new();
for t in 1..(n-1) {
let tmp = d_mean[0..n-t].iter().zip(d_mean[t..n].iter()).map(|(x, y)| x*y);
let c: f64 = tmp.map(|x| x+x).sum::<f64>() / (2.0 * (n as f64-t as f64)*cov);
autocorr.push(c);
}
autocorr
}
// The autocorrelation time of a timeseries can be deduced from the
// `statistical_ineff` by (g-1)/2.0
pub fn autocorrelation_time(g: f64) -> f64 {
@@ -65,29 +52,18 @@ mod tests {
}
#[test]
fn autocorrelation() {
let timeseries = read_timeseries("example/1d_cyclic/COLVAR-2.5.xvg");
let autocorr = super::autocorrelation(&timeseries);
let expected = [
0.691_900_865_597_914_3, 0.533_171_939_967_135_5,
0.204_726_209_564_635_89, -0.002_850_876_458_920_514,
-0.138_428_500_779_381_46, -0.265_292_355_297_323_2,
-0.314_271_982_722_353_85, -0.261_750_515_155_769_3,
-0.205_948_647_302_903_38, -0.133_100_190_918_118_12,
-0.188_756_890_119_342_6, -0.194_493_662_542_493_3,
-0.196_359_967_318_946_1, -0.113_915_878_338_380_03];
for (actual, expected) in autocorr.iter().zip(expected.iter()) {
assert!((actual-expected).abs() < 0.001);
}
}
#[test]
fn statistical_ineff() {
let timeseries = read_timeseries("example/1d_cyclic/COLVAR-2.5.xvg");
let g = super::statistical_ineff(&timeseries);
println!("{:?}", g);
assert!((g - 3.859).abs() < 0.001)
assert!((g - 3.859).abs() < 0.001);
// a "random" timeseries with g < 1.0
let timeseries = [1_f64, 4_f64, 921_f64, 121213_f64, 23192_f64,
8913_f64, 1232_f64, 2_f64, 151_f64, 123091_f64];
let g = super::statistical_ineff(&timeseries);
assert_approx_eq!(g, 1.0);
}
#[test]
@@ -99,4 +75,4 @@ mod tests {
assert!((tau - 1.430).abs() < 0.001)
}
}
}

View File

@@ -73,29 +73,29 @@ mod tests {
use super::super::histogram::Histogram;
fn build_hist() -> Histogram {
Histogram::new(
22, // num_points
vec![1.0, 1.0, 3.0, 5.0, 12.0] // bins
)
}
Histogram::new(
22, // num_points
vec![1.0, 1.0, 3.0, 5.0, 12.0] // bins
)
}
fn build_hist_set() -> Dataset {
let h1 = build_hist();
let h2 = build_hist();
let h3 = build_hist();
Dataset::new(
5, // num bins
vec![3],
vec![1.0], // bin width
vec![0.0], // hist min
vec![9.0], // hist max
vec![4.5, 4.5, 4.5], // x0
vec![10.0, 10.0, 10.0], // fc
300.0*k_B, // kT
vec![h1, h2, h3], // hists
false // cyclic
)
}
fn build_hist_set() -> Dataset {
let h1 = build_hist();
let h2 = build_hist();
let h3 = build_hist();
Dataset::new(
5, // num bins
vec![3],
vec![1.0], // bin width
vec![0.0], // hist min
vec![9.0], // hist max
vec![4.5, 4.5, 4.5], // x0
vec![10.0, 10.0, 10.0], // fc
300.0*k_B, // kT
vec![h1, h2, h3], // hists
false // cyclic
)
}
#[test]
fn random_weights() {

View File

@@ -3,266 +3,266 @@ use std::fmt;
// One histogram
#[derive(Debug,Clone)]
pub struct Histogram {
// total number of data points stored in the histogram
pub num_points: u32,
// total number of data points stored in the histogram
pub num_points: u32,
// histogram bins
pub bins: Vec<f64>
// histogram bins
pub bins: Vec<f64>
}
impl Histogram {
pub fn new(num_points: u32, bins: Vec<f64>) -> Histogram {
Histogram {num_points, bins}
}
pub fn new(num_points: u32, bins: Vec<f64>) -> Histogram {
Histogram {num_points, bins}
}
}
// a set of histograms
#[derive(Debug,Clone)]
pub struct Dataset {
// number of histogram windows (number of simulations)
pub num_windows: usize,
// number of histogram windows (number of simulations)
pub num_windows: usize,
// total number of bins
pub num_bins: usize,
// total number of bins
pub num_bins: usize,
// number of bins in each dimension
pub dimens_lengths: Vec<usize>,
// number of bins in each dimension
pub dimens_lengths: Vec<usize>,
// min values of the histogram in each dimension
hist_min: Vec<f64>,
// min values of the histogram in each dimension
hist_min: Vec<f64>,
// max values of the histogram in each dimension
hist_max: Vec<f64>,
// max values of the histogram in each dimension
hist_max: Vec<f64>,
// width of a bin in unit of its dimension
bin_width: Vec<f64>,
// width of a bin in unit of its dimension
bin_width: Vec<f64>,
// value of kT
pub kT: f64,
// value of kT
pub kT: f64,
// histogram for each window
pub histograms: Vec<Histogram>,
// histogram for each window
pub histograms: Vec<Histogram>,
// flag for cyclic reaction coordinates
pub cyclic: bool,
// flag for cyclic reaction coordinates
pub cyclic: bool,
// locations of biases
bias_pos: Vec<f64>,
// locations of biases
bias_pos: Vec<f64>,
// force constants of biases
bias_fc: Vec<f64>,
// force constants of biases
bias_fc: Vec<f64>,
// bias value cache
bias: Vec<f64>,
// bias value cache
bias: Vec<f64>,
// histogram weight
pub weights: Vec<f64>,
// histogram weight
pub weights: Vec<f64>,
}
impl Dataset {
pub fn new(num_bins: usize, dimens_lengths: Vec<usize>, bin_width: Vec<f64>,
pub fn new(num_bins: usize, dimens_lengths: Vec<usize>, bin_width: Vec<f64>,
hist_min: Vec<f64>, hist_max: Vec<f64>, bias_pos: Vec<f64>,
bias_fc: Vec<f64>, kT: f64, histograms: Vec<Histogram>, cyclic: bool) -> Dataset {
let num_windows = histograms.len();
let bias: Vec<f64> = vec![0.0; num_bins*num_windows];
let weights = vec![1.0; num_windows];
let mut ds = Dataset{
num_windows,
num_bins,
dimens_lengths,
bin_width,
hist_min,
hist_max,
kT,
histograms,
cyclic,
bias_pos,
bias_fc,
bias,
weights
};
for window in 0..num_windows {
for bin in 0..num_bins {
let ndx = window * num_bins + bin;
ds.bias[ndx] = ds.calc_bias(bin, window);
}
}
ds
let num_windows = histograms.len();
let bias: Vec<f64> = vec![0.0; num_bins*num_windows];
let weights = vec![1.0; num_windows];
let mut ds = Dataset{
num_windows,
num_bins,
dimens_lengths,
bin_width,
hist_min,
hist_max,
kT,
histograms,
cyclic,
bias_pos,
bias_fc,
bias,
weights
};
for window in 0..num_windows {
for bin in 0..num_bins {
let ndx = window * num_bins + bin;
ds.bias[ndx] = ds.calc_bias(bin, window);
}
}
ds
}
}
pub fn new_weighted(ds: Dataset, weights: Vec<f64>) -> Dataset {
Dataset {
weights,
..ds
}
}
pub fn new_weighted(ds: Dataset, weights: Vec<f64>) -> Dataset {
Dataset {
weights,
..ds
}
}
pub fn get_weighted_bin_count(&self, bin: usize) -> f64 {
self.histograms.iter().enumerate().map(|(idx,h)| self.weights[idx]*h.bins[bin]).sum()
}
pub fn get_weighted_bin_count(&self, bin: usize) -> f64 {
self.histograms.iter().enumerate().map(|(idx,h)| self.weights[idx]*h.bins[bin]).sum()
}
fn expand_index(&self, bin: usize, lengths: &[usize]) -> Vec<usize> {
let mut tmp = bin;
let mut idx = vec![0; lengths.len()];
for dimen in (1..lengths.len()).rev() {
let denom: usize = lengths.iter().take(dimen).product();
idx[dimen] = tmp / denom;
tmp %= denom;
}
idx[0] = tmp;
idx
}
fn expand_index(&self, bin: usize, lengths: &[usize]) -> Vec<usize> {
let mut tmp = bin;
let mut idx = vec![0; lengths.len()];
for dimen in (1..lengths.len()).rev() {
let denom: usize = lengths.iter().take(dimen).product();
idx[dimen] = tmp / denom;
tmp %= denom;
}
idx[0] = tmp;
idx
}
// get center x value for a bin
pub fn get_coords_for_bin(&self, bin: usize) -> Vec<f64> {
self.expand_index(bin, &self.dimens_lengths).iter().enumerate().map(|(i, dimen_bin)| {
self.hist_min[i] + self.bin_width[i]*(*dimen_bin as f64 + 0.5)
}).collect()
}
// get center x value for a bin
pub fn get_coords_for_bin(&self, bin: usize) -> Vec<f64> {
self.expand_index(bin, &self.dimens_lengths).iter().enumerate().map(|(i, dimen_bin)| {
self.hist_min[i] + self.bin_width[i]*(*dimen_bin as f64 + 0.5)
}).collect()
}
pub fn get_bias(&self, bin: usize, window: usize) -> f64 {
let ndx = window * self.num_bins + bin;
self.bias[ndx]
}
pub fn get_bias(&self, bin: usize, window: usize) -> f64 {
let ndx = window * self.num_bins + bin;
self.bias[ndx]
}
// Harmonic bias calculation: bias = 0.5*k(dx)^2
// if cyclic is true, lowest and highest bins are assumed to be
// neighbors. This returns exp(U/kT) instead of U for better performance.
fn calc_bias(&self, bin: usize, window: usize) -> f64 {
let dimens = self.dimens_lengths.len();
// index of the bias value depends on the window und dimension
let bias_ndx: Vec<usize> = (0..dimens)
.map(|dimen| { window * dimens + dimen }).collect();
// Harmonic bias calculation: bias = 0.5*k(dx)^2
// if cyclic is true, lowest and highest bins are assumed to be
// neighbors. This returns exp(U/kT) instead of U for better performance.
fn calc_bias(&self, bin: usize, window: usize) -> f64 {
let dimens = self.dimens_lengths.len();
// index of the bias value depends on the window und dimension
let bias_ndx: Vec<usize> = (0..dimens)
.map(|dimen| { window * dimens + dimen }).collect();
// find the N coords, force constants and bias coords
let coord = self.get_coords_for_bin(bin);
let bias_fc: Vec<f64> = bias_ndx.iter().map(|ndx| { self.bias_fc[*ndx] }).collect();
let bias_pos: Vec<f64> = bias_ndx.iter().map(|ndx| { self.bias_pos[*ndx] }).collect();
// find the N coords, force constants and bias coords
let coord = self.get_coords_for_bin(bin);
let bias_fc: Vec<f64> = bias_ndx.iter().map(|ndx| { self.bias_fc[*ndx] }).collect();
let bias_pos: Vec<f64> = bias_ndx.iter().map(|ndx| { self.bias_pos[*ndx] }).collect();
let mut bias_sum = 0.0;
for i in 0..dimens {
let mut dist = (coord[i] - bias_pos[i]).abs();
if self.cyclic { // periodic conditions
let hist_len = self.hist_max[i] - self.hist_min[i];
if dist > 0.5 * hist_len {
dist -= hist_len;
}
}
// store exp(U/kT) for better performance
bias_sum += 0.5 * bias_fc[i] * dist * dist
}
(-bias_sum/self.kT).exp()
}
let mut bias_sum = 0.0;
for i in 0..dimens {
let mut dist = (coord[i] - bias_pos[i]).abs();
if self.cyclic { // periodic conditions
let hist_len = self.hist_max[i] - self.hist_min[i];
if dist > 0.5 * hist_len {
dist -= hist_len;
}
}
// store exp(U/kT) for better performance
bias_sum += 0.5 * bias_fc[i] * dist * dist
}
(-bias_sum/self.kT).exp()
}
}
impl fmt::Display for Dataset {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
let mut datapoints: u32 = 0;
for h in &self.histograms {
datapoints += h.num_points;
}
write!(f, "{} windows, {} datapoints", self.num_windows, datapoints)
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
let mut datapoints: u32 = 0;
for h in &self.histograms {
datapoints += h.num_points;
}
write!(f, "{} windows, {} datapoints", self.num_windows, datapoints)
}
}
#[cfg(test)]
mod tests {
use super::*;
use super::super::k_B;
use super::*;
use super::super::k_B;
macro_rules! assert_delta {
macro_rules! assert_delta {
($x:expr, $y:expr, $d:expr) => {
assert!(($x-$y).abs() < $d, "{} != {}", $x, $y)
}
}
fn build_hist() -> Histogram {
Histogram::new(
22, // num_points
vec![1.0, 1.0, 3.0, 5.0, 12.0] // bins
)
}
fn build_hist() -> Histogram {
Histogram::new(
22, // num_points
vec![1.0, 1.0, 3.0, 5.0, 12.0] // bins
)
}
fn build_hist_set() -> Dataset {
let h = build_hist();
Dataset::new(
5, // num bins
vec![1],
vec![1.0], // bin width
vec![0.0], // hist min
vec![9.0], // hist max
vec![4.5], // x0
vec![10.0], // fc
300.0*k_B, // kT
vec![h], // hists
false // cyclic
)
}
fn build_hist_set() -> Dataset {
let h = build_hist();
Dataset::new(
5, // num bins
vec![1],
vec![1.0], // bin width
vec![0.0], // hist min
vec![9.0], // hist max
vec![4.5], // x0
vec![10.0], // fc
300.0*k_B, // kT
vec![h], // hists
false // cyclic
)
}
#[test]
fn calc_bias() {
let ds = build_hist_set(); // k = 10
#[test]
fn calc_bias() {
let ds = build_hist_set(); // k = 10
// 3th element -> x=3.5, x0=3.5
assert_delta!(0.134_722_337_796, ds.calc_bias(3, 0), 0.000_000_01);
// 3th element -> x=3.5, x0=3.5
assert_delta!(0.134_722_337_796, ds.calc_bias(3, 0), 0.000_000_01);
// 8th element -> x=8.5, x0=3.5
assert_delta!(1.0, ds.calc_bias(4,0), 0.000_000_01);
// 1st element -> x=0.5, x0=3.5. non-cyclic!
assert_delta!(0.0, ds.calc_bias(0,0), 0.000_000_1);
}
// 8th element -> x=8.5, x0=3.5
assert_delta!(1.0, ds.calc_bias(4,0), 0.000_000_01);
// 1st element -> x=0.5, x0=3.5. non-cyclic!
assert_delta!(0.0, ds.calc_bias(0,0), 0.000_000_1);
}
#[test]
fn calc_biascyclic() {
let mut ds = build_hist_set();
ds.cyclic = true;
#[test]
fn calc_biascyclic() {
let mut ds = build_hist_set();
ds.cyclic = true;
// 7th element -> x=3.5, x0=3.5
assert_delta!(0.134_722_337_796, ds.calc_bias(3, 0), 0.000_000_01);
// 7th element -> x=3.5, x0=3.5
assert_delta!(0.134_722_337_796, ds.calc_bias(3, 0), 0.000_000_01);
// 8th element -> x=4.5, x0=3.5
assert_delta!(1.0, ds.calc_bias(4, 0), 0.000_000_01);
// 8th element -> x=4.5, x0=3.5
assert_delta!(1.0, ds.calc_bias(4, 0), 0.000_000_01);
// 1th element -> x=0.5, x0=3.5
// cyclic flag makes bin 0 neighboring bin 9, so the distance is actually 2
assert_delta!(0.000_000_000_000_011_776_9, ds.calc_bias(0, 0), 0.000_000_01);
// 1th element -> x=0.5, x0=3.5
// cyclic flag makes bin 0 neighboring bin 9, so the distance is actually 2
assert_delta!(0.000_000_000_000_011_776_9, ds.calc_bias(0, 0), 0.000_000_01);
// 2nd element -> x=1.5, x0=3.5
assert_delta!(0.000_000_01, ds.calc_bias(1, 0), 0.000_000_01);
}
// 2nd element -> x=1.5, x0=3.5
assert_delta!(0.000_000_01, ds.calc_bias(1, 0), 0.000_000_01);
}
#[test]
fn get_x_for_bin() {
let ds = build_hist_set();
let expected: Vec<f64> = vec![0,1,2,3,4,5,6,7,8].iter()
.map(|x| *x as f64 + 0.5).collect();
#[test]
fn get_x_for_bin() {
let ds = build_hist_set();
let expected: Vec<f64> = vec![0,1,2,3,4,5,6,7,8].iter()
.map(|x| *x as f64 + 0.5).collect();
expected.iter().enumerate().for_each(|(i, exp)| {
assert_approx_eq!(exp, &ds.get_coords_for_bin(i)[0]);
})
}
}
#[test]
fn get_bin_count() {
let ds = Dataset::new(
5, // num bins
vec![1],
vec![1.0, 1.0], // bin width
vec![0.0, 0.0], // hist min
vec![5.0, 5.0], // hist max
vec![7.5, 7.5], // x0
vec![10.0, 10.0], // fc
300.0*k_B, // kT
vec![build_hist(), build_hist()], // hists
false // cyclic
);
assert_delta!(2.0, ds.get_weighted_bin_count(0), 0.000_000_000_1);
assert_delta!(2.0, ds.get_weighted_bin_count(1), 0.000_000_000_1);
assert_delta!(6.0, ds.get_weighted_bin_count(2), 0.000_000_000_1);
assert_delta!(10.0, ds.get_weighted_bin_count(3), 0.000_000_000_1);
assert_delta!(24.0, ds.get_weighted_bin_count(4), 0.000_000_000_1);
}
#[test]
fn get_bin_count() {
let ds = Dataset::new(
5, // num bins
vec![1],
vec![1.0, 1.0], // bin width
vec![0.0, 0.0], // hist min
vec![5.0, 5.0], // hist max
vec![7.5, 7.5], // x0
vec![10.0, 10.0], // fc
300.0*k_B, // kT
vec![build_hist(), build_hist()], // hists
false // cyclic
);
assert_delta!(2.0, ds.get_weighted_bin_count(0), 0.000_000_000_1);
assert_delta!(2.0, ds.get_weighted_bin_count(1), 0.000_000_000_1);
assert_delta!(6.0, ds.get_weighted_bin_count(2), 0.000_000_000_1);
assert_delta!(10.0, ds.get_weighted_bin_count(3), 0.000_000_000_1);
assert_delta!(24.0, ds.get_weighted_bin_count(4), 0.000_000_000_1);
}
}

387
src/io.rs
View File

@@ -2,6 +2,7 @@ use super::histogram::Dataset;
use super::histogram::Histogram;
use super::Config;
use super::correlation_analysis::{statistical_ineff, autocorrelation_time};
use std::fs::OpenOptions;
use std::fs::File;
use std::io::prelude::*;
use std::io::{BufReader,BufWriter};
@@ -26,18 +27,27 @@ pub fn vprintln(s: String, verbose: bool) {
}
// Read input data into a histogram set by iterating over input files
// given in the metadata file
pub fn read_data(cfg: &Config) -> Result<Dataset> {
let mut bias_pos: Vec<f64> = Vec::new();
let mut bias_fc: Vec<f64> = Vec::new();
let mut histograms: Vec<Histogram> = Vec::new();
// given in the metadata file. This generates at least one Dataset,
// or multiple Datasets if convdt is set in the config
pub fn read_data(cfg: &Config) -> Result<Vec<Dataset>> {
let mut bias_pos: Vec<f64> = Vec::new();
let mut bias_fc: Vec<f64> = Vec::new();
let mut timeseries_lengths: Vec<usize> = Vec::new();
let mut paths = Vec::new();
let kT = cfg.temperature * k_B;
// Boundaries of individual histograms if convdt is set.
let dataset_boundaries: Vec<(f64, f64)> = get_convdt_boundaries(cfg.start, cfg.end, cfg.convdt);
let num_datasets = dataset_boundaries.len();
// for each timeseries, histograms are build for slices according to
// start..convdt, start..2*convdt, ...
let mut histograms = vec![Vec::new(); dataset_boundaries.len()];
let kT = cfg.temperature * k_B;
let bin_width: Vec<f64> = (0..cfg.dimens).map(|idx| {
(cfg.hist_max[idx] - cfg.hist_min[idx])/(cfg.num_bins[idx] as f64)
}).collect();
let num_bins = cfg.num_bins.iter().product();
let num_bins: usize = cfg.num_bins.iter().product();
let dimens_length = cfg.num_bins.clone();
let f = File::open(&cfg.metadata_file).chain_err(|| "Failed to open metadata file")?;
@@ -45,30 +55,18 @@ pub fn read_data(cfg: &Config) -> Result<Dataset> {
// read each metadata file line and parse it
for (line_num,l) in buf.lines().enumerate() {
let line = l.chain_err(|| "Failed to read line")?;
let line = l.chain_err(|| "Failed to read line")?;
// skip comments and empty lines
if line.starts_with('#') || line.is_empty() {
continue;
}
continue;
}
let split: Vec<&str> = line.split_whitespace().collect();
let split: Vec<&str> = line.split_whitespace().collect();
if split.len() < 1 + cfg.dimens * 2 {
bail!(format!("Wrong number of columns in line {} of metadata file. Empty Line?", line_num+1));
}
// parse histogram data
let path = get_relative_path(&cfg.metadata_file, split[0]);
let (h, timeseries_inital_length) = read_window_file(&path, cfg)
.chain_err(|| format!("Failed to parse process data file {}", &path))?;
if h.num_points == 0 {
bail!(format!("No data points in histogram boundaries: {}", &path))
}
histograms.push(h);
timeseries_lengths.push(timeseries_inital_length);
vprintln(format!("{}, {} data points added.", &path,
histograms.last().unwrap().num_points), cfg.verbose);
// parse bias force constants and positions
for val in split.iter().skip(1).take(cfg.dimens) {
let pos = val.parse()
@@ -80,12 +78,79 @@ pub fn read_data(cfg: &Config) -> Result<Dataset> {
.chain_err(|| format!("Failed to read bias fc in line {} of metadata file", line_num+1))?;
bias_fc.push(fc);
}
// parse histogram data
let path = get_relative_path(&cfg.metadata_file, split[0]);
paths.push(path.clone());
let (timeseries, timeseries_initial_lengths) = read_window_file(&path, cfg)
.chain_err(|| format!("Failed to read time series from {}", &path))?;
timeseries_lengths.push(timeseries_initial_lengths);
for (idx, interval) in dataset_boundaries.iter().enumerate() {
// build histogram for slice start.._stop
let (start, stop) = interval;
let timeseries_mask: Vec<bool> = (0..timeseries[0].len()).map(|i| {
is_in_time_boundaries(timeseries[0][i], *start, *stop)
}).collect();
let hist = build_histogram_from_timeseries(&timeseries, &timeseries_mask, cfg);
histograms[idx].push(hist);
if (cfg.convdt == 0.00) || idx+1 == num_datasets {
vprintln(format!("{}, {} data points added.",
&path, histograms[idx].last().unwrap().num_points), cfg.verbose);
break
}
}
}
if !histograms.is_empty() {
// Datasets are created from histograms.
// Empty histograms result in an error when its the final dataset, and a warning otherwise.
vprintln(format!("Generating {} datasets from histograms.", num_datasets), cfg.verbose);
let datasets: Vec<Dataset> = histograms.into_iter().enumerate().map(|(dataset_idx, dataset_histograms)| {
for (hs, path) in dataset_histograms.iter().zip(&paths) {
if hs.num_points == 0 {
let warning = format!("No data points for interval {}-{} in histogram boundaries: {}.",
dataset_boundaries[dataset_idx].0, dataset_boundaries[dataset_idx].1 ,&path);
if dataset_idx+1 == num_datasets {
let warning = warning + " This is the final dataset.";
if cfg.ignore_empty {
eprintln!("{}", warning);
} else {
bail!(warning);
}
} else {
eprintln!("{}", warning);
}
}
}
Ok(Dataset::new(num_bins, dimens_length.clone(), bin_width.clone(),
cfg.hist_min.clone(), cfg.hist_max.clone(), bias_pos.clone(),
bias_fc.clone(), kT, dataset_histograms, cfg.cyclic))
}).collect::<Result<Vec<Dataset>>>().chain_err(|| "Failed to create datasets.")?;
if datasets.is_empty() {
bail!("No datasets created.")
} else if datasets[0].histograms.is_empty() {
bail!("Dataset has no associated data points.")
} else {
if datasets.len() > 1 {
println!("Datasets:");
println!("Dataset\t\tTime interval\t\tWindows\t\tN_total");
for (idx, dataset) in datasets.iter().enumerate() {
let n: u32 = dataset.histograms.iter().map(|h| h.num_points).sum();
let mut stop = cfg.start+cfg.convdt*(idx+1) as f64;
if stop > cfg.end {
stop = cfg.end;
}
println!("{:?}\t\t{:?}-{:?}\t\t{:?}\t\t{:?}", idx+1, cfg.start, stop, dataset.histograms.len(), n);
}
}
let histograms = &datasets.last().unwrap().histograms;
if cfg.uncorr {
println!("Timeseries Correlation");
println!();
println!("Timeseries Correlation:");
println!("Window\t\tN\t\tN_uncorr\tN/N_uncorr");
for (idx, (n, h)) in timeseries_lengths.iter().zip(histograms.iter()).enumerate() {
println!("{:?}\t\t{:?}\t\t{:?}\t\t{:.2}",
@@ -94,15 +159,64 @@ pub fn read_data(cfg: &Config) -> Result<Dataset> {
let total_n = timeseries_lengths.iter().sum::<usize>() as f64;
let total_h = histograms.iter().map(|h| h.num_points).sum::<u32>() as f64;
println!("\t\t\t\t\tTotal:\t{:.2}", total_h/total_n);
}
Ok(Dataset::new(num_bins, dimens_length, bin_width, cfg.hist_min.clone(), cfg.hist_max.clone(), bias_pos, bias_fc, kT, histograms, cfg.cyclic))
} else {
bail!("Histogram has no datapoints.")
Ok(datasets)
}
}
// builds a time boundaries for datasets from convdt, start and end
fn get_convdt_boundaries(start: f64, end: f64, convdt: f64) -> Vec<(f64, f64)> {
if convdt == 0.0 {
vec![(start, end)]
} else {
let intervals: usize = ((end - start) / convdt).ceil() as usize;
(1..intervals+1).map(|i| {
let interval_end = i as f64 * convdt + start;
if interval_end > end {
end
} else {
interval_end
}
}).map(|interval_end| { (start, interval_end) }).collect()
}
}
// build a histogram from a timeseries
// mask is used to filter the timeseries for selected frames
fn build_histogram_from_timeseries(timeseries: &[Vec<f64>], mask: &[bool],
cfg: &Config) -> Histogram {
// total number of bins is the product of all dimensions length
let total_bins = cfg.num_bins.iter().product();
// bin width for each dimension: (max-min)/bins
let bin_width: Vec<f64> = (0..cfg.dimens).map(|idx| {
(cfg.hist_max[idx] - cfg.hist_min[idx])/(cfg.num_bins[idx] as f64)
}).collect();
// build histogram for slice start..convdt_stop
let mut hist = vec![0.0; total_bins];
for i in (0..timeseries[0].len()).filter(|i| mask[*i]) {
let mut values: Vec<f64> = vec![f64::NAN; cfg.dimens+1];
for j in 0..values.len() {
values[j] = timeseries[j][i];
}
if is_in_hist_boundaries(&values[1..], cfg) {
let bin_indeces: Vec<usize> = (0..cfg.dimens).map(|dimen: usize| {
let val = values[dimen+1];
((val - cfg.hist_min[dimen]) / bin_width[dimen]) as usize
}).collect();
let index = flat_index(&bin_indeces, &cfg.num_bins);
hist[index] += 1.0;
}
}
let num_points: f64 = hist.iter().sum();
Histogram::new(num_points as u32, hist)
}
// transforms a multidimensional index into a one dimensional index
// indeces: multidimensional indeces
// lengths: length of the matrix in each dimension
@@ -125,50 +239,40 @@ fn is_in_hist_boundaries(values: &[f64], cfg: &Config) -> bool {
}
// returns true given time in inside the time boundaries defined by cfg
fn is_in_time_boundaries(time: f64, cfg: &Config) -> bool {
if cfg.start <= time && time <= cfg.end {
fn is_in_time_boundaries(time: f64, start: f64, end: f64) -> bool {
if start <= time && time <= end {
return true
}
false
}
// parse a time series file into a histogram
fn read_window_file(window_file: &str, cfg: &Config) -> Result<(Histogram, usize)> {
// total number of bins is the product of all dimensions length
let total_bins = cfg.num_bins.iter().product();
let mut hist = vec![0.0; total_bins];
// bin width for each dimension: (max-min)/bins
let bin_width: Vec<f64> = (0..cfg.dimens).map(|idx| {
(cfg.hist_max[idx] - cfg.hist_min[idx])/(cfg.num_bins[idx] as f64)
}).collect();
// parse a time series file
fn read_window_file(window_file: &str, cfg: &Config) -> Result<(Vec<Vec<f64>>, usize)> {
let mut timeseries: Vec<Vec<f64>> = read_timeseries(window_file, cfg)?;
let timeseries_inital_length = timeseries[0].len();
// filter the timeseries based on start/end parameters
let time_series_mask: Vec<bool> = timeseries[0].iter()
.map(|t| is_in_time_boundaries(*t, cfg.start, cfg.end)).collect();
timeseries = timeseries.into_iter().map(|ts| {
ts.into_iter().zip(time_series_mask.iter()).filter_map(|(val, mask)| {
if *mask {
Some(val)
} else {
None
}
}).collect()
}).collect::<Vec<Vec<f64>>>();
let timeseries_inital_length = timeseries[0].len();
if cfg.uncorr {
timeseries = uncorrelate(timeseries, cfg);
}
for i in 0..timeseries[0].len() {
let mut values: Vec<f64> = vec![f64::NAN; cfg.dimens+1];
for j in 0..values.len() {
values[j] = timeseries[j][i];
}
if is_in_hist_boundaries(&values[1..], cfg) && is_in_time_boundaries(values[0], cfg) {
let bin_indeces: Vec<usize> = (0..cfg.dimens).map(|dimen: usize| {
let val = values[dimen+1];
((val - cfg.hist_min[dimen]) / bin_width[dimen]) as usize
}).collect();
let index = flat_index(&bin_indeces, &cfg.num_bins);
hist[index] += 1.0;
}
if timeseries[0].is_empty() && !cfg.ignore_empty {
bail!("Time series is empty")
}
let num_points: f64 = hist.iter().sum();
Ok((Histogram::new(num_points as u32, hist), timeseries_inital_length))
Ok((timeseries, timeseries_inital_length))
}
// Read a multidimensional timeseries
@@ -245,14 +349,24 @@ fn uncorrelate(timeseries: Vec<Vec<f64>>, cfg: &Config) -> Vec<Vec<f64>> {
}
// Write WHAM calculation results to out_file.
pub fn write_results(out_file: &str, ds: &Dataset, free: &[f64],
free_std: &[f64], prob: &[f64], prob_std: &[f64]) -> Result<()> {
let output = File::create(out_file)
pub fn write_results(out_file: &str, append: bool, ds: &Dataset, free: &[f64],
free_std: &[f64], prob: &[f64], prob_std: &[f64], index: Option<usize>) -> Result<()> {
if !append && Path::new(out_file).exists() {
std::fs::remove_file(out_file).chain_err(|| "Failed to delete file.")?;
}
let output = OpenOptions::new().write(true)
.append(true)
.create(true)
.open(out_file)
.chain_err(|| format!("Failed to create file with path {}", out_file))?;
let mut buf = BufWriter::new(output);
let header: String = (0..ds.dimens_lengths.len()).map(|d| format!("coord{}", d+1))
.collect::<Vec<String>>().join(" ");
if let Some(index) = index {
writeln!(buf, "#Dataset {}", index).unwrap();
}
writeln!(buf, "#{} Free Energy +/- Probability +/-", header).unwrap();
for bin in 0..free.len() {
@@ -290,6 +404,8 @@ mod tests {
start: 0.0,
end: 1e+20,
uncorr: false,
convdt: 0.0,
ignore_empty: false,
}
}
@@ -297,7 +413,9 @@ mod tests {
fn read_window_file() {
let f = "example/1d_cyclic/COLVAR+0.0.xvg";
let cfg = cfg();
let (h, timeseries_inital_length) = super::read_window_file(&f, &cfg).unwrap();
let (timeseries, timeseries_inital_length) = super::read_window_file(&f, &cfg).unwrap();
let mask = vec![true; timeseries[0].len()];
let h = build_histogram_from_timeseries(&timeseries, &mask, &cfg);
println!("{:?}", h);
assert_eq!(5000, timeseries_inital_length);
assert_eq!(5000, h.num_points);
@@ -326,14 +444,14 @@ mod tests {
assert!(ts[0].len() == 5000);
println!("{:?}", ts);
for (actual, expected) in ts[1].iter().zip(expected.iter()) {
assert!((actual-expected).abs() < 0.001, format!("{:?} != {:?}", actual, expected));
assert!((actual-expected).abs() < 0.001, "{:?} != {:?}", actual, expected);
}
}
#[test]
fn read_data() {
let cfg = cfg();
let ds = super::read_data(&cfg).unwrap();
let ds = &super::read_data(&cfg).unwrap()[0];
println!("{:?}", ds);
assert_eq!(25, ds.num_windows);
assert_eq!(cfg.num_bins.len(), ds.dimens_lengths.len());
@@ -342,6 +460,99 @@ mod tests {
assert_eq!(25, ds.histograms.len())
}
#[test]
fn read_data_empty() {
let mut cfg = cfg();
cfg.metadata_file = "tests/data/metadata_convdt.dat".to_string();
cfg.start = 2.5;
cfg.end = 9.0;
cfg.ignore_empty = false;
// should throw an error since one first timeseries ends at 2
let ds = super::read_data(&cfg);
if ds.is_ok() {
panic!()
}
// should not throw an error because ignore_empty is set
cfg.ignore_empty = true;
let ds = super::read_data(&cfg);
if ds.is_err() {
panic!()
}
}
// test if convdt results in correct parsing
// 6 timeseries are loaded ranging from:
// 1. 0-10, 500 datapoints
// 2. 0-2, 100 datapoints
// 3. 0-5, 250 datapoints
// 4. 5-10, 250 datapoints
// 5. 7-10, 150 datapoints
// 6 2-7, 250 datapoints
#[test]
fn read_data_convdt() {
let mut cfg = cfg();
cfg.metadata_file = "tests/data/metadata_convdt.dat".to_string();
cfg.convdt = 2.0;
cfg.start = 0.0;
cfg.end = 9.0;
let dss = super::read_data(&cfg).unwrap();
assert_eq!(5, dss.len());
for ds in &dss {
assert_eq!(6, ds.num_windows);
assert_eq!(6, ds.histograms.len());
}
let hist_points: Vec<u32> = dss.iter().map(|ds| {
ds.histograms.iter().map(|h| h.num_points).sum()
}).collect();
let expected_hist_points = vec![
300, // 0-2: 100+100+100+0+0
600, // 0-4: 200+100+200+0+0+100
900, // 0-6: 300+100+250+50+0+200
1200, // 0-8: 400+100+250+150+50+250
1350, // 0-9: 450+100+250+200+100+250
];
for (expected, actual) in expected_hist_points.iter().zip(hist_points.iter()) {
assert_eq!(expected, actual);
}
}
// test convdt with a single time series
#[test]
fn read_data_convdt_single() {
let mut cfg = cfg();
cfg.metadata_file = "tests/data/metadata_convdt_single.dat".to_string();
cfg.convdt = 2.0;
cfg.start = 0.0;
cfg.end = 9.0;
let dss = super::read_data(&cfg).unwrap();
assert_eq!(5, dss.len());
for ds in &dss {
assert_eq!(1, ds.num_windows);
assert_eq!(1, ds.histograms.len());
}
let hist_points: Vec<u32> = dss.iter().map(|ds| {
ds.histograms.iter().map(|h| h.num_points).sum()
}).collect();
let expected_hist_points = vec![
0, // 0-2
100, // 0-4
200, // 0-6
250, // 0-8
250, // 0-9
];
for (expected, actual) in expected_hist_points.iter().zip(hist_points.iter()) {
assert_eq!(expected, actual);
}
}
#[test]
fn get_relative_path() {
let path1 = "path/to/some_file.dat";
@@ -352,4 +563,42 @@ mod tests {
let relative3 = super::get_relative_path(&path1, &path3);
assert_eq!("path/to/subfolder/another_file.dat" ,relative3);
}
}
#[test]
fn is_in_time_boundaries() {
let start = 10.0;
let end = 20.0;
assert!(super::is_in_time_boundaries(15.0, start, end));
assert!(super::is_in_time_boundaries(10.0, start, end));
assert!(super::is_in_time_boundaries(20.0, start, end));
assert!(!super::is_in_time_boundaries(9.9999999, start, end));
assert!(!super::is_in_time_boundaries(20.000001, start, end));
}
#[test]
fn get_convdt_boundaries() {
let test = super::get_convdt_boundaries(10.0, 20.0, 10.0);
println!("{:?}", test);
assert!(test.len() == 1);
assert_approx_eq!(test[0].0, 10.0);
assert_approx_eq!(test[0].1, 20.0);
let test = super::get_convdt_boundaries(10.0, 20.0, 5.0);
println!("{:?}", test);
assert!(test.len() == 2);
assert_approx_eq!(test[0].0, 10.0);
assert_approx_eq!(test[0].1, 15.0);
assert_approx_eq!(test[1].0, 10.0);
assert_approx_eq!(test[1].1, 20.0);
let test = super::get_convdt_boundaries(5.0, 30.0, 10.0);
println!("{:?}", test);
assert!(test.len() == 3);
assert_approx_eq!(test[0].0, 5.0);
assert_approx_eq!(test[0].1, 15.0);
assert_approx_eq!(test[1].0, 5.0);
assert_approx_eq!(test[1].1, 25.0);
assert_approx_eq!(test[2].0, 5.0);
assert_approx_eq!(test[2].1, 30.0);
}
}

View File

@@ -31,32 +31,36 @@ static k_B: f64 = 0.008_314_462_1; // kJ/mol*K
// Application config
#[derive(Debug)]
pub struct Config {
pub metadata_file: String,
pub hist_min: Vec<f64>,
pub hist_max: Vec<f64>,
pub num_bins: Vec<usize>,
pub dimens: usize,
pub verbose: bool,
pub tolerance: f64,
pub max_iterations: usize,
pub temperature: f64,
pub cyclic: bool,
pub output: String,
pub bootstrap: usize,
pub metadata_file: String,
pub hist_min: Vec<f64>,
pub hist_max: Vec<f64>,
pub num_bins: Vec<usize>,
pub dimens: usize,
pub verbose: bool,
pub tolerance: f64,
pub max_iterations: usize,
pub temperature: f64,
pub cyclic: bool,
pub output: String,
pub bootstrap: usize,
pub bootstrap_seed: u64,
pub start: f64,
pub end: f64,
pub uncorr: bool,
pub convdt: f64,
pub ignore_empty: bool
}
impl fmt::Display for Config {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "Metadata={}, hist_min={:?}, hist_max={:?}, bins={:?},
verbose={}, tolerance={}, iterations={}, temperature={},
cyclic={:?}, uncorr={:?}, bootstrap={:?}, seed={:?}",
cyclic={:?}, uncorr={:?}, bootstrap={:?}, seed={:?},
uncorr={:?}, start={:?}, end={:?}, convdt={:?}, ignore_empty={:?}",
self.metadata_file, self.hist_min, self.hist_max, self.num_bins,
self.verbose, self.tolerance, self.max_iterations, self.temperature,
self.cyclic, self.uncorr, self.bootstrap, self.bootstrap_seed)
self.cyclic, self.uncorr, self.bootstrap, self.bootstrap_seed,
self.uncorr, self.start, self.end, self.convdt, self.ignore_empty)
}
}
@@ -66,7 +70,7 @@ impl fmt::Display for Config {
fn is_converged(old_F: &[f64], new_F: &[f64], tolerance: f64) -> bool {
// calculates abs diff between every old and new F and checks if any
// is larger than tolerance
!new_F.iter()
!new_F.iter()
.zip(old_F.iter())
.map(|x| { (x.0-x.1).abs() })
.any(|diff| { diff > tolerance })
@@ -77,13 +81,13 @@ fn is_converged(old_F: &[f64], new_F: &[f64], tolerance: f64) -> bool {
// P(x) = \frac {\sum_{i=1}^N{n_i(x)}}
// {\sum_{i=1}^N{ N_i exp(\beta [F_i - U_{bias,i}(x)])}}
fn calc_bin_probability(bin: usize, dataset: &Dataset, F: &[f64]) -> f64 {
let mut denom_sum: f64 = 0.0;
let bin_count: f64 = dataset.get_weighted_bin_count(bin);
let mut denom_sum: f64 = 0.0;
let bin_count: f64 = dataset.get_weighted_bin_count(bin);
for (window, h) in dataset.histograms.iter().enumerate() {
let bias = dataset.get_bias(bin, window);
let bias = dataset.get_bias(bin, window);
denom_sum += (dataset.weights[window] * h.num_points as f64)
* bias * F[window];
}
}
bin_count / denom_sum
}
@@ -105,26 +109,26 @@ fn calc_window_F(window: usize, dataset: &Dataset, P: &[f64]) -> f64 {
// offsets F based on previous bias offsets F_prev. This updates the values in
// vectors F and P.
fn perform_wham_iteration(dataset: &Dataset, F_prev: &[f64], F: &mut Vec<f64>, P: &mut Vec<f64>) {
// Update P
// Update P
// evaluate first WHAM equation for each bin to
// estimate probabilities based on previous offsets (F_prev))
// estimate probabilities based on previous offsets (F_prev))
(0..dataset.num_bins).into_par_iter()
.map(|bin| { calc_bin_probability(bin, dataset, F_prev) })
.collect_into_vec(P);
.map(|bin| { calc_bin_probability(bin, dataset, F_prev) })
.collect_into_vec(P);
// Update F
// evaluate second WHAM equation for each window to
// estimate new bias offsets from propabilities
(0..dataset.num_windows).into_par_iter()
.map(|window| {calc_window_F(window, dataset, P)} )
.collect_into_vec(F);
// evaluate second WHAM equation for each window to
// estimate new bias offsets from propabilities
(0..dataset.num_windows).into_par_iter()
.map(|window| {calc_window_F(window, dataset, P)} )
.collect_into_vec(F);
}
// Full WHAM calculation. Calls `perform_wham_iteration` until convergence
// criteria are met or max iterations reached.
pub fn perform_wham(cfg: &Config, dataset: &Dataset)
-> Result<(Vec<f64>, Vec<f64>, Vec<f64>)> {
// allocate required vectors.
// allocate required vectors.
// bin probability
let mut P: Vec<f64> = vec![f64::NAN; dataset.num_bins];
@@ -173,54 +177,67 @@ pub fn perform_wham(cfg: &Config, dataset: &Dataset)
}
if iteration == cfg.max_iterations {
bail!("WHAM not converged! (max iterations reached)");
bail!("WHAM not converged! (max iterations reached)");
}
Ok((P, F, F_prev))
Ok((P, F, F_prev))
}
pub fn run(cfg: &Config) -> Result<()>{
println!("Supplied WHAM options: {}", &cfg);
println!("Reading input files.");
let dataset = io::read_data(&cfg).chain_err(|| "Failed to create histogram.")?;
println!("{}", &dataset);
let datasets = io::read_data(&cfg).chain_err(|| "Failed to read data.")?;
let (P, F, F_prev) = perform_wham(&cfg, &dataset)?;
println!("WHAM converged.");
for (idx, dataset) in datasets.iter().enumerate() {
if datasets.len() > 1 {
println!("Dataset {}/{}: {}", idx+1, datasets.len(), &dataset);
}
else {
println!("{}", &dataset);
}
let (P, F, F_prev) = perform_wham(&cfg, &dataset)?;
println!("WHAM converged.");
let (P_std, free_energy_std) = if cfg.bootstrap > 0 {
println!("Bootstrapping..");
error_analysis::run_bootstrap(&cfg, dataset.clone(), cfg.bootstrap)
} else {
(vec![0.0; P.len()], vec![0.0; P.len()])
};
let (P_std, free_energy_std) = if cfg.bootstrap > 0 {
println!("Bootstrapping..");
error_analysis::run_bootstrap(&cfg, dataset.clone(), cfg.bootstrap)
} else {
(vec![0.0; P.len()], vec![0.0; P.len()])
};
// calculate free energy and dump state
println!("Finished. Dumping final PMF");
let free_energy = calc_free_energy(&dataset, &P);
dump_state(&dataset, &F, &F_prev, &P, &P_std, &free_energy, &free_energy_std);
io::write_results(&cfg.output, &dataset, &free_energy, &free_energy_std, &P, &P_std)
.chain_err(|| "Could not write results to output file")?;
// calculate free energy and dump state
println!("Finished. Dumping PMF");
let free_energy = calc_free_energy(&dataset, &P);
dump_state(&dataset, &F, &F_prev, &P, &P_std, &free_energy, &free_energy_std);
let append = idx > 0 && datasets.len() > 1;
let index = if datasets.len() > 1 {
Some(idx)
} else {
None
};
io::write_results(&cfg.output, append, &dataset, &free_energy, &free_energy_std, &P, &P_std, index)
.chain_err(|| "Could not write results to output file")?;
}
Ok(())
}
// get average difference between two bias offset sets
fn diff_avg(F: &[f64], F_prev: &[f64]) -> f64 {
let mut F_sum: f64 = 0.0;
for i in 0..F.len() {
F_sum += (F[i]-F_prev[i]).abs()
}
F_sum / F.len() as f64
let mut F_sum: f64 = 0.0;
for i in 0..F.len() {
F_sum += (F[i]-F_prev[i]).abs()
}
F_sum / F.len() as f64
}
// calculate the normalized free energy from probability values
fn calc_free_energy(dataset: &Dataset, P: &[f64]) -> Vec<f64> {
let mut minimum = f64::MAX;
let mut free_energy: Vec<f64> = P.iter()
let mut free_energy: Vec<f64> = P.iter()
.map(|p| {
-dataset.kT * p.ln()
})
@@ -240,28 +257,28 @@ fn calc_free_energy(dataset: &Dataset, P: &[f64]) -> Vec<f64> {
// Print the current WHAM iteration state. Dumps the PMF and associated vectors
fn dump_state(dataset: &Dataset, F: &[f64], F_prev: &[f64], P: &[f64],
P_std: &[f64], A: &[f64], A_std: &[f64]) {
// TODO fix output of F/F_prev
let out = std::io::stdout();
// TODO fix output of F/F_prev
let out = std::io::stdout();
let mut lock = out.lock();
writeln!(lock, "# PMF").unwrap();
writeln!(lock, "#bin\t\tFree Energy\t\t+/-\t\tP(x)\t\t+/-").unwrap();
for bin in 0..dataset.num_bins {
writeln!(lock, "{:9.5}\t{:9.5}\t{:9.5}\t{:9.5}\t{:9.5}",
writeln!(lock, "# PMF").unwrap();
writeln!(lock, "#bin\t\tFree Energy\t\t+/-\t\tP(x)\t\t+/-").unwrap();
for bin in 0..dataset.num_bins {
writeln!(lock, "{:9.5}\t{:9.5}\t{:9.5}\t{:9.5}\t{:9.5}",
bin, A[bin], A_std[bin], P[bin], P_std[bin]).unwrap();
}
writeln!(lock, "# Bias offsets").unwrap();
writeln!(lock, "#Window\t\tF\t\tF_prev").unwrap();
for window in 0..dataset.num_windows {
writeln!(lock, "{}\t{:9.5}\t{:8.8}",
}
writeln!(lock, "# Bias offsets").unwrap();
writeln!(lock, "#Window\t\tF\t\tF_prev").unwrap();
for window in 0..dataset.num_windows {
writeln!(lock, "{}\t{:9.5}\t{:8.8}",
window, F[window], (F[window]-F_prev[window]).abs()).unwrap();
}
}
}
#[cfg(test)]
mod tests {
use super::histogram::{Dataset,Histogram};
use std::f64;
use super::histogram::{Dataset,Histogram};
use std::f64;
use super::k_B;
macro_rules! assert_delta {
@@ -271,65 +288,65 @@ mod tests {
}
fn create_test_dataset() -> Dataset {
let h1 = Histogram::new(10, vec![0.0, 1.0, 1.0, 8.0, 0.0]);
let h2 = Histogram::new(10, vec![0.0, 0.0, 8.0, 1.0, 1.0]);
Dataset::new(5, vec![5], vec![1.0], vec![0.0], vec![4.0],
fn create_test_dataset() -> Dataset {
let h1 = Histogram::new(10, vec![0.0, 1.0, 1.0, 8.0, 0.0]);
let h2 = Histogram::new(10, vec![0.0, 0.0, 8.0, 1.0, 1.0]);
Dataset::new(5, vec![5], vec![1.0], vec![0.0], vec![4.0],
vec![1.0, 1.0], vec![10.0, 10.0], 300.0*k_B, vec![h1, h2], false)
}
#[test]
fn is_converged() {
let new = vec![1.0,1.0];
let old = vec![0.95, 1.0];
let tolerance = 0.1;
let converged = super::is_converged(&old, &new, tolerance);
assert!(converged);
let old = vec![0.8, 1.0];
let converged = super::is_converged(&old, &new, tolerance);
assert!(!converged);
}
}
#[test]
fn calc_bin_probability() {
let dataset = create_test_dataset();
let F = vec![1.0; dataset.num_bins] ;
fn is_converged() {
let new = vec![1.0,1.0];
let old = vec![0.95, 1.0];
let tolerance = 0.1;
let converged = super::is_converged(&old, &new, tolerance);
assert!(converged);
let old = vec![0.8, 1.0];
let converged = super::is_converged(&old, &new, tolerance);
assert!(!converged);
}
#[test]
fn calc_bin_probability() {
let dataset = create_test_dataset();
let F = vec![1.0; dataset.num_bins] ;
let expected = vec!(0.0, 0.082_529_668_703_131_6, 40.923_558_470_974_93,
124_226.700_033_77, 2_308_526_035.528_374_7);
expected.iter().enumerate().for_each(|(i, exp)| {
let p = super::calc_bin_probability(i, &dataset, &F);
assert_delta!(exp, p, 0.000_000_1);
let p = super::calc_bin_probability(i, &dataset, &F);
assert_delta!(exp, p, 0.000_000_1);
})
}
#[test]
fn calc_bias_offset() {
let dataset = create_test_dataset();
let probability = vec!(0.0, 0.1, 0.2, 0.3, 0.4);
fn calc_bias_offset() {
let dataset = create_test_dataset();
let probability = vec!(0.0, 0.1, 0.2, 0.3, 0.4);
let expected = vec!(15.927_477_169_990_633, 15.927_477_169_990_633);
expected.iter().enumerate().for_each(|(i, exp)| {
let F = super::calc_window_F(i, &dataset, &probability);
assert_delta!(exp, F, 0.000_000_1);
})
}
}
#[test]
fn perform_wham_iteration() {
let dataset = create_test_dataset();
let prev_F = vec![1.0; dataset.num_windows];
let mut F = vec![f64::NAN; dataset.num_windows];
let mut P = vec![f64::NAN; dataset.num_bins];
super::perform_wham_iteration(&dataset, &prev_F, &mut F, &mut P);
#[test]
fn perform_wham_iteration() {
let dataset = create_test_dataset();
let prev_F = vec![1.0; dataset.num_windows];
let mut F = vec![f64::NAN; dataset.num_windows];
let mut P = vec![f64::NAN; dataset.num_bins];
super::perform_wham_iteration(&dataset, &prev_F, &mut F, &mut P);
let expected_F = vec!(1.0, 1.0);
let expected_P = vec!(0.0, 0.082_529_668_703_131_6, 40.923_558_470_974_93,
let expected_P = vec!(0.0, 0.082_529_668_703_131_6, 40.923_558_470_974_93,
124_226.700_033_77, 2_308_526_035.528_374_7);
for bin in 0..dataset.num_bins {
assert_delta!(expected_P[bin], P[bin], 0.01)
}
for window in 0..dataset.num_windows {
assert_delta!(expected_F[window], F[window], 0.01)
}
}
for bin in 0..dataset.num_bins {
assert_delta!(expected_P[bin], P[bin], 0.01)
}
for window in 0..dataset.num_windows {
assert_delta!(expected_F[window], F[window], 0.01)
}
}
}

View File

@@ -2,6 +2,8 @@ extern crate wham;
#[macro_use]
extern crate clap;
extern crate rand;
#[macro_use]
extern crate error_chain;
use rand::prelude::*;
use clap::App;
@@ -11,20 +13,20 @@ use std::process;
// Parse command line arguments into a Config struct
fn cli() -> Result<Config> {
let yaml = load_yaml!("cli.yml");
let matches = App::from_yaml(yaml).get_matches();
let metadata_file = matches.value_of("metadata").unwrap().to_string();
let verbose: bool = matches.is_present("verbose");
let temperature: f64 = matches.value_of("temperature").unwrap().parse()
.chain_err(|| "Cannot read temperature.")?;
let tolerance: f64 = matches.value_of("tolerance").unwrap_or("0.000001").parse()
.chain_err(|| "Cannot read tolerance.")?;
let max_iterations: usize = matches.value_of("iterations").unwrap_or("100000").parse()
.chain_err(|| "Cannot parse iterations.")?;
let output = matches.value_of("output").unwrap_or("wham.out").to_string();
let yaml = load_yaml!("cli.yml");
let matches = App::from_yaml(yaml).get_matches();
let metadata_file = matches.value_of("metadata").unwrap().to_string();
let verbose: bool = matches.is_present("verbose");
let temperature: f64 = matches.value_of("temperature").unwrap().parse()
.chain_err(|| "Cannot read temperature.")?;
let tolerance: f64 = matches.value_of("tolerance").unwrap_or("0.000001").parse()
.chain_err(|| "Cannot read tolerance.")?;
let max_iterations: usize = matches.value_of("iterations").unwrap_or("100000").parse()
.chain_err(|| "Cannot parse iterations.")?;
let output = matches.value_of("output").unwrap_or("wham.out").to_string();
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| {
if x.to_ascii_lowercase() == "pi" {
std::f64::consts::PI
@@ -34,7 +36,7 @@ fn cli() -> Result<Config> {
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| {
if x.to_ascii_lowercase() == "pi" {
std::f64::consts::PI
@@ -44,10 +46,10 @@ fn cli() -> Result<Config> {
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();
let bootstrap: usize = matches.value_of("bootstrap").unwrap_or("0").parse()
.chain_err(|| "Cannot parse bootstrap iteration.")?;
let bootstrap: usize = matches.value_of("bootstrap").unwrap_or("0").parse()
.chain_err(|| "Cannot parse bootstrap iteration.")?;
let bootstrap_seed: u64 = matches.value_of("bootstrap_seed")
.unwrap_or({
let mut rng = rand::thread_rng();
@@ -68,21 +70,28 @@ fn cli() -> Result<Config> {
}
let dimens = num_bins.len();
if matches.is_present("convdt") && (!matches.is_present("start") || !matches.is_present("end")) {
bail!("--convdt requires --start and --end to be set.")
}
let convdt: f64 = matches.value_of("convdt").unwrap_or("0").parse()
.chain_err(|| "Cannot parse convdt.")?;
Ok(wham::Config{metadata_file, hist_min, hist_max, num_bins, dimens,
verbose, tolerance, max_iterations, temperature, cyclic, output,
bootstrap, bootstrap_seed, start, end, uncorr})
let ignore_empty: bool = matches.is_present("ignore_empty");
Ok(wham::Config{metadata_file, hist_min, hist_max, num_bins, dimens,
verbose, tolerance, max_iterations, temperature, cyclic, output,
bootstrap, bootstrap_seed, start, end, uncorr, convdt, ignore_empty})
}
fn main() {
let cfg = cli().expect("Failed to parse CLI.");
if let Err(error) = wham::run(&cfg) {
eprintln!("Error: {}", error);
let cfg = cli().expect("Failed to parse CLI.");
if let Err(error) = wham::run(&cfg) {
eprintln!("Error: {}", error);
for e in error.iter().skip(1) {
eprintln!("Reason: {}", e)
}
process::exit(1);
}
for e in error.iter().skip(1) {
eprintln!("Reason: {}", e)
}
process::exit(1);
}
}

View File

@@ -108,4 +108,20 @@ mod integration {
));
}
#[test]
fn convdt_needs_start_end() {
let output = get_command()
.args(&["--bins", "100", "--min", "-3.0", "--max", "3.0", "-T", "300"])
.args(&["-f", "tests/data/metadata_unparseable1.dat"])
.args(&["-o", "/dev/null"])
.args(&["--convdt", "100"])
.output()
.expect("failed to execute process");
let output = String::from_utf8_lossy(&output.stderr);
println!("{}", output);
assert!(output.to_string().contains(
"--convdt requires --start and --end to be set"
));
}
}

File diff suppressed because it is too large Load Diff

500
tests/data/COLVAR_0-10.xvg Normal file
View File

@@ -0,0 +1,500 @@
0.020000 -0.377860
0.040000 0.010992
0.060000 0.123074
0.080000 0.108291
0.100000 0.261607
0.120000 0.185592
0.140000 0.398266
0.160000 0.461779
0.180000 0.105976
0.200000 0.214612
0.220000 0.239492
0.240000 0.320299
0.260000 0.344827
0.280000 0.223717
0.300000 0.445152
0.320000 0.487640
0.340000 0.568231
0.360000 0.264504
0.380000 0.156700
0.400000 0.339014
0.420000 0.007749
0.440000 -0.024582
0.460000 -0.103746
0.480000 -0.238796
0.500000 0.267790
0.520000 -0.172984
0.540000 -0.162007
0.560000 -0.022318
0.580000 -0.274371
0.600000 -0.170447
0.620000 -0.464711
0.640000 -0.770842
0.660000 -0.160143
0.680000 -0.475005
0.700000 -0.445097
0.720000 -0.251824
0.740000 -0.399393
0.760000 -0.009600
0.780000 0.036937
0.800000 -0.288376
0.820000 0.088705
0.840000 0.035215
0.860000 0.026541
0.880000 0.041992
0.900000 -0.221743
0.920000 0.340514
0.940000 0.290576
0.960000 0.425674
0.980000 0.417250
1.000000 0.511139
1.020000 0.754747
1.040000 0.559245
1.060000 0.278543
1.080000 0.290714
1.100000 0.350660
1.120000 0.265198
1.140000 0.136869
1.160000 0.122245
1.180000 0.298347
1.200000 0.442561
1.220000 0.318732
1.240000 -0.009101
1.260000 0.210199
1.280000 0.092197
1.300000 -0.218855
1.320000 -0.258758
1.340000 -0.547873
1.360000 -0.310370
1.380000 -0.162075
1.400000 -0.425929
1.420000 -0.138428
1.440000 -0.157315
1.460000 -0.141138
1.480000 -0.127917
1.500000 -0.245431
1.520000 -0.346983
1.540000 -0.165304
1.560000 -0.503931
1.580000 -0.515063
1.600000 -0.155765
1.620000 -0.054631
1.640000 0.208200
1.660000 0.237158
1.680000 0.227077
1.700000 0.358599
1.720000 0.361749
1.740000 0.170592
1.760000 0.248700
1.780000 0.256466
1.800000 0.342915
1.820000 0.169221
1.840000 0.339560
1.860000 0.205654
1.880000 0.537767
1.900000 0.402014
1.920000 0.391279
1.940000 0.315378
1.960000 0.149920
1.980000 0.280272
2.000000 0.127339
2.020000 -0.111932
2.040000 0.259792
2.060000 -0.041852
2.080000 0.153340
2.100000 0.166558
2.120000 -0.227151
2.140000 0.170747
2.160000 -0.168786
2.180000 -0.309401
2.200000 -0.207106
2.220000 -0.595975
2.240000 -0.380839
2.260000 -0.384326
2.280000 -0.595164
2.300000 -0.115474
2.320000 -0.194623
2.340000 -0.165108
2.360000 -0.079131
2.380000 -0.248973
2.400000 -0.141384
2.420000 0.067492
2.440000 -0.167260
2.460000 0.069070
2.480000 0.109517
2.500000 0.275638
2.520000 0.409559
2.540000 0.407971
2.560000 0.480279
2.580000 0.612092
2.600000 0.678006
2.620000 0.390398
2.640000 0.480483
2.660000 0.382538
2.680000 0.351606
2.700000 0.242267
2.720000 0.124043
2.740000 0.006109
2.760000 0.224920
2.780000 0.103645
2.800000 0.136471
2.820000 0.047265
2.840000 0.072428
2.860000 0.083309
2.880000 -0.272198
2.900000 -0.255573
2.920000 -0.152599
2.940000 -0.291048
2.960000 -0.198565
2.980000 -0.269126
3.000000 -0.476225
3.020000 -0.155645
3.040000 -0.280627
3.060000 -0.127538
3.080000 0.012533
3.100000 -0.179725
3.120000 -0.216130
3.140000 -0.207261
3.160000 -0.551407
3.180000 0.039334
3.200000 -0.009344
3.220000 0.013060
3.240000 0.273527
3.260000 0.109360
3.280000 0.421753
3.300000 0.241420
3.320000 0.201920
3.340000 0.357590
3.360000 0.289825
3.380000 0.040550
3.400000 0.345033
3.420000 0.109547
3.440000 0.557827
3.460000 0.495151
3.480000 0.382503
3.500000 0.311630
3.520000 0.402886
3.540000 0.145753
3.560000 0.053371
3.580000 -0.099518
3.600000 -0.217586
3.620000 -0.078479
3.640000 -0.215597
3.660000 -0.102704
3.680000 -0.318363
3.700000 -0.113242
3.720000 -0.076240
3.740000 -0.188385
3.760000 -0.237573
3.780000 -0.225944
3.800000 -0.366487
3.820000 -0.335452
3.840000 -0.318478
3.860000 -0.352154
3.880000 -0.235007
3.900000 0.120242
3.920000 -0.198549
3.940000 0.079292
3.960000 0.211743
3.980000 0.180080
4.000000 0.214707
4.020000 0.021381
4.040000 0.081417
4.060000 0.114621
4.080000 0.011734
4.100000 -0.003705
4.120000 0.051130
4.140000 0.121488
4.160000 0.340722
4.180000 0.252438
4.200000 0.439041
4.220000 0.405294
4.240000 0.475172
4.260000 0.211356
4.280000 0.320336
4.300000 0.245725
4.320000 0.200433
4.340000 0.127897
4.360000 0.164240
4.380000 0.030642
4.400000 0.204649
4.420000 -0.031684
4.440000 -0.136474
4.460000 0.166935
4.480000 -0.205537
4.500000 0.020623
4.520000 -0.141182
4.540000 -0.006324
4.560000 -0.120097
4.580000 -0.141139
4.600000 -0.023482
4.620000 -0.263421
4.640000 -0.309596
4.660000 -0.053286
4.680000 -0.311061
4.700000 -0.197194
4.720000 -0.004616
4.740000 -0.197131
4.760000 0.040260
4.780000 -0.147501
4.800000 -0.232280
4.820000 -0.080091
4.840000 -0.025872
4.860000 0.069618
4.880000 0.132024
4.900000 0.109382
4.920000 0.317044
4.940000 0.238353
4.960000 0.391818
4.980000 0.352735
5.000000 0.346928
5.020000 0.559155
5.040000 0.324917
5.060000 0.384628
5.080000 0.437213
5.100000 0.500261
5.120000 0.524957
5.140000 0.318692
5.160000 0.407006
5.180000 0.386429
5.200000 0.121732
5.220000 0.103876
5.240000 -0.007759
5.260000 -0.228426
5.280000 0.091557
5.300000 -0.141686
5.320000 -0.175769
5.340000 0.056234
5.360000 -0.139847
5.380000 -0.248525
5.400000 -0.405083
5.420000 -0.543086
5.440000 -0.605228
5.460000 -0.453772
5.480000 -0.632332
5.500000 -0.278857
5.520000 -0.125809
5.540000 -0.307619
5.560000 -0.156702
5.580000 -0.225417
5.600000 -0.103164
5.620000 -0.179194
5.640000 -0.127734
5.660000 -0.188341
5.680000 0.143537
5.700000 0.047410
5.720000 0.233912
5.740000 0.342515
5.760000 0.480074
5.780000 0.526478
5.800000 0.599988
5.820000 0.428251
5.840000 0.408720
5.860000 0.501119
5.880000 0.229850
5.900000 0.255165
5.920000 0.084974
5.940000 0.230521
5.960000 0.289550
5.980000 0.387046
6.000000 0.244289
6.020000 0.402885
6.040000 0.273234
6.060000 0.239922
6.080000 -0.061710
6.100000 -0.188653
6.120000 -0.176610
6.140000 -0.539426
6.160000 -0.292322
6.180000 -0.368200
6.200000 -0.442046
6.220000 -0.086956
6.240000 -0.237524
6.260000 -0.109149
6.280000 0.114621
6.300000 -0.321428
6.320000 -0.323525
6.340000 -0.451779
6.360000 -0.619271
6.380000 -0.210074
6.400000 -0.308296
6.420000 -0.096123
6.440000 0.200226
6.460000 0.195091
6.480000 0.438811
6.500000 0.317047
6.520000 0.432486
6.540000 0.375387
6.560000 0.302796
6.580000 0.173397
6.600000 0.314706
6.620000 0.329726
6.640000 0.499638
6.660000 0.390596
6.680000 0.531012
6.700000 0.648674
6.720000 0.504828
6.740000 0.506630
6.760000 0.264208
6.780000 0.171029
6.800000 -0.042753
6.820000 -0.232043
6.840000 -0.121052
6.860000 -0.080382
6.880000 -0.214688
6.900000 -0.029242
6.920000 -0.100849
6.940000 -0.254431
6.960000 -0.294761
6.980000 -0.387433
7.000000 -0.435287
7.020000 -0.392397
7.040000 -0.361231
7.060000 -0.314569
7.080000 -0.418825
7.100000 -0.446802
7.120000 -0.107055
7.140000 -0.062352
7.160000 0.048612
7.180000 0.090056
7.200000 0.026421
7.220000 0.133539
7.240000 0.015399
7.260000 0.169799
7.280000 0.188015
7.300000 0.186057
7.320000 0.267611
7.340000 0.346012
7.360000 0.462420
7.380000 0.600556
7.400000 0.557739
7.420000 0.432258
7.440000 0.377746
7.460000 0.193769
7.480000 0.222955
7.500000 0.090057
7.520000 0.147336
7.540000 0.166292
7.560000 0.100436
7.580000 -0.021099
7.600000 -0.068353
7.620000 0.019654
7.640000 -0.089638
7.660000 -0.043250
7.680000 -0.303386
7.700000 -0.370787
7.720000 -0.534350
7.740000 -0.506331
7.760000 -0.465337
7.780000 -0.299286
7.800000 -0.128983
7.820000 -0.155927
7.840000 -0.185521
7.860000 -0.254707
7.880000 -0.052327
7.900000 -0.195514
7.920000 -0.097241
7.940000 -0.173111
7.960000 -0.146022
7.980000 -0.002634
8.000000 0.090475
8.020000 0.224838
8.040000 0.338389
8.060000 0.324804
8.080000 0.315508
8.100000 0.285864
8.120000 0.089370
8.140000 0.378119
8.160000 0.093042
8.180000 0.326371
8.200000 0.214992
8.220000 0.272968
8.240000 0.466140
8.260000 0.441360
8.280000 0.463138
8.300000 0.476466
8.320000 0.264170
8.340000 0.169713
8.360000 -0.065215
8.380000 -0.075488
8.400000 0.042980
8.420000 -0.149045
8.440000 0.047137
8.460000 -0.214226
8.480000 -0.051177
8.500000 -0.084061
8.520000 -0.126147
8.540000 -0.199647
8.560000 -0.200450
8.580000 -0.342299
8.600000 -0.478008
8.620000 -0.394154
8.640000 -0.339514
8.660000 -0.084231
8.680000 -0.047599
8.700000 -0.043127
8.720000 -0.050035
8.740000 -0.000872
8.760000 0.042464
8.780000 0.050395
8.800000 0.046709
8.820000 0.210556
8.840000 0.194481
8.860000 0.211542
8.880000 0.241095
8.900000 0.318334
8.920000 0.492715
8.940000 0.420409
8.960000 0.422387
8.980000 0.259892
9.000000 0.266956
9.020000 0.244336
9.040000 0.175098
9.060000 0.211758
9.080000 0.213090
9.100000 0.118259
9.120000 0.131022
9.140000 0.061728
9.160000 0.036211
9.180000 -0.023149
9.200000 -0.126204
9.220000 -0.317746
9.240000 -0.504112
9.260000 -0.432455
9.280000 -0.499697
9.300000 -0.249082
9.320000 -0.307040
9.340000 -0.226435
9.360000 -0.417869
9.380000 -0.249587
9.400000 -0.240881
9.420000 -0.210606
9.440000 -0.167904
9.460000 -0.191761
9.480000 -0.153305
9.500000 -0.129567
9.520000 -0.129675
9.540000 0.212965
9.560000 0.403723
9.580000 0.391514
9.600000 0.367988
9.620000 0.335965
9.640000 0.511338
9.660000 0.267671
9.680000 0.260535
9.700000 0.240616
9.720000 0.292980
9.740000 0.365138
9.760000 0.289925
9.780000 0.329946
9.800000 0.448412
9.820000 0.470235
9.840000 0.311949
9.860000 0.052864
9.880000 0.122768
9.900000 0.012715
9.920000 -0.122779
9.940000 -0.172054
9.960000 -0.322282
9.980000 -0.102970
10.000000 -0.056880

100
tests/data/COLVAR_0-2.xvg Normal file
View File

@@ -0,0 +1,100 @@
0.020000 -0.377860
0.040000 0.010992
0.060000 0.123074
0.080000 0.108291
0.100000 0.261607
0.120000 0.185592
0.140000 0.398266
0.160000 0.461779
0.180000 0.105976
0.200000 0.214612
0.220000 0.239492
0.240000 0.320299
0.260000 0.344827
0.280000 0.223717
0.300000 0.445152
0.320000 0.487640
0.340000 0.568231
0.360000 0.264504
0.380000 0.156700
0.400000 0.339014
0.420000 0.007749
0.440000 -0.024582
0.460000 -0.103746
0.480000 -0.238796
0.500000 0.267790
0.520000 -0.172984
0.540000 -0.162007
0.560000 -0.022318
0.580000 -0.274371
0.600000 -0.170447
0.620000 -0.464711
0.640000 -0.770842
0.660000 -0.160143
0.680000 -0.475005
0.700000 -0.445097
0.720000 -0.251824
0.740000 -0.399393
0.760000 -0.009600
0.780000 0.036937
0.800000 -0.288376
0.820000 0.088705
0.840000 0.035215
0.860000 0.026541
0.880000 0.041992
0.900000 -0.221743
0.920000 0.340514
0.940000 0.290576
0.960000 0.425674
0.980000 0.417250
1.000000 0.511139
1.020000 0.754747
1.040000 0.559245
1.060000 0.278543
1.080000 0.290714
1.100000 0.350660
1.120000 0.265198
1.140000 0.136869
1.160000 0.122245
1.180000 0.298347
1.200000 0.442561
1.220000 0.318732
1.240000 -0.009101
1.260000 0.210199
1.280000 0.092197
1.300000 -0.218855
1.320000 -0.258758
1.340000 -0.547873
1.360000 -0.310370
1.380000 -0.162075
1.400000 -0.425929
1.420000 -0.138428
1.440000 -0.157315
1.460000 -0.141138
1.480000 -0.127917
1.500000 -0.245431
1.520000 -0.346983
1.540000 -0.165304
1.560000 -0.503931
1.580000 -0.515063
1.600000 -0.155765
1.620000 -0.054631
1.640000 0.208200
1.660000 0.237158
1.680000 0.227077
1.700000 0.358599
1.720000 0.361749
1.740000 0.170592
1.760000 0.248700
1.780000 0.256466
1.800000 0.342915
1.820000 0.169221
1.840000 0.339560
1.860000 0.205654
1.880000 0.537767
1.900000 0.402014
1.920000 0.391279
1.940000 0.315378
1.960000 0.149920
1.980000 0.280272
2.000000 0.127339

250
tests/data/COLVAR_0-5.xvg Normal file
View File

@@ -0,0 +1,250 @@
0.020000 -0.377860
0.040000 0.010992
0.060000 0.123074
0.080000 0.108291
0.100000 0.261607
0.120000 0.185592
0.140000 0.398266
0.160000 0.461779
0.180000 0.105976
0.200000 0.214612
0.220000 0.239492
0.240000 0.320299
0.260000 0.344827
0.280000 0.223717
0.300000 0.445152
0.320000 0.487640
0.340000 0.568231
0.360000 0.264504
0.380000 0.156700
0.400000 0.339014
0.420000 0.007749
0.440000 -0.024582
0.460000 -0.103746
0.480000 -0.238796
0.500000 0.267790
0.520000 -0.172984
0.540000 -0.162007
0.560000 -0.022318
0.580000 -0.274371
0.600000 -0.170447
0.620000 -0.464711
0.640000 -0.770842
0.660000 -0.160143
0.680000 -0.475005
0.700000 -0.445097
0.720000 -0.251824
0.740000 -0.399393
0.760000 -0.009600
0.780000 0.036937
0.800000 -0.288376
0.820000 0.088705
0.840000 0.035215
0.860000 0.026541
0.880000 0.041992
0.900000 -0.221743
0.920000 0.340514
0.940000 0.290576
0.960000 0.425674
0.980000 0.417250
1.000000 0.511139
1.020000 0.754747
1.040000 0.559245
1.060000 0.278543
1.080000 0.290714
1.100000 0.350660
1.120000 0.265198
1.140000 0.136869
1.160000 0.122245
1.180000 0.298347
1.200000 0.442561
1.220000 0.318732
1.240000 -0.009101
1.260000 0.210199
1.280000 0.092197
1.300000 -0.218855
1.320000 -0.258758
1.340000 -0.547873
1.360000 -0.310370
1.380000 -0.162075
1.400000 -0.425929
1.420000 -0.138428
1.440000 -0.157315
1.460000 -0.141138
1.480000 -0.127917
1.500000 -0.245431
1.520000 -0.346983
1.540000 -0.165304
1.560000 -0.503931
1.580000 -0.515063
1.600000 -0.155765
1.620000 -0.054631
1.640000 0.208200
1.660000 0.237158
1.680000 0.227077
1.700000 0.358599
1.720000 0.361749
1.740000 0.170592
1.760000 0.248700
1.780000 0.256466
1.800000 0.342915
1.820000 0.169221
1.840000 0.339560
1.860000 0.205654
1.880000 0.537767
1.900000 0.402014
1.920000 0.391279
1.940000 0.315378
1.960000 0.149920
1.980000 0.280272
2.000000 0.127339
2.020000 -0.111932
2.040000 0.259792
2.060000 -0.041852
2.080000 0.153340
2.100000 0.166558
2.120000 -0.227151
2.140000 0.170747
2.160000 -0.168786
2.180000 -0.309401
2.200000 -0.207106
2.220000 -0.595975
2.240000 -0.380839
2.260000 -0.384326
2.280000 -0.595164
2.300000 -0.115474
2.320000 -0.194623
2.340000 -0.165108
2.360000 -0.079131
2.380000 -0.248973
2.400000 -0.141384
2.420000 0.067492
2.440000 -0.167260
2.460000 0.069070
2.480000 0.109517
2.500000 0.275638
2.520000 0.409559
2.540000 0.407971
2.560000 0.480279
2.580000 0.612092
2.600000 0.678006
2.620000 0.390398
2.640000 0.480483
2.660000 0.382538
2.680000 0.351606
2.700000 0.242267
2.720000 0.124043
2.740000 0.006109
2.760000 0.224920
2.780000 0.103645
2.800000 0.136471
2.820000 0.047265
2.840000 0.072428
2.860000 0.083309
2.880000 -0.272198
2.900000 -0.255573
2.920000 -0.152599
2.940000 -0.291048
2.960000 -0.198565
2.980000 -0.269126
3.000000 -0.476225
3.020000 -0.155645
3.040000 -0.280627
3.060000 -0.127538
3.080000 0.012533
3.100000 -0.179725
3.120000 -0.216130
3.140000 -0.207261
3.160000 -0.551407
3.180000 0.039334
3.200000 -0.009344
3.220000 0.013060
3.240000 0.273527
3.260000 0.109360
3.280000 0.421753
3.300000 0.241420
3.320000 0.201920
3.340000 0.357590
3.360000 0.289825
3.380000 0.040550
3.400000 0.345033
3.420000 0.109547
3.440000 0.557827
3.460000 0.495151
3.480000 0.382503
3.500000 0.311630
3.520000 0.402886
3.540000 0.145753
3.560000 0.053371
3.580000 -0.099518
3.600000 -0.217586
3.620000 -0.078479
3.640000 -0.215597
3.660000 -0.102704
3.680000 -0.318363
3.700000 -0.113242
3.720000 -0.076240
3.740000 -0.188385
3.760000 -0.237573
3.780000 -0.225944
3.800000 -0.366487
3.820000 -0.335452
3.840000 -0.318478
3.860000 -0.352154
3.880000 -0.235007
3.900000 0.120242
3.920000 -0.198549
3.940000 0.079292
3.960000 0.211743
3.980000 0.180080
4.000000 0.214707
4.020000 0.021381
4.040000 0.081417
4.060000 0.114621
4.080000 0.011734
4.100000 -0.003705
4.120000 0.051130
4.140000 0.121488
4.160000 0.340722
4.180000 0.252438
4.200000 0.439041
4.220000 0.405294
4.240000 0.475172
4.260000 0.211356
4.280000 0.320336
4.300000 0.245725
4.320000 0.200433
4.340000 0.127897
4.360000 0.164240
4.380000 0.030642
4.400000 0.204649
4.420000 -0.031684
4.440000 -0.136474
4.460000 0.166935
4.480000 -0.205537
4.500000 0.020623
4.520000 -0.141182
4.540000 -0.006324
4.560000 -0.120097
4.580000 -0.141139
4.600000 -0.023482
4.620000 -0.263421
4.640000 -0.309596
4.660000 -0.053286
4.680000 -0.311061
4.700000 -0.197194
4.720000 -0.004616
4.740000 -0.197131
4.760000 0.040260
4.780000 -0.147501
4.800000 -0.232280
4.820000 -0.080091
4.840000 -0.025872
4.860000 0.069618
4.880000 0.132024
4.900000 0.109382
4.920000 0.317044
4.940000 0.238353
4.960000 0.391818
4.980000 0.352735
5.000000 0.346928

250
tests/data/COLVAR_2-7.xvg Normal file
View File

@@ -0,0 +1,250 @@
2.020000 -0.111932
2.040000 0.259792
2.060000 -0.041852
2.080000 0.153340
2.100000 0.166558
2.120000 -0.227151
2.140000 0.170747
2.160000 -0.168786
2.180000 -0.309401
2.200000 -0.207106
2.220000 -0.595975
2.240000 -0.380839
2.260000 -0.384326
2.280000 -0.595164
2.300000 -0.115474
2.320000 -0.194623
2.340000 -0.165108
2.360000 -0.079131
2.380000 -0.248973
2.400000 -0.141384
2.420000 0.067492
2.440000 -0.167260
2.460000 0.069070
2.480000 0.109517
2.500000 0.275638
2.520000 0.409559
2.540000 0.407971
2.560000 0.480279
2.580000 0.612092
2.600000 0.678006
2.620000 0.390398
2.640000 0.480483
2.660000 0.382538
2.680000 0.351606
2.700000 0.242267
2.720000 0.124043
2.740000 0.006109
2.760000 0.224920
2.780000 0.103645
2.800000 0.136471
2.820000 0.047265
2.840000 0.072428
2.860000 0.083309
2.880000 -0.272198
2.900000 -0.255573
2.920000 -0.152599
2.940000 -0.291048
2.960000 -0.198565
2.980000 -0.269126
3.000000 -0.476225
3.020000 -0.155645
3.040000 -0.280627
3.060000 -0.127538
3.080000 0.012533
3.100000 -0.179725
3.120000 -0.216130
3.140000 -0.207261
3.160000 -0.551407
3.180000 0.039334
3.200000 -0.009344
3.220000 0.013060
3.240000 0.273527
3.260000 0.109360
3.280000 0.421753
3.300000 0.241420
3.320000 0.201920
3.340000 0.357590
3.360000 0.289825
3.380000 0.040550
3.400000 0.345033
3.420000 0.109547
3.440000 0.557827
3.460000 0.495151
3.480000 0.382503
3.500000 0.311630
3.520000 0.402886
3.540000 0.145753
3.560000 0.053371
3.580000 -0.099518
3.600000 -0.217586
3.620000 -0.078479
3.640000 -0.215597
3.660000 -0.102704
3.680000 -0.318363
3.700000 -0.113242
3.720000 -0.076240
3.740000 -0.188385
3.760000 -0.237573
3.780000 -0.225944
3.800000 -0.366487
3.820000 -0.335452
3.840000 -0.318478
3.860000 -0.352154
3.880000 -0.235007
3.900000 0.120242
3.920000 -0.198549
3.940000 0.079292
3.960000 0.211743
3.980000 0.180080
4.000000 0.214707
4.020000 0.021381
4.040000 0.081417
4.060000 0.114621
4.080000 0.011734
4.100000 -0.003705
4.120000 0.051130
4.140000 0.121488
4.160000 0.340722
4.180000 0.252438
4.200000 0.439041
4.220000 0.405294
4.240000 0.475172
4.260000 0.211356
4.280000 0.320336
4.300000 0.245725
4.320000 0.200433
4.340000 0.127897
4.360000 0.164240
4.380000 0.030642
4.400000 0.204649
4.420000 -0.031684
4.440000 -0.136474
4.460000 0.166935
4.480000 -0.205537
4.500000 0.020623
4.520000 -0.141182
4.540000 -0.006324
4.560000 -0.120097
4.580000 -0.141139
4.600000 -0.023482
4.620000 -0.263421
4.640000 -0.309596
4.660000 -0.053286
4.680000 -0.311061
4.700000 -0.197194
4.720000 -0.004616
4.740000 -0.197131
4.760000 0.040260
4.780000 -0.147501
4.800000 -0.232280
4.820000 -0.080091
4.840000 -0.025872
4.860000 0.069618
4.880000 0.132024
4.900000 0.109382
4.920000 0.317044
4.940000 0.238353
4.960000 0.391818
4.980000 0.352735
5.000000 0.346928
5.020000 0.559155
5.040000 0.324917
5.060000 0.384628
5.080000 0.437213
5.100000 0.500261
5.120000 0.524957
5.140000 0.318692
5.160000 0.407006
5.180000 0.386429
5.200000 0.121732
5.220000 0.103876
5.240000 -0.007759
5.260000 -0.228426
5.280000 0.091557
5.300000 -0.141686
5.320000 -0.175769
5.340000 0.056234
5.360000 -0.139847
5.380000 -0.248525
5.400000 -0.405083
5.420000 -0.543086
5.440000 -0.605228
5.460000 -0.453772
5.480000 -0.632332
5.500000 -0.278857
5.520000 -0.125809
5.540000 -0.307619
5.560000 -0.156702
5.580000 -0.225417
5.600000 -0.103164
5.620000 -0.179194
5.640000 -0.127734
5.660000 -0.188341
5.680000 0.143537
5.700000 0.047410
5.720000 0.233912
5.740000 0.342515
5.760000 0.480074
5.780000 0.526478
5.800000 0.599988
5.820000 0.428251
5.840000 0.408720
5.860000 0.501119
5.880000 0.229850
5.900000 0.255165
5.920000 0.084974
5.940000 0.230521
5.960000 0.289550
5.980000 0.387046
6.000000 0.244289
6.020000 0.402885
6.040000 0.273234
6.060000 0.239922
6.080000 -0.061710
6.100000 -0.188653
6.120000 -0.176610
6.140000 -0.539426
6.160000 -0.292322
6.180000 -0.368200
6.200000 -0.442046
6.220000 -0.086956
6.240000 -0.237524
6.260000 -0.109149
6.280000 0.114621
6.300000 -0.321428
6.320000 -0.323525
6.340000 -0.451779
6.360000 -0.619271
6.380000 -0.210074
6.400000 -0.308296
6.420000 -0.096123
6.440000 0.200226
6.460000 0.195091
6.480000 0.438811
6.500000 0.317047
6.520000 0.432486
6.540000 0.375387
6.560000 0.302796
6.580000 0.173397
6.600000 0.314706
6.620000 0.329726
6.640000 0.499638
6.660000 0.390596
6.680000 0.531012
6.700000 0.648674
6.720000 0.504828
6.740000 0.506630
6.760000 0.264208
6.780000 0.171029
6.800000 -0.042753
6.820000 -0.232043
6.840000 -0.121052
6.860000 -0.080382
6.880000 -0.214688
6.900000 -0.029242
6.920000 -0.100849
6.940000 -0.254431
6.960000 -0.294761
6.980000 -0.387433
7.000000 -0.435287

250
tests/data/COLVAR_5-10.xvg Normal file
View File

@@ -0,0 +1,250 @@
5.020000 0.559155
5.040000 0.324917
5.060000 0.384628
5.080000 0.437213
5.100000 0.500261
5.120000 0.524957
5.140000 0.318692
5.160000 0.407006
5.180000 0.386429
5.200000 0.121732
5.220000 0.103876
5.240000 -0.007759
5.260000 -0.228426
5.280000 0.091557
5.300000 -0.141686
5.320000 -0.175769
5.340000 0.056234
5.360000 -0.139847
5.380000 -0.248525
5.400000 -0.405083
5.420000 -0.543086
5.440000 -0.605228
5.460000 -0.453772
5.480000 -0.632332
5.500000 -0.278857
5.520000 -0.125809
5.540000 -0.307619
5.560000 -0.156702
5.580000 -0.225417
5.600000 -0.103164
5.620000 -0.179194
5.640000 -0.127734
5.660000 -0.188341
5.680000 0.143537
5.700000 0.047410
5.720000 0.233912
5.740000 0.342515
5.760000 0.480074
5.780000 0.526478
5.800000 0.599988
5.820000 0.428251
5.840000 0.408720
5.860000 0.501119
5.880000 0.229850
5.900000 0.255165
5.920000 0.084974
5.940000 0.230521
5.960000 0.289550
5.980000 0.387046
6.000000 0.244289
6.020000 0.402885
6.040000 0.273234
6.060000 0.239922
6.080000 -0.061710
6.100000 -0.188653
6.120000 -0.176610
6.140000 -0.539426
6.160000 -0.292322
6.180000 -0.368200
6.200000 -0.442046
6.220000 -0.086956
6.240000 -0.237524
6.260000 -0.109149
6.280000 0.114621
6.300000 -0.321428
6.320000 -0.323525
6.340000 -0.451779
6.360000 -0.619271
6.380000 -0.210074
6.400000 -0.308296
6.420000 -0.096123
6.440000 0.200226
6.460000 0.195091
6.480000 0.438811
6.500000 0.317047
6.520000 0.432486
6.540000 0.375387
6.560000 0.302796
6.580000 0.173397
6.600000 0.314706
6.620000 0.329726
6.640000 0.499638
6.660000 0.390596
6.680000 0.531012
6.700000 0.648674
6.720000 0.504828
6.740000 0.506630
6.760000 0.264208
6.780000 0.171029
6.800000 -0.042753
6.820000 -0.232043
6.840000 -0.121052
6.860000 -0.080382
6.880000 -0.214688
6.900000 -0.029242
6.920000 -0.100849
6.940000 -0.254431
6.960000 -0.294761
6.980000 -0.387433
7.000000 -0.435287
7.020000 -0.392397
7.040000 -0.361231
7.060000 -0.314569
7.080000 -0.418825
7.100000 -0.446802
7.120000 -0.107055
7.140000 -0.062352
7.160000 0.048612
7.180000 0.090056
7.200000 0.026421
7.220000 0.133539
7.240000 0.015399
7.260000 0.169799
7.280000 0.188015
7.300000 0.186057
7.320000 0.267611
7.340000 0.346012
7.360000 0.462420
7.380000 0.600556
7.400000 0.557739
7.420000 0.432258
7.440000 0.377746
7.460000 0.193769
7.480000 0.222955
7.500000 0.090057
7.520000 0.147336
7.540000 0.166292
7.560000 0.100436
7.580000 -0.021099
7.600000 -0.068353
7.620000 0.019654
7.640000 -0.089638
7.660000 -0.043250
7.680000 -0.303386
7.700000 -0.370787
7.720000 -0.534350
7.740000 -0.506331
7.760000 -0.465337
7.780000 -0.299286
7.800000 -0.128983
7.820000 -0.155927
7.840000 -0.185521
7.860000 -0.254707
7.880000 -0.052327
7.900000 -0.195514
7.920000 -0.097241
7.940000 -0.173111
7.960000 -0.146022
7.980000 -0.002634
8.000000 0.090475
8.020000 0.224838
8.040000 0.338389
8.060000 0.324804
8.080000 0.315508
8.100000 0.285864
8.120000 0.089370
8.140000 0.378119
8.160000 0.093042
8.180000 0.326371
8.200000 0.214992
8.220000 0.272968
8.240000 0.466140
8.260000 0.441360
8.280000 0.463138
8.300000 0.476466
8.320000 0.264170
8.340000 0.169713
8.360000 -0.065215
8.380000 -0.075488
8.400000 0.042980
8.420000 -0.149045
8.440000 0.047137
8.460000 -0.214226
8.480000 -0.051177
8.500000 -0.084061
8.520000 -0.126147
8.540000 -0.199647
8.560000 -0.200450
8.580000 -0.342299
8.600000 -0.478008
8.620000 -0.394154
8.640000 -0.339514
8.660000 -0.084231
8.680000 -0.047599
8.700000 -0.043127
8.720000 -0.050035
8.740000 -0.000872
8.760000 0.042464
8.780000 0.050395
8.800000 0.046709
8.820000 0.210556
8.840000 0.194481
8.860000 0.211542
8.880000 0.241095
8.900000 0.318334
8.920000 0.492715
8.940000 0.420409
8.960000 0.422387
8.980000 0.259892
9.000000 0.266956
9.020000 0.244336
9.040000 0.175098
9.060000 0.211758
9.080000 0.213090
9.100000 0.118259
9.120000 0.131022
9.140000 0.061728
9.160000 0.036211
9.180000 -0.023149
9.200000 -0.126204
9.220000 -0.317746
9.240000 -0.504112
9.260000 -0.432455
9.280000 -0.499697
9.300000 -0.249082
9.320000 -0.307040
9.340000 -0.226435
9.360000 -0.417869
9.380000 -0.249587
9.400000 -0.240881
9.420000 -0.210606
9.440000 -0.167904
9.460000 -0.191761
9.480000 -0.153305
9.500000 -0.129567
9.520000 -0.129675
9.540000 0.212965
9.560000 0.403723
9.580000 0.391514
9.600000 0.367988
9.620000 0.335965
9.640000 0.511338
9.660000 0.267671
9.680000 0.260535
9.700000 0.240616
9.720000 0.292980
9.740000 0.365138
9.760000 0.289925
9.780000 0.329946
9.800000 0.448412
9.820000 0.470235
9.840000 0.311949
9.860000 0.052864
9.880000 0.122768
9.900000 0.012715
9.920000 -0.122779
9.940000 -0.172054
9.960000 -0.322282
9.980000 -0.102970
10.000000 -0.056880

150
tests/data/COLVAR_7-10.xvg Normal file
View File

@@ -0,0 +1,150 @@
7.020000 -0.392397
7.040000 -0.361231
7.060000 -0.314569
7.080000 -0.418825
7.100000 -0.446802
7.120000 -0.107055
7.140000 -0.062352
7.160000 0.048612
7.180000 0.090056
7.200000 0.026421
7.220000 0.133539
7.240000 0.015399
7.260000 0.169799
7.280000 0.188015
7.300000 0.186057
7.320000 0.267611
7.340000 0.346012
7.360000 0.462420
7.380000 0.600556
7.400000 0.557739
7.420000 0.432258
7.440000 0.377746
7.460000 0.193769
7.480000 0.222955
7.500000 0.090057
7.520000 0.147336
7.540000 0.166292
7.560000 0.100436
7.580000 -0.021099
7.600000 -0.068353
7.620000 0.019654
7.640000 -0.089638
7.660000 -0.043250
7.680000 -0.303386
7.700000 -0.370787
7.720000 -0.534350
7.740000 -0.506331
7.760000 -0.465337
7.780000 -0.299286
7.800000 -0.128983
7.820000 -0.155927
7.840000 -0.185521
7.860000 -0.254707
7.880000 -0.052327
7.900000 -0.195514
7.920000 -0.097241
7.940000 -0.173111
7.960000 -0.146022
7.980000 -0.002634
8.000000 0.090475
8.020000 0.224838
8.040000 0.338389
8.060000 0.324804
8.080000 0.315508
8.100000 0.285864
8.120000 0.089370
8.140000 0.378119
8.160000 0.093042
8.180000 0.326371
8.200000 0.214992
8.220000 0.272968
8.240000 0.466140
8.260000 0.441360
8.280000 0.463138
8.300000 0.476466
8.320000 0.264170
8.340000 0.169713
8.360000 -0.065215
8.380000 -0.075488
8.400000 0.042980
8.420000 -0.149045
8.440000 0.047137
8.460000 -0.214226
8.480000 -0.051177
8.500000 -0.084061
8.520000 -0.126147
8.540000 -0.199647
8.560000 -0.200450
8.580000 -0.342299
8.600000 -0.478008
8.620000 -0.394154
8.640000 -0.339514
8.660000 -0.084231
8.680000 -0.047599
8.700000 -0.043127
8.720000 -0.050035
8.740000 -0.000872
8.760000 0.042464
8.780000 0.050395
8.800000 0.046709
8.820000 0.210556
8.840000 0.194481
8.860000 0.211542
8.880000 0.241095
8.900000 0.318334
8.920000 0.492715
8.940000 0.420409
8.960000 0.422387
8.980000 0.259892
9.000000 0.266956
9.020000 0.244336
9.040000 0.175098
9.060000 0.211758
9.080000 0.213090
9.100000 0.118259
9.120000 0.131022
9.140000 0.061728
9.160000 0.036211
9.180000 -0.023149
9.200000 -0.126204
9.220000 -0.317746
9.240000 -0.504112
9.260000 -0.432455
9.280000 -0.499697
9.300000 -0.249082
9.320000 -0.307040
9.340000 -0.226435
9.360000 -0.417869
9.380000 -0.249587
9.400000 -0.240881
9.420000 -0.210606
9.440000 -0.167904
9.460000 -0.191761
9.480000 -0.153305
9.500000 -0.129567
9.520000 -0.129675
9.540000 0.212965
9.560000 0.403723
9.580000 0.391514
9.600000 0.367988
9.620000 0.335965
9.640000 0.511338
9.660000 0.267671
9.680000 0.260535
9.700000 0.240616
9.720000 0.292980
9.740000 0.365138
9.760000 0.289925
9.780000 0.329946
9.800000 0.448412
9.820000 0.470235
9.840000 0.311949
9.860000 0.052864
9.880000 0.122768
9.900000 0.012715
9.920000 -0.122779
9.940000 -0.172054
9.960000 -0.322282
9.980000 -0.102970
10.000000 -0.056880

View File

@@ -0,0 +1,418 @@
#file phi psi fc1 fc2
../../example/2d_cyclic/COLVAR-3.0-3.0.xvg -3.0 -3.0 100.0 100.0
../../example/2d_cyclic/COLVAR-3.0-2.5.xvg -2.5 -3.0 100.0 100.0
../../example/2d_cyclic/COLVAR-3.0-2.25.xvg -2.25 -3.0 100.0 100.0
../../example/2d_cyclic/COLVAR-3.0-1.75.xvg -1.75 -3.0 100.0 100.0
../../example/2d_cyclic/COLVAR-3.0-1.5.xvg -1.5 -3.0 100.0 100.0
../../example/2d_cyclic/COLVAR-3.0-1.0.xvg -1.0 -3.0 100.0 100.0
../../example/2d_cyclic/COLVAR-3.0-0.75.xvg -0.75 -3.0 100.0 100.0
../../example/2d_cyclic/COLVAR-3.0-0.25.xvg -0.25 -3.0 100.0 100.0
../../example/2d_cyclic/COLVAR-3.0+0.0.xvg +0.0 -3.0 100.0 100.0
../../example/2d_cyclic/COLVAR-3.0+0.5.xvg +0.5 -3.0 100.0 100.0
../../example/2d_cyclic/COLVAR-3.0+0.75.xvg +0.75 -3.0 100.0 100.0
../../example/2d_cyclic/COLVAR-3.0+1.25.xvg +1.25 -3.0 100.0 100.0
../../example/2d_cyclic/COLVAR-3.0+1.5.xvg +1.5 -3.0 100.0 100.0
../../example/2d_cyclic/COLVAR-3.0+2.0.xvg +2.0 -3.0 100.0 100.0
../../example/2d_cyclic/COLVAR-3.0+2.25.xvg +2.25 -3.0 100.0 100.0
../../example/2d_cyclic/COLVAR-3.0+2.75.xvg +2.75 -3.0 100.0 100.0
../../example/2d_cyclic/COLVAR-3.0+3.0.xvg +3.0 -3.0 100.0 100.0
../../example/2d_cyclic/COLVAR-2.75-2.75.xvg -2.75 -2.75 100.0 100.0
../../example/2d_cyclic/COLVAR-2.75-2.5.xvg -2.5 -2.75 100.0 100.0
../../example/2d_cyclic/COLVAR-2.75-2.0.xvg -2.0 -2.75 100.0 100.0
../../example/2d_cyclic/COLVAR-2.75-1.75.xvg -1.75 -2.75 100.0 100.0
../../example/2d_cyclic/COLVAR-2.75-1.25.xvg -1.25 -2.75 100.0 100.0
../../example/2d_cyclic/COLVAR-2.75-1.0.xvg -1.0 -2.75 100.0 100.0
../../example/2d_cyclic/COLVAR-2.75-0.5.xvg -0.5 -2.75 100.0 100.0
../../example/2d_cyclic/COLVAR-2.75-0.25.xvg -0.25 -2.75 100.0 100.0
../../example/2d_cyclic/COLVAR-2.75+0.25.xvg +0.25 -2.75 100.0 100.0
../../example/2d_cyclic/COLVAR-2.75+0.5.xvg +0.5 -2.75 100.0 100.0
../../example/2d_cyclic/COLVAR-2.75+1.0.xvg +1.0 -2.75 100.0 100.0
../../example/2d_cyclic/COLVAR-2.75+1.25.xvg +1.25 -2.75 100.0 100.0
../../example/2d_cyclic/COLVAR-2.75+1.75.xvg +1.75 -2.75 100.0 100.0
../../example/2d_cyclic/COLVAR-2.75+2.0.xvg +2.0 -2.75 100.0 100.0
../../example/2d_cyclic/COLVAR-2.75+2.5.xvg +2.5 -2.75 100.0 100.0
../../example/2d_cyclic/COLVAR-2.75+2.75.xvg +2.75 -2.75 100.0 100.0
../../example/2d_cyclic/COLVAR-2.5-3.0.xvg -3.0 -2.5 100.0 100.0
../../example/2d_cyclic/COLVAR-2.5-2.75.xvg -2.75 -2.5 100.0 100.0
../../example/2d_cyclic/COLVAR-2.5-2.25.xvg -2.25 -2.5 100.0 100.0
../../example/2d_cyclic/COLVAR-2.5-2.0.xvg -2.0 -2.5 100.0 100.0
../../example/2d_cyclic/COLVAR-2.5-1.5.xvg -1.5 -2.5 100.0 100.0
../../example/2d_cyclic/COLVAR-2.5-1.25.xvg -1.25 -2.5 100.0 100.0
../../example/2d_cyclic/COLVAR-2.5-0.75.xvg -0.75 -2.5 100.0 100.0
../../example/2d_cyclic/COLVAR-2.5-0.5.xvg -0.5 -2.5 100.0 100.0
../../example/2d_cyclic/COLVAR-2.5+0.0.xvg +0.0 -2.5 100.0 100.0
../../example/2d_cyclic/COLVAR-2.5+0.25.xvg +0.25 -2.5 100.0 100.0
../../example/2d_cyclic/COLVAR-2.5+0.75.xvg +0.75 -2.5 100.0 100.0
../../example/2d_cyclic/COLVAR-2.5+1.0.xvg +1.0 -2.5 100.0 100.0
../../example/2d_cyclic/COLVAR-2.5+1.5.xvg +1.5 -2.5 100.0 100.0
../../example/2d_cyclic/COLVAR-2.5+1.75.xvg +1.75 -2.5 100.0 100.0
../../example/2d_cyclic/COLVAR-2.5+2.25.xvg +2.25 -2.5 100.0 100.0
../../example/2d_cyclic/COLVAR-2.5+2.5.xvg +2.5 -2.5 100.0 100.0
../../example/2d_cyclic/COLVAR-2.5+3.0.xvg +3.0 -2.5 100.0 100.0
../../example/2d_cyclic/COLVAR-2.25-3.0.xvg -3.0 -2.25 100.0 100.0
../../example/2d_cyclic/COLVAR-2.25-2.5.xvg -2.5 -2.25 100.0 100.0
../../example/2d_cyclic/COLVAR-2.25-2.25.xvg -2.25 -2.25 100.0 100.0
../../example/2d_cyclic/COLVAR-2.25-1.75.xvg -1.75 -2.25 100.0 100.0
../../example/2d_cyclic/COLVAR-2.25-1.5.xvg -1.5 -2.25 100.0 100.0
../../example/2d_cyclic/COLVAR-2.25-1.0.xvg -1.0 -2.25 100.0 100.0
../../example/2d_cyclic/COLVAR-2.25-0.75.xvg -0.75 -2.25 100.0 100.0
../../example/2d_cyclic/COLVAR-2.25-0.25.xvg -0.25 -2.25 100.0 100.0
../../example/2d_cyclic/COLVAR-2.25+0.0.xvg +0.0 -2.25 100.0 100.0
../../example/2d_cyclic/COLVAR-2.25+0.5.xvg +0.5 -2.25 100.0 100.0
../../example/2d_cyclic/COLVAR-2.25+0.75.xvg +0.75 -2.25 100.0 100.0
../../example/2d_cyclic/COLVAR-2.25+1.25.xvg +1.25 -2.25 100.0 100.0
../../example/2d_cyclic/COLVAR-2.25+1.5.xvg +1.5 -2.25 100.0 100.0
../../example/2d_cyclic/COLVAR-2.25+2.0.xvg +2.0 -2.25 100.0 100.0
../../example/2d_cyclic/COLVAR-2.25+2.25.xvg +2.25 -2.25 100.0 100.0
../../example/2d_cyclic/COLVAR-2.25+2.75.xvg +2.75 -2.25 100.0 100.0
../../example/2d_cyclic/COLVAR-2.25+3.0.xvg +3.0 -2.25 100.0 100.0
../../example/2d_cyclic/COLVAR-2.0-2.75.xvg -2.75 -2.0 100.0 100.0
../../example/2d_cyclic/COLVAR-2.0-2.5.xvg -2.5 -2.0 100.0 100.0
../../example/2d_cyclic/COLVAR-2.0-2.0.xvg -2.0 -2.0 100.0 100.0
../../example/2d_cyclic/COLVAR-2.0-1.75.xvg -1.75 -2.0 100.0 100.0
../../example/2d_cyclic/COLVAR-2.0-1.25.xvg -1.25 -2.0 100.0 100.0
../../example/2d_cyclic/COLVAR-2.0-1.0.xvg -1.0 -2.0 100.0 100.0
../../example/2d_cyclic/COLVAR-2.0-0.5.xvg -0.5 -2.0 100.0 100.0
../../example/2d_cyclic/COLVAR-2.0-0.25.xvg -0.25 -2.0 100.0 100.0
../../example/2d_cyclic/COLVAR-2.0+0.25.xvg +0.25 -2.0 100.0 100.0
../../example/2d_cyclic/COLVAR-2.0+0.5.xvg +0.5 -2.0 100.0 100.0
../../example/2d_cyclic/COLVAR-2.0+1.0.xvg +1.0 -2.0 100.0 100.0
../../example/2d_cyclic/COLVAR-2.0+1.25.xvg +1.25 -2.0 100.0 100.0
../../example/2d_cyclic/COLVAR-2.0+1.75.xvg +1.75 -2.0 100.0 100.0
../../example/2d_cyclic/COLVAR-2.0+2.0.xvg +2.0 -2.0 100.0 100.0
../../example/2d_cyclic/COLVAR-2.0+2.5.xvg +2.5 -2.0 100.0 100.0
../../example/2d_cyclic/COLVAR-2.0+2.75.xvg +2.75 -2.0 100.0 100.0
../../example/2d_cyclic/COLVAR-1.75-3.0.xvg -3.0 -1.75 100.0 100.0
../../example/2d_cyclic/COLVAR-1.75-2.75.xvg -2.75 -1.75 100.0 100.0
../../example/2d_cyclic/COLVAR-1.75-2.25.xvg -2.25 -1.75 100.0 100.0
../../example/2d_cyclic/COLVAR-1.75-2.0.xvg -2.0 -1.75 100.0 100.0
../../example/2d_cyclic/COLVAR-1.75-1.5.xvg -1.5 -1.75 100.0 100.0
../../example/2d_cyclic/COLVAR-1.75-1.25.xvg -1.25 -1.75 100.0 100.0
../../example/2d_cyclic/COLVAR-1.75-0.75.xvg -0.75 -1.75 100.0 100.0
../../example/2d_cyclic/COLVAR-1.75-0.5.xvg -0.5 -1.75 100.0 100.0
../../example/2d_cyclic/COLVAR-1.75+0.0.xvg +0.0 -1.75 100.0 100.0
../../example/2d_cyclic/COLVAR-1.75+0.25.xvg +0.25 -1.75 100.0 100.0
../../example/2d_cyclic/COLVAR-1.75+0.75.xvg +0.75 -1.75 100.0 100.0
../../example/2d_cyclic/COLVAR-1.75+1.0.xvg +1.0 -1.75 100.0 100.0
../../example/2d_cyclic/COLVAR-1.75+1.5.xvg +1.5 -1.75 100.0 100.0
../../example/2d_cyclic/COLVAR-1.75+1.75.xvg +1.75 -1.75 100.0 100.0
../../example/2d_cyclic/COLVAR-1.75+2.25.xvg +2.25 -1.75 100.0 100.0
../../example/2d_cyclic/COLVAR-1.75+2.5.xvg +2.5 -1.75 100.0 100.0
../../example/2d_cyclic/COLVAR-1.75+3.0.xvg +3.0 -1.75 100.0 100.0
../../example/2d_cyclic/COLVAR-1.5-3.0.xvg -3.0 -1.5 100.0 100.0
../../example/2d_cyclic/COLVAR-1.5-2.5.xvg -2.5 -1.5 100.0 100.0
../../example/2d_cyclic/COLVAR-1.5-2.25.xvg -2.25 -1.5 100.0 100.0
../../example/2d_cyclic/COLVAR-1.5-1.75.xvg -1.75 -1.5 100.0 100.0
../../example/2d_cyclic/COLVAR-1.5-1.5.xvg -1.5 -1.5 100.0 100.0
../../example/2d_cyclic/COLVAR-1.5-1.0.xvg -1.0 -1.5 100.0 100.0
../../example/2d_cyclic/COLVAR-1.5-0.75.xvg -0.75 -1.5 100.0 100.0
../../example/2d_cyclic/COLVAR-1.5-0.25.xvg -0.25 -1.5 100.0 100.0
../../example/2d_cyclic/COLVAR-1.5+0.0.xvg +0.0 -1.5 100.0 100.0
../../example/2d_cyclic/COLVAR-1.5+0.5.xvg +0.5 -1.5 100.0 100.0
../../example/2d_cyclic/COLVAR-1.5+0.75.xvg +0.75 -1.5 100.0 100.0
../../example/2d_cyclic/COLVAR-1.5+1.25.xvg +1.25 -1.5 100.0 100.0
../../example/2d_cyclic/COLVAR-1.5+1.5.xvg +1.5 -1.5 100.0 100.0
../../example/2d_cyclic/COLVAR-1.5+2.0.xvg +2.0 -1.5 100.0 100.0
../../example/2d_cyclic/COLVAR-1.5+2.25.xvg +2.25 -1.5 100.0 100.0
../../example/2d_cyclic/COLVAR-1.5+2.75.xvg +2.75 -1.5 100.0 100.0
../../example/2d_cyclic/COLVAR-1.5+3.0.xvg +3.0 -1.5 100.0 100.0
../../example/2d_cyclic/COLVAR-1.25-2.75.xvg -2.75 -1.25 100.0 100.0
../../example/2d_cyclic/COLVAR-1.25-2.5.xvg -2.5 -1.25 100.0 100.0
../../example/2d_cyclic/COLVAR-1.25-2.0.xvg -2.0 -1.25 100.0 100.0
../../example/2d_cyclic/COLVAR-1.25-1.75.xvg -1.75 -1.25 100.0 100.0
../../example/2d_cyclic/COLVAR-1.25-1.25.xvg -1.25 -1.25 100.0 100.0
../../example/2d_cyclic/COLVAR-1.25-1.0.xvg -1.0 -1.25 100.0 100.0
../../example/2d_cyclic/COLVAR-1.25-0.5.xvg -0.5 -1.25 100.0 100.0
../../example/2d_cyclic/COLVAR-1.25-0.25.xvg -0.25 -1.25 100.0 100.0
../../example/2d_cyclic/COLVAR-1.25+0.25.xvg +0.25 -1.25 100.0 100.0
../../example/2d_cyclic/COLVAR-1.25+0.5.xvg +0.5 -1.25 100.0 100.0
../../example/2d_cyclic/COLVAR-1.25+1.0.xvg +1.0 -1.25 100.0 100.0
../../example/2d_cyclic/COLVAR-1.25+1.25.xvg +1.25 -1.25 100.0 100.0
../../example/2d_cyclic/COLVAR-1.25+1.75.xvg +1.75 -1.25 100.0 100.0
../../example/2d_cyclic/COLVAR-1.25+2.0.xvg +2.0 -1.25 100.0 100.0
../../example/2d_cyclic/COLVAR-1.25+2.5.xvg +2.5 -1.25 100.0 100.0
../../example/2d_cyclic/COLVAR-1.25+2.75.xvg +2.75 -1.25 100.0 100.0
../../example/2d_cyclic/COLVAR-1.0-3.0.xvg -3.0 -1.0 100.0 100.0
../../example/2d_cyclic/COLVAR-1.0-2.75.xvg -2.75 -1.0 100.0 100.0
../../example/2d_cyclic/COLVAR-1.0-2.25.xvg -2.25 -1.0 100.0 100.0
../../example/2d_cyclic/COLVAR-1.0-2.0.xvg -2.0 -1.0 100.0 100.0
../../example/2d_cyclic/COLVAR-1.0-1.5.xvg -1.5 -1.0 100.0 100.0
../../example/2d_cyclic/COLVAR-1.0-1.25.xvg -1.25 -1.0 100.0 100.0
../../example/2d_cyclic/COLVAR-1.0-0.75.xvg -0.75 -1.0 100.0 100.0
../../example/2d_cyclic/COLVAR-1.0-0.5.xvg -0.5 -1.0 100.0 100.0
../../example/2d_cyclic/COLVAR-1.0+0.0.xvg +0.0 -1.0 100.0 100.0
../../example/2d_cyclic/COLVAR-1.0+0.25.xvg +0.25 -1.0 100.0 100.0
../../example/2d_cyclic/COLVAR-1.0+0.75.xvg +0.75 -1.0 100.0 100.0
../../example/2d_cyclic/COLVAR-1.0+1.0.xvg +1.0 -1.0 100.0 100.0
../../example/2d_cyclic/COLVAR-1.0+1.5.xvg +1.5 -1.0 100.0 100.0
../../example/2d_cyclic/COLVAR-1.0+1.75.xvg +1.75 -1.0 100.0 100.0
../../example/2d_cyclic/COLVAR-1.0+2.25.xvg +2.25 -1.0 100.0 100.0
../../example/2d_cyclic/COLVAR-1.0+2.5.xvg +2.5 -1.0 100.0 100.0
../../example/2d_cyclic/COLVAR-1.0+3.0.xvg +3.0 -1.0 100.0 100.0
../../example/2d_cyclic/COLVAR-0.75-3.0.xvg -3.0 -0.75 100.0 100.0
../../example/2d_cyclic/COLVAR-0.75-2.5.xvg -2.5 -0.75 100.0 100.0
../../example/2d_cyclic/COLVAR-0.75-2.25.xvg -2.25 -0.75 100.0 100.0
../../example/2d_cyclic/COLVAR-0.75-1.75.xvg -1.75 -0.75 100.0 100.0
../../example/2d_cyclic/COLVAR-0.75-1.5.xvg -1.5 -0.75 100.0 100.0
../../example/2d_cyclic/COLVAR-0.75-1.0.xvg -1.0 -0.75 100.0 100.0
../../example/2d_cyclic/COLVAR-0.75-0.75.xvg -0.75 -0.75 100.0 100.0
../../example/2d_cyclic/COLVAR-0.75-0.25.xvg -0.25 -0.75 100.0 100.0
../../example/2d_cyclic/COLVAR-0.75+0.0.xvg +0.0 -0.75 100.0 100.0
../../example/2d_cyclic/COLVAR-0.75+0.5.xvg +0.5 -0.75 100.0 100.0
../../example/2d_cyclic/COLVAR-0.75+0.75.xvg +0.75 -0.75 100.0 100.0
../../example/2d_cyclic/COLVAR-0.75+1.25.xvg +1.25 -0.75 100.0 100.0
../../example/2d_cyclic/COLVAR-0.75+1.5.xvg +1.5 -0.75 100.0 100.0
../../example/2d_cyclic/COLVAR-0.75+2.0.xvg +2.0 -0.75 100.0 100.0
../../example/2d_cyclic/COLVAR-0.75+2.25.xvg +2.25 -0.75 100.0 100.0
../../example/2d_cyclic/COLVAR-0.75+2.75.xvg +2.75 -0.75 100.0 100.0
../../example/2d_cyclic/COLVAR-0.75+3.0.xvg +3.0 -0.75 100.0 100.0
../../example/2d_cyclic/COLVAR-0.5-2.75.xvg -2.75 -0.5 100.0 100.0
../../example/2d_cyclic/COLVAR-0.5-2.5.xvg -2.5 -0.5 100.0 100.0
../../example/2d_cyclic/COLVAR-0.5-2.0.xvg -2.0 -0.5 100.0 100.0
../../example/2d_cyclic/COLVAR-0.5-1.75.xvg -1.75 -0.5 100.0 100.0
../../example/2d_cyclic/COLVAR-0.5-1.25.xvg -1.25 -0.5 100.0 100.0
../../example/2d_cyclic/COLVAR-0.5-1.0.xvg -1.0 -0.5 100.0 100.0
../../example/2d_cyclic/COLVAR-0.5-0.5.xvg -0.5 -0.5 100.0 100.0
../../example/2d_cyclic/COLVAR-0.5-0.25.xvg -0.25 -0.5 100.0 100.0
../../example/2d_cyclic/COLVAR-0.5+0.25.xvg +0.25 -0.5 100.0 100.0
../../example/2d_cyclic/COLVAR-0.5+0.5.xvg +0.5 -0.5 100.0 100.0
../../example/2d_cyclic/COLVAR-0.5+1.0.xvg +1.0 -0.5 100.0 100.0
../../example/2d_cyclic/COLVAR-0.5+1.25.xvg +1.25 -0.5 100.0 100.0
../../example/2d_cyclic/COLVAR-0.5+1.75.xvg +1.75 -0.5 100.0 100.0
../../example/2d_cyclic/COLVAR-0.5+2.0.xvg +2.0 -0.5 100.0 100.0
../../example/2d_cyclic/COLVAR-0.5+2.5.xvg +2.5 -0.5 100.0 100.0
../../example/2d_cyclic/COLVAR-0.5+2.75.xvg +2.75 -0.5 100.0 100.0
../../example/2d_cyclic/COLVAR-0.25-3.0.xvg -3.0 -0.25 100.0 100.0
../../example/2d_cyclic/COLVAR-0.25-2.75.xvg -2.75 -0.25 100.0 100.0
../../example/2d_cyclic/COLVAR-0.25-2.25.xvg -2.25 -0.25 100.0 100.0
../../example/2d_cyclic/COLVAR-0.25-2.0.xvg -2.0 -0.25 100.0 100.0
../../example/2d_cyclic/COLVAR-0.25-1.5.xvg -1.5 -0.25 100.0 100.0
../../example/2d_cyclic/COLVAR-0.25-1.25.xvg -1.25 -0.25 100.0 100.0
../../example/2d_cyclic/COLVAR-0.25-0.75.xvg -0.75 -0.25 100.0 100.0
../../example/2d_cyclic/COLVAR-0.25-0.5.xvg -0.5 -0.25 100.0 100.0
../../example/2d_cyclic/COLVAR-0.25+0.0.xvg +0.0 -0.25 100.0 100.0
../../example/2d_cyclic/COLVAR-0.25+0.25.xvg +0.25 -0.25 100.0 100.0
../../example/2d_cyclic/COLVAR-0.25+0.75.xvg +0.75 -0.25 100.0 100.0
../../example/2d_cyclic/COLVAR-0.25+1.0.xvg +1.0 -0.25 100.0 100.0
../../example/2d_cyclic/COLVAR-0.25+1.5.xvg +1.5 -0.25 100.0 100.0
../../example/2d_cyclic/COLVAR-0.25+1.75.xvg +1.75 -0.25 100.0 100.0
../../example/2d_cyclic/COLVAR-0.25+2.25.xvg +2.25 -0.25 100.0 100.0
../../example/2d_cyclic/COLVAR-0.25+2.5.xvg +2.5 -0.25 100.0 100.0
../../example/2d_cyclic/COLVAR-0.25+3.0.xvg +3.0 -0.25 100.0 100.0
../../example/2d_cyclic/COLVAR+0.0-3.0.xvg -3.0 +0.0 100.0 100.0
../../example/2d_cyclic/COLVAR+0.0-2.5.xvg -2.5 +0.0 100.0 100.0
../../example/2d_cyclic/COLVAR+0.0-2.25.xvg -2.25 +0.0 100.0 100.0
../../example/2d_cyclic/COLVAR+0.0-1.75.xvg -1.75 +0.0 100.0 100.0
../../example/2d_cyclic/COLVAR+0.0-1.5.xvg -1.5 +0.0 100.0 100.0
../../example/2d_cyclic/COLVAR+0.0-1.0.xvg -1.0 +0.0 100.0 100.0
../../example/2d_cyclic/COLVAR+0.0-0.75.xvg -0.75 +0.0 100.0 100.0
../../example/2d_cyclic/COLVAR+0.0-0.25.xvg -0.25 +0.0 100.0 100.0
../../example/2d_cyclic/COLVAR+0.0+0.0.xvg +0.0 +0.0 100.0 100.0
../../example/2d_cyclic/COLVAR+0.0+0.5.xvg +0.5 +0.0 100.0 100.0
../../example/2d_cyclic/COLVAR+0.0+0.75.xvg +0.75 +0.0 100.0 100.0
../../example/2d_cyclic/COLVAR+0.0+1.25.xvg +1.25 +0.0 100.0 100.0
../../example/2d_cyclic/COLVAR+0.0+1.5.xvg +1.5 +0.0 100.0 100.0
../../example/2d_cyclic/COLVAR+0.0+2.0.xvg +2.0 +0.0 100.0 100.0
../../example/2d_cyclic/COLVAR+0.0+2.25.xvg +2.25 +0.0 100.0 100.0
../../example/2d_cyclic/COLVAR+0.0+2.75.xvg +2.75 +0.0 100.0 100.0
../../example/2d_cyclic/COLVAR+0.0+3.0.xvg +3.0 +0.0 100.0 100.0
../../example/2d_cyclic/COLVAR+0.25-2.75.xvg -2.75 +0.25 100.0 100.0
../../example/2d_cyclic/COLVAR+0.25-2.5.xvg -2.5 +0.25 100.0 100.0
../../example/2d_cyclic/COLVAR+0.25-2.0.xvg -2.0 +0.25 100.0 100.0
../../example/2d_cyclic/COLVAR+0.25-1.75.xvg -1.75 +0.25 100.0 100.0
../../example/2d_cyclic/COLVAR+0.25-1.25.xvg -1.25 +0.25 100.0 100.0
../../example/2d_cyclic/COLVAR+0.25-1.0.xvg -1.0 +0.25 100.0 100.0
../../example/2d_cyclic/COLVAR+0.25-0.5.xvg -0.5 +0.25 100.0 100.0
../../example/2d_cyclic/COLVAR+0.25-0.25.xvg -0.25 +0.25 100.0 100.0
../../example/2d_cyclic/COLVAR+0.25+0.25.xvg +0.25 +0.25 100.0 100.0
../../example/2d_cyclic/COLVAR+0.25+0.5.xvg +0.5 +0.25 100.0 100.0
../../example/2d_cyclic/COLVAR+0.25+1.0.xvg +1.0 +0.25 100.0 100.0
../../example/2d_cyclic/COLVAR+0.25+1.25.xvg +1.25 +0.25 100.0 100.0
../../example/2d_cyclic/COLVAR+0.25+1.75.xvg +1.75 +0.25 100.0 100.0
../../example/2d_cyclic/COLVAR+0.25+2.0.xvg +2.0 +0.25 100.0 100.0
../../example/2d_cyclic/COLVAR+0.25+2.5.xvg +2.5 +0.25 100.0 100.0
../../example/2d_cyclic/COLVAR+0.25+2.75.xvg +2.75 +0.25 100.0 100.0
../../example/2d_cyclic/COLVAR+0.5-3.0.xvg -3.0 +0.5 100.0 100.0
../../example/2d_cyclic/COLVAR+0.5-2.75.xvg -2.75 +0.5 100.0 100.0
../../example/2d_cyclic/COLVAR+0.5-2.25.xvg -2.25 +0.5 100.0 100.0
../../example/2d_cyclic/COLVAR+0.5-2.0.xvg -2.0 +0.5 100.0 100.0
../../example/2d_cyclic/COLVAR+0.5-1.5.xvg -1.5 +0.5 100.0 100.0
../../example/2d_cyclic/COLVAR+0.5-1.25.xvg -1.25 +0.5 100.0 100.0
../../example/2d_cyclic/COLVAR+0.5-0.75.xvg -0.75 +0.5 100.0 100.0
../../example/2d_cyclic/COLVAR+0.5-0.5.xvg -0.5 +0.5 100.0 100.0
../../example/2d_cyclic/COLVAR+0.5+0.0.xvg +0.0 +0.5 100.0 100.0
../../example/2d_cyclic/COLVAR+0.5+0.25.xvg +0.25 +0.5 100.0 100.0
../../example/2d_cyclic/COLVAR+0.5+0.75.xvg +0.75 +0.5 100.0 100.0
../../example/2d_cyclic/COLVAR+0.5+1.0.xvg +1.0 +0.5 100.0 100.0
../../example/2d_cyclic/COLVAR+0.5+1.5.xvg +1.5 +0.5 100.0 100.0
../../example/2d_cyclic/COLVAR+0.5+1.75.xvg +1.75 +0.5 100.0 100.0
../../example/2d_cyclic/COLVAR+0.5+2.25.xvg +2.25 +0.5 100.0 100.0
../../example/2d_cyclic/COLVAR+0.5+2.5.xvg +2.5 +0.5 100.0 100.0
../../example/2d_cyclic/COLVAR+0.5+3.0.xvg +3.0 +0.5 100.0 100.0
../../example/2d_cyclic/COLVAR+0.75-3.0.xvg -3.0 +0.75 100.0 100.0
../../example/2d_cyclic/COLVAR+0.75-2.5.xvg -2.5 +0.75 100.0 100.0
../../example/2d_cyclic/COLVAR+0.75-2.25.xvg -2.25 +0.75 100.0 100.0
../../example/2d_cyclic/COLVAR+0.75-1.75.xvg -1.75 +0.75 100.0 100.0
../../example/2d_cyclic/COLVAR+0.75-1.5.xvg -1.5 +0.75 100.0 100.0
../../example/2d_cyclic/COLVAR+0.75-1.0.xvg -1.0 +0.75 100.0 100.0
../../example/2d_cyclic/COLVAR+0.75-0.75.xvg -0.75 +0.75 100.0 100.0
../../example/2d_cyclic/COLVAR+0.75-0.25.xvg -0.25 +0.75 100.0 100.0
../../example/2d_cyclic/COLVAR+0.75+0.0.xvg +0.0 +0.75 100.0 100.0
../../example/2d_cyclic/COLVAR+0.75+0.5.xvg +0.5 +0.75 100.0 100.0
../../example/2d_cyclic/COLVAR+0.75+0.75.xvg +0.75 +0.75 100.0 100.0
../../example/2d_cyclic/COLVAR+0.75+1.25.xvg +1.25 +0.75 100.0 100.0
../../example/2d_cyclic/COLVAR+0.75+1.5.xvg +1.5 +0.75 100.0 100.0
../../example/2d_cyclic/COLVAR+0.75+2.0.xvg +2.0 +0.75 100.0 100.0
../../example/2d_cyclic/COLVAR+0.75+2.25.xvg +2.25 +0.75 100.0 100.0
../../example/2d_cyclic/COLVAR+0.75+2.75.xvg +2.75 +0.75 100.0 100.0
../../example/2d_cyclic/COLVAR+0.75+3.0.xvg +3.0 +0.75 100.0 100.0
../../example/2d_cyclic/COLVAR+1.0-2.75.xvg -2.75 +1.0 100.0 100.0
../../example/2d_cyclic/COLVAR+1.0-2.5.xvg -2.5 +1.0 100.0 100.0
../../example/2d_cyclic/COLVAR+1.0-2.0.xvg -2.0 +1.0 100.0 100.0
../../example/2d_cyclic/COLVAR+1.0-1.75.xvg -1.75 +1.0 100.0 100.0
../../example/2d_cyclic/COLVAR+1.0-1.25.xvg -1.25 +1.0 100.0 100.0
../../example/2d_cyclic/COLVAR+1.0-1.0.xvg -1.0 +1.0 100.0 100.0
../../example/2d_cyclic/COLVAR+1.0-0.5.xvg -0.5 +1.0 100.0 100.0
../../example/2d_cyclic/COLVAR+1.0-0.25.xvg -0.25 +1.0 100.0 100.0
../../example/2d_cyclic/COLVAR+1.0+0.25.xvg +0.25 +1.0 100.0 100.0
../../example/2d_cyclic/COLVAR+1.0+0.5.xvg +0.5 +1.0 100.0 100.0
../../example/2d_cyclic/COLVAR+1.0+1.0.xvg +1.0 +1.0 100.0 100.0
../../example/2d_cyclic/COLVAR+1.0+1.25.xvg +1.25 +1.0 100.0 100.0
../../example/2d_cyclic/COLVAR+1.0+1.75.xvg +1.75 +1.0 100.0 100.0
../../example/2d_cyclic/COLVAR+1.0+2.0.xvg +2.0 +1.0 100.0 100.0
../../example/2d_cyclic/COLVAR+1.0+2.5.xvg +2.5 +1.0 100.0 100.0
../../example/2d_cyclic/COLVAR+1.0+2.75.xvg +2.75 +1.0 100.0 100.0
../../example/2d_cyclic/COLVAR+1.25-3.0.xvg -3.0 +1.25 100.0 100.0
../../example/2d_cyclic/COLVAR+1.25-2.75.xvg -2.75 +1.25 100.0 100.0
../../example/2d_cyclic/COLVAR+1.25-2.25.xvg -2.25 +1.25 100.0 100.0
../../example/2d_cyclic/COLVAR+1.25-2.0.xvg -2.0 +1.25 100.0 100.0
../../example/2d_cyclic/COLVAR+1.25-1.5.xvg -1.5 +1.25 100.0 100.0
../../example/2d_cyclic/COLVAR+1.25-1.25.xvg -1.25 +1.25 100.0 100.0
../../example/2d_cyclic/COLVAR+1.25-0.75.xvg -0.75 +1.25 100.0 100.0
../../example/2d_cyclic/COLVAR+1.25-0.5.xvg -0.5 +1.25 100.0 100.0
../../example/2d_cyclic/COLVAR+1.25+0.0.xvg +0.0 +1.25 100.0 100.0
../../example/2d_cyclic/COLVAR+1.25+0.25.xvg +0.25 +1.25 100.0 100.0
../../example/2d_cyclic/COLVAR+1.25+0.75.xvg +0.75 +1.25 100.0 100.0
../../example/2d_cyclic/COLVAR+1.25+1.0.xvg +1.0 +1.25 100.0 100.0
../../example/2d_cyclic/COLVAR+1.25+1.5.xvg +1.5 +1.25 100.0 100.0
../../example/2d_cyclic/COLVAR+1.25+1.75.xvg +1.75 +1.25 100.0 100.0
../../example/2d_cyclic/COLVAR+1.25+2.25.xvg +2.25 +1.25 100.0 100.0
../../example/2d_cyclic/COLVAR+1.25+2.5.xvg +2.5 +1.25 100.0 100.0
../../example/2d_cyclic/COLVAR+1.25+3.0.xvg +3.0 +1.25 100.0 100.0
../../example/2d_cyclic/COLVAR+1.5-3.0.xvg -3.0 +1.5 100.0 100.0
../../example/2d_cyclic/COLVAR+1.5-2.5.xvg -2.5 +1.5 100.0 100.0
../../example/2d_cyclic/COLVAR+1.5-2.25.xvg -2.25 +1.5 100.0 100.0
../../example/2d_cyclic/COLVAR+1.5-1.75.xvg -1.75 +1.5 100.0 100.0
../../example/2d_cyclic/COLVAR+1.5-1.5.xvg -1.5 +1.5 100.0 100.0
../../example/2d_cyclic/COLVAR+1.5-1.0.xvg -1.0 +1.5 100.0 100.0
../../example/2d_cyclic/COLVAR+1.5-0.75.xvg -0.75 +1.5 100.0 100.0
../../example/2d_cyclic/COLVAR+1.5-0.25.xvg -0.25 +1.5 100.0 100.0
../../example/2d_cyclic/COLVAR+1.5+0.0.xvg +0.0 +1.5 100.0 100.0
../../example/2d_cyclic/COLVAR+1.5+0.5.xvg +0.5 +1.5 100.0 100.0
../../example/2d_cyclic/COLVAR+1.5+0.75.xvg +0.75 +1.5 100.0 100.0
../../example/2d_cyclic/COLVAR+1.5+1.25.xvg +1.25 +1.5 100.0 100.0
../../example/2d_cyclic/COLVAR+1.5+1.5.xvg +1.5 +1.5 100.0 100.0
../../example/2d_cyclic/COLVAR+1.5+2.0.xvg +2.0 +1.5 100.0 100.0
../../example/2d_cyclic/COLVAR+1.5+2.25.xvg +2.25 +1.5 100.0 100.0
../../example/2d_cyclic/COLVAR+1.5+2.75.xvg +2.75 +1.5 100.0 100.0
../../example/2d_cyclic/COLVAR+1.5+3.0.xvg +3.0 +1.5 100.0 100.0
../../example/2d_cyclic/COLVAR+1.75-2.75.xvg -2.75 +1.75 100.0 100.0
../../example/2d_cyclic/COLVAR+1.75-2.5.xvg -2.5 +1.75 100.0 100.0
../../example/2d_cyclic/COLVAR+1.75-2.0.xvg -2.0 +1.75 100.0 100.0
../../example/2d_cyclic/COLVAR+1.75-1.75.xvg -1.75 +1.75 100.0 100.0
../../example/2d_cyclic/COLVAR+1.75-1.25.xvg -1.25 +1.75 100.0 100.0
../../example/2d_cyclic/COLVAR+1.75-1.0.xvg -1.0 +1.75 100.0 100.0
../../example/2d_cyclic/COLVAR+1.75-0.5.xvg -0.5 +1.75 100.0 100.0
../../example/2d_cyclic/COLVAR+1.75-0.25.xvg -0.25 +1.75 100.0 100.0
../../example/2d_cyclic/COLVAR+1.75+0.25.xvg +0.25 +1.75 100.0 100.0
../../example/2d_cyclic/COLVAR+1.75+0.5.xvg +0.5 +1.75 100.0 100.0
../../example/2d_cyclic/COLVAR+1.75+1.0.xvg +1.0 +1.75 100.0 100.0
../../example/2d_cyclic/COLVAR+1.75+1.25.xvg +1.25 +1.75 100.0 100.0
../../example/2d_cyclic/COLVAR+1.75+1.75.xvg +1.75 +1.75 100.0 100.0
../../example/2d_cyclic/COLVAR+1.75+2.0.xvg +2.0 +1.75 100.0 100.0
../../example/2d_cyclic/COLVAR+1.75+2.5.xvg +2.5 +1.75 100.0 100.0
../../example/2d_cyclic/COLVAR+1.75+2.75.xvg +2.75 +1.75 100.0 100.0
../../example/2d_cyclic/COLVAR+2.0-3.0.xvg -3.0 +2.0 100.0 100.0
../../example/2d_cyclic/COLVAR+2.0-2.75.xvg -2.75 +2.0 100.0 100.0
../../example/2d_cyclic/COLVAR+2.0-2.25.xvg -2.25 +2.0 100.0 100.0
../../example/2d_cyclic/COLVAR+2.0-2.0.xvg -2.0 +2.0 100.0 100.0
../../example/2d_cyclic/COLVAR+2.0-1.5.xvg -1.5 +2.0 100.0 100.0
../../example/2d_cyclic/COLVAR+2.0-1.25.xvg -1.25 +2.0 100.0 100.0
../../example/2d_cyclic/COLVAR+2.0-0.75.xvg -0.75 +2.0 100.0 100.0
../../example/2d_cyclic/COLVAR+2.0-0.5.xvg -0.5 +2.0 100.0 100.0
../../example/2d_cyclic/COLVAR+2.0+0.0.xvg +0.0 +2.0 100.0 100.0
../../example/2d_cyclic/COLVAR+2.0+0.25.xvg +0.25 +2.0 100.0 100.0
../../example/2d_cyclic/COLVAR+2.0+0.75.xvg +0.75 +2.0 100.0 100.0
../../example/2d_cyclic/COLVAR+2.0+1.0.xvg +1.0 +2.0 100.0 100.0
../../example/2d_cyclic/COLVAR+2.0+1.5.xvg +1.5 +2.0 100.0 100.0
../../example/2d_cyclic/COLVAR+2.0+1.75.xvg +1.75 +2.0 100.0 100.0
../../example/2d_cyclic/COLVAR+2.0+2.25.xvg +2.25 +2.0 100.0 100.0
../../example/2d_cyclic/COLVAR+2.0+2.5.xvg +2.5 +2.0 100.0 100.0
../../example/2d_cyclic/COLVAR+2.0+3.0.xvg +3.0 +2.0 100.0 100.0
../../example/2d_cyclic/COLVAR+2.25-3.0.xvg -3.0 +2.25 100.0 100.0
../../example/2d_cyclic/COLVAR+2.25-2.5.xvg -2.5 +2.25 100.0 100.0
../../example/2d_cyclic/COLVAR+2.25-2.25.xvg -2.25 +2.25 100.0 100.0
../../example/2d_cyclic/COLVAR+2.25-1.75.xvg -1.75 +2.25 100.0 100.0
../../example/2d_cyclic/COLVAR+2.25-1.5.xvg -1.5 +2.25 100.0 100.0
../../example/2d_cyclic/COLVAR+2.25-1.0.xvg -1.0 +2.25 100.0 100.0
../../example/2d_cyclic/COLVAR+2.25-0.75.xvg -0.75 +2.25 100.0 100.0
../../example/2d_cyclic/COLVAR+2.25-0.25.xvg -0.25 +2.25 100.0 100.0
../../example/2d_cyclic/COLVAR+2.25+0.0.xvg +0.0 +2.25 100.0 100.0
../../example/2d_cyclic/COLVAR+2.25+0.5.xvg +0.5 +2.25 100.0 100.0
../../example/2d_cyclic/COLVAR+2.25+0.75.xvg +0.75 +2.25 100.0 100.0
../../example/2d_cyclic/COLVAR+2.25+1.25.xvg +1.25 +2.25 100.0 100.0
../../example/2d_cyclic/COLVAR+2.25+1.5.xvg +1.5 +2.25 100.0 100.0
../../example/2d_cyclic/COLVAR+2.25+2.0.xvg +2.0 +2.25 100.0 100.0
../../example/2d_cyclic/COLVAR+2.25+2.25.xvg +2.25 +2.25 100.0 100.0
../../example/2d_cyclic/COLVAR+2.25+2.75.xvg +2.75 +2.25 100.0 100.0
../../example/2d_cyclic/COLVAR+2.25+3.0.xvg +3.0 +2.25 100.0 100.0
../../example/2d_cyclic/COLVAR+2.5-2.75.xvg -2.75 +2.5 100.0 100.0
../../example/2d_cyclic/COLVAR+2.5-2.5.xvg -2.5 +2.5 100.0 100.0
../../example/2d_cyclic/COLVAR+2.5-2.0.xvg -2.0 +2.5 100.0 100.0
../../example/2d_cyclic/COLVAR+2.5-1.75.xvg -1.75 +2.5 100.0 100.0
../../example/2d_cyclic/COLVAR+2.5-1.25.xvg -1.25 +2.5 100.0 100.0
../../example/2d_cyclic/COLVAR+2.5-1.0.xvg -1.0 +2.5 100.0 100.0
../../example/2d_cyclic/COLVAR+2.5-0.5.xvg -0.5 +2.5 100.0 100.0
../../example/2d_cyclic/COLVAR+2.5-0.25.xvg -0.25 +2.5 100.0 100.0
../../example/2d_cyclic/COLVAR+2.5+0.25.xvg +0.25 +2.5 100.0 100.0
../../example/2d_cyclic/COLVAR+2.5+0.5.xvg +0.5 +2.5 100.0 100.0
../../example/2d_cyclic/COLVAR+2.5+1.0.xvg +1.0 +2.5 100.0 100.0
../../example/2d_cyclic/COLVAR+2.5+1.25.xvg +1.25 +2.5 100.0 100.0
../../example/2d_cyclic/COLVAR+2.5+1.75.xvg +1.75 +2.5 100.0 100.0
../../example/2d_cyclic/COLVAR+2.5+2.0.xvg +2.0 +2.5 100.0 100.0
../../example/2d_cyclic/COLVAR+2.5+2.5.xvg +2.5 +2.5 100.0 100.0
../../example/2d_cyclic/COLVAR+2.5+2.75.xvg +2.75 +2.5 100.0 100.0
../../example/2d_cyclic/COLVAR+2.75-3.0.xvg -3.0 +2.75 100.0 100.0
../../example/2d_cyclic/COLVAR+2.75-2.75.xvg -2.75 +2.75 100.0 100.0
../../example/2d_cyclic/COLVAR+2.75-2.25.xvg -2.25 +2.75 100.0 100.0
../../example/2d_cyclic/COLVAR+2.75-2.0.xvg -2.0 +2.75 100.0 100.0
../../example/2d_cyclic/COLVAR+2.75-1.5.xvg -1.5 +2.75 100.0 100.0
../../example/2d_cyclic/COLVAR+2.75-1.25.xvg -1.25 +2.75 100.0 100.0
../../example/2d_cyclic/COLVAR+2.75-0.75.xvg -0.75 +2.75 100.0 100.0
../../example/2d_cyclic/COLVAR+2.75-0.5.xvg -0.5 +2.75 100.0 100.0
../../example/2d_cyclic/COLVAR+2.75+0.0.xvg +0.0 +2.75 100.0 100.0
../../example/2d_cyclic/COLVAR+2.75+0.25.xvg +0.25 +2.75 100.0 100.0
../../example/2d_cyclic/COLVAR+2.75+0.75.xvg +0.75 +2.75 100.0 100.0
../../example/2d_cyclic/COLVAR+2.75+1.0.xvg +1.0 +2.75 100.0 100.0
../../example/2d_cyclic/COLVAR+2.75+1.5.xvg +1.5 +2.75 100.0 100.0
../../example/2d_cyclic/COLVAR+2.75+1.75.xvg +1.75 +2.75 100.0 100.0
../../example/2d_cyclic/COLVAR+2.75+2.25.xvg +2.25 +2.75 100.0 100.0
../../example/2d_cyclic/COLVAR+2.75+2.5.xvg +2.5 +2.75 100.0 100.0
../../example/2d_cyclic/COLVAR+2.75+3.0.xvg +3.0 +2.75 100.0 100.0
../../example/2d_cyclic/COLVAR+3.0-3.0.xvg -3.0 +3.0 100.0 100.0
../../example/2d_cyclic/COLVAR+3.0-2.5.xvg -2.5 +3.0 100.0 100.0
../../example/2d_cyclic/COLVAR+3.0-2.25.xvg -2.25 +3.0 100.0 100.0
../../example/2d_cyclic/COLVAR+3.0-1.75.xvg -1.75 +3.0 100.0 100.0
../../example/2d_cyclic/COLVAR+3.0-1.5.xvg -1.5 +3.0 100.0 100.0
../../example/2d_cyclic/COLVAR+3.0-1.0.xvg -1.0 +3.0 100.0 100.0
../../example/2d_cyclic/COLVAR+3.0-0.75.xvg -0.75 +3.0 100.0 100.0
../../example/2d_cyclic/COLVAR+3.0-0.25.xvg -0.25 +3.0 100.0 100.0
../../example/2d_cyclic/COLVAR+3.0+0.0.xvg +0.0 +3.0 100.0 100.0
../../example/2d_cyclic/COLVAR+3.0+0.5.xvg +0.5 +3.0 100.0 100.0
../../example/2d_cyclic/COLVAR+3.0+0.75.xvg +0.75 +3.0 100.0 100.0
../../example/2d_cyclic/COLVAR+3.0+1.25.xvg +1.25 +3.0 100.0 100.0
../../example/2d_cyclic/COLVAR+3.0+1.5.xvg +1.5 +3.0 100.0 100.0
../../example/2d_cyclic/COLVAR+3.0+2.0.xvg +2.0 +3.0 100.0 100.0
../../example/2d_cyclic/COLVAR+3.0+2.25.xvg +2.25 +3.0 100.0 100.0
../../example/2d_cyclic/COLVAR+3.0+2.75.xvg +2.75 +3.0 100.0 100.0
../../example/2d_cyclic/COLVAR+3.0+3.0.xvg +3.0 +3.0 100.0 100.0

View File

@@ -0,0 +1,12 @@
# 500 pts
COLVAR_0-10.xvg 0.0 100
# 100 pts
COLVAR_0-2.xvg 0.0 100
# 250 pts
COLVAR_0-5.xvg 0.0 100
# 250 pts
COLVAR_5-10.xvg 0.0 100
# 150 pts
COLVAR_7-10.xvg 0.0 100
# 250 pts
COLVAR_2-7.xvg 0.0 100

View File

@@ -0,0 +1 @@
COLVAR_2-7.xvg 0.0 100

View File

@@ -6,64 +6,153 @@ mod integration {
use std::process::Command;
use std::fs;
use super::command::get_command;
use std::fs::OpenOptions;
use std::io::prelude::*;
#[test]
fn wham_1d_cyclic() {
let output_file = "/tmp/wham_test_1d_cyclic.out";
get_command()
.args(&["--bins", "100", "--max", "pi", "--min", "-pi", "-T", "300", "--cyclic"])
.args(&["--bt", "100", "--seed", "1234"])
.args(&["--seed", "1234"])
.args(&["-f", "example/1d_cyclic/metadata.dat"])
.args(&["-o", "/tmp/wham_test_1d_cyclic.out"])
.args(&["-o", output_file])
.output()
.expect("failed to execute process");
assert!(fs::metadata("/tmp/wham_test_1d_cyclic.out").is_ok());
assert!(fs::metadata(output_file).is_ok());
let output = Command::new("diff")
.arg("/tmp/wham_test_1d_cyclic.out")
.arg(output_file)
.arg("example/1d_cyclic/wham.out")
.output()
.expect("failed to run diff");
let output_len = String::from_utf8_lossy(&output.stdout).len();
assert_eq!(output_len, 0);
std::fs::remove_file(output_file).unwrap();
}
#[test]
fn wham_1d_cyclic_uncorrelated() {
let output_file = "/tmp/wham_test_1d_cyclic.out";
get_command()
.args(&["--bins", "100", "--max", "pi", "--min", "-pi", "-T", "300", "--cyclic", "--uncorr"])
.args(&["--seed", "1234"])
.args(&["-f", "example/1d_cyclic/metadata.dat"])
.args(&["-o", "/tmp/wham_test_1d_cyclic.out"])
.args(&["-o", output_file])
.output()
.expect("failed to execute process");
assert!(fs::metadata("/tmp/wham_test_1d_cyclic.out").is_ok());
let output = Command::new("diff")
.arg("/tmp/wham_test_1d_cyclic.out")
.arg(output_file)
.arg("example/1d_cyclic/wham_uncorrelated.out")
.output()
.expect("failed to run diff");
let output_len = String::from_utf8_lossy(&output.stdout).len();
assert_eq!(output_len, 0);
std::fs::remove_file(output_file).unwrap();
}
#[test]
#[ignore] // expensive
fn wham_2d_cyclic() {
fn wham_convdt() {
// run wham with convdt
let output_file = "/tmp/wham_test_convdt.out";
get_command()
.args(&["--bins", "100,100", "--max", "pi,pi", "--min", "-pi,-pi", "-T", "300", "--cyclic"])
.args(&["-f", "example/2d_cyclic/metadata.dat"])
.args(&["-o", "/tmp/wham_test_2d_cyclic.out"])
.args(&["--bins", "10", "--max", "pi", "--min", "-pi", "-T", "300", "--cyclic"])
.args(&["--seed", "1234", "--tolerance", "0.001"])
.args(&["--start", "0", "--end", "10"])
.args(&["--convdt", "1"])
.args(&["-f", "example/1d_cyclic/metadata.dat"])
.args(&["-o", output_file])
.output()
.expect("failed to execute process");
assert!(fs::metadata(output_file).is_ok());
assert!(fs::metadata("/tmp/wham_test_2d_cyclic.out").is_ok());
// run wham for individual sets
for i in 1..11 {
let output_file_single = format!("/tmp/wham_test_convdt_{}.out", i);
get_command()
.args(&["--bins", "10", "--max", "pi", "--min", "-pi", "-T", "300", "--cyclic"])
.args(&["--seed", "1234", "--tolerance", "0.001"])
.args(&["--start", "0", "--end", &i.to_string()])
.args(&["-f", "example/1d_cyclic/metadata.dat"])
.args(&["-o", &output_file_single])
.output()
.expect("failed to execute process");
assert!(fs::metadata(output_file_single).is_ok());
}
// combine individual runs
let output_combined = "/tmp/wham_test_convdt_combined.out";
let mut file = OpenOptions::new()
.create(true)
.write(true)
.open(output_combined)
.unwrap();
for i in 1..11 {
let output_file_single = format!("/tmp/wham_test_convdt_{}.out", i);
println!("{}", output_file_single);
file.write_all(format!("#Dataset {}\n", i-1).as_bytes()).unwrap();
file.write_all(fs::read_to_string(output_file_single.clone()).unwrap().as_bytes()).unwrap();
std::fs::remove_file(output_file_single).unwrap();
}
// compare combined runs with single run
let output = Command::new("diff")
.arg("/tmp/wham_test_2d_cyclic.out")
.arg("example/2d_cyclic/wham.out")
.arg(output_file)
.arg(output_combined)
.output()
.expect("failed to run diff");
let output_len = String::from_utf8_lossy(&output.stdout).len();
assert_eq!(output_len, 0);
std::fs::remove_file(output_combined).unwrap();
std::fs::remove_file(output_file).unwrap();
}
}
#[test]
fn wham_1d_cyclic_bootstrap() {
let output_file = "/tmp/wham_test_1d_cyclic_bt.out";
get_command()
.args(&["--bins", "100", "--max", "pi", "--min", "-pi", "-T", "300", "--cyclic"])
.args(&["--seed", "1234", "--bt", "100"])
.args(&["-f", "example/1d_cyclic/metadata.dat"])
.args(&["-o", output_file])
.output()
.expect("failed to execute process");
assert!(fs::metadata(output_file).is_ok());
let output = Command::new("diff")
.arg(output_file)
.arg("example/1d_cyclic/wham_bt.out")
.output()
.expect("failed to run diff");
let output_len = String::from_utf8_lossy(&output.stdout).len();
assert_eq!(output_len, 0);
std::fs::remove_file(output_file).unwrap();
}
#[test]
fn wham_2d_cyclic() {
let output_file = "/tmp/wham_test_2d_cyclic.out";
let out=
get_command()
.args(&["--bins", "50,50", "--max", "pi,pi", "--min", "-pi,-pi", "-T", "300", "--cyclic"])
.args(&["--tolerance", "0.001"])
.args(&["-f", "tests/data/metadata_2d_cyclic_reduced.dat"])
.args(&["-o", output_file])
.output()
.expect("failed to execute process");
println!("{:?}", out);
assert!(fs::metadata(output_file).is_ok());
let output = Command::new("diff")
.arg(output_file)
.arg("tests/data/2d_cyclic_reduced.out")
.output()
.expect("failed to run diff");
let output_len = String::from_utf8_lossy(&output.stdout).len();
assert_eq!(output_len, 0);
std::fs::remove_file(output_file).unwrap();
}
}