Skip to main content

wedap logo

tests docs PyPI version Downloads

DOI JCIM Paper

WEDAP : weighted ensemble data analysis and plotting (pronounced we-dap)

wedap is primarily used to plot H5 files produced from running WESTPA.

mdap can be used to plot data files from analysis of standard MD simulations.

wekap can be used to plot flux values as rates from a WESTPA created direct.h5 file.

For a demo and summary of features, see this jupyter notebook.

Or view the same demo notebook on the documentation web page.

What's New in v1.3.0

This release fixes h5 files being left open and locked by wedap (e.g. after an error in a Jupyter notebook), which could block other programs like w_multi_west from writing to them (see the H5 file access section below), along with fixes to the H5save_out, succ_only, skip_basis and multiple h5 file options.

v1.2.0 replaced the previously removed/deprecated gooey-based GUI with a streamlit app (see the Web app (Streamlit) section below). See CHANGELOG.md for more info.

Requirements

  • numpy
  • matplotlib
  • h5py
  • tqdm
  • gif

Installation

pip install wedap

Or install the latest development version from source:

git clone https://github.com/darianyang/wedap.git
cd wedap
pip install -e .

Examples

After installation, to run the CLI version and view available options:

wedap --help

Or:

wedap -h

To visualize the evolution of the pcoord for the example p53.h5 file via CLI:

wedap -h5 wedap/data/p53.h5

To do the same with the API:

import wedap
import matplotlib.pyplot as plt

wedap.H5_Plot(h5="wedap/data/p53.h5", data_type="evolution").plot()
plt.show()

The resulting p53.h5 file evolution plot will look like this:

p53 evo plot

See the examples directory for more realistic applications using the Python API.

Evolution plots are created by default using the CLI but average and instant probability distribution options are also available. To use one of your auxiliary datasets instead of the progress coordinate, just include the name of the aux dataset from your h5 file in the --Xname or --Yname fields:

wedap -h5 wedap/data/p53.h5 --data_type average --Xname dihedral_10 --Yname dihedral_11

Or:

wedap -h5 wedap/data/p53.h5 -dt average -X dihedral_10 -Y dihedral_11

The resulting p53.h5 file average plot of the dihedral aux datasets will look like this:

p53 avg aux plot

If you used a multi-dimensional progress coordinate and you want to use your pcoord for both the X and Y dimensions in a 2D average or instant plot, just use pcoord with the corresponding index set to the appropriate dimension (this also works with aux datasets which may have an additional dimension):

wedap -h5 wedap/data/p53.h5 --data_type average --Xname pcoord --Xindex 0 --Yname pcoord --Yindex 1

Or:

wedap -h5 wedap/data/p53.h5 -dt average -X pcoord -Xi 0 -Y pcoord -Yi 1

Or (since the default X options are the first pcoord, only the second pcoord needs to be specified):

wedap -h5 wedap/data/p53.h5 -dt average -Y pcoord -Yi 1

The resulting p53.h5 file average plot of the pcoord datasets will look like this:

p53 avg pcoord plot

H5 file access

wedap only keeps an h5 file open while one of its methods is running (e.g. pdist() or plot_trace()), and closes it again afterwards, even if there was an error. So an H5_Pdist or H5_Plot object left in a Jupyter notebook does not lock the file or block other programs like w_run or w_multi_west from writing to it. If you read from the h5 attribute of these objects directly, call close() when you are done.

When calling methods many times in a loop (e.g. get_parents()), use a with block to keep the file open for the whole loop instead of reopening it for each call, then it is closed at the end:

pdist = wedap.H5_Pdist(h5="west.h5", data_type="evolution")
with pdist:
    parents = [pdist.get_parents((10, seg)) for seg in range(50)]

Web app (Streamlit)

wedap ships with an optional browser-based interface built on Streamlit, providing a point-and-click alternative to the CLI (dataset dropdowns, live plot options, a downloadable figure, and a copy-pasteable equivalent Python snippet).

The app bundles all three tools as tabs (each tab keeps its own inputs when you switch between them):

  • wedap — WESTPA west.h5 probability distributions and plots (1D/2D/3D, plot tracing, gif making).
  • mdap — probability distributions and plots from standard MD analysis data files (.dat/.npy/...).
  • wekap — WE kinetics: rates/MFPTs from a direct.h5 file (RED correction, multi-replicate averaging).

Install the optional web extra and launch it:

pip install "wedap[web]"
wedap-web

Or run it directly on the app module:

streamlit run wedap/web/app.py

This starts a local server (default port 8501) and opens the app in your browser at http://localhost:8501.

Running on a remote cluster

If you run wedap-web on a remote machine (e.g. an HPC login or compute node), the server runs there but your browser is local, so you need to forward the port over SSH.

First launch it headless on the cluster (optionally pick a port to avoid clashes):

wedap-web --server.headless true --server.port 8501

Then, from your local machine, open an SSH tunnel and browse to http://localhost:8501:

# from a login node:
ssh -L 8501:localhost:8501 user@cluster

# from a compute node (two-hop; cNODE is the node's hostname):
ssh -L 8501:cNODE:8501 user@cluster-login

Keep the SSH session open while you use the app. If port 8501 is already in use locally, forward to a different local port, e.g. -L 8600:localhost:8501, and browse http://localhost:8600.

Tip: For large west.h5 files, use the app's "Server path" input mode (point it at a path on the cluster) rather than the file uploader, which holds the file in memory.

Motivation

WESTPA already comes with some excellent analysis tools for generating probability distributions, so why is wedap needed?

wedap was originally built as a way to simplify the original WESTPA plotting pipeline:

Native WESTPA CLI-based Analysis Tools:

┌───────┐       w_pdist        ┌────────┐        plothist         ┌────────┐
│west.h5├─────────────────────►│pdist.h5├────────────────────────►│plot.pdf│
└───────┘ --construct-dataset  └────────┘ --postprocess-function  └────────┘
               module.py                      plot_settings.py

Analysis using wedap:

┌───────┐     wedap      ┌────────┐
│west.h5├───────────────►│plot.pdf│
└───────┘  CLI/Python    └────────┘

So wedap can generate plots with more flexibilty and less intermediate files, providing an especially useful way to plot aux datasets and explore your h5 file.

  • The Python interface allows for advanced users to quickly generate a plot as a matplotlib axes object which can be further customized all in one Python script.
    • For example, the moviepy or gif package can be used with wedap to easily create a gif of your h5 file (see an example of this in wedap/h5_movie.py).
    • The actual data can also be easily extracted and then analyzed (see wedap/h5_cluster.py for an example of k-means clustering using the data from a WESTPA west.h5 file).
  • A CLI is also available if using wedap on a system without access to a display.

Since the original implementation of wedap, many more features have been added that are not available using the WESTPA w_pdist and plothist tools, these include the following:

  • Easy WE tracing and plotting by inputing an iteration and segment, or by inputing the X and Y value to then query and trace.
  • 3D plots that replace the probability with another pcoord or aux dataset (plot_mode="scatter3d").
  • Selective basis states (if you have multiple basis states, only plot the probability contributions from specific states).
    • See the skip_basis argument (available through the Python API only currently).
  • More to come!

Note that the WESTPA analysis tools have features not available in wedap and may still be of interest to you.

Contributing

Have an idea for a feature to add to wedap? Let me know and I may be able to incorporate it (dty7@pitt.edu).

Or feel free to try developing it yourself! Features should be developed on branches. To create and switch to a branch, use the command:

git checkout -b new_branch_name

To switch to an existing branch, use:

git checkout branch_name

To submit your feature to be incorporated into the main branch, you should submit a Pull Request. The repository maintainers will review your pull request before accepting your changes.

Copyright (c) 2021-2026, Darian Yang

Metadata

Release files for wedap 1.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for wedap 1.3.0
File Size Uploaded
wedap-1.3.0.tar.gz 122.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for wedap 1.3.0
File Interpreter ABI Platform
wedap-1.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 262.3 kB

Release files / wedap-1.3.0.tar.gz

Download URL wedap-1.3.0.tar.gz
Size 122.4 kB
Tags Source
SHA-256 checksum
How to use checksums
a0e54c754c7115e7aad2fc68fd18fc1b7235d872b50a70f911d3eb59221cce0e
BLAKE2b-256 checksum
How to use checksums
72eda5f85fbd17a3203cd93c2b7eae74eebd989f4a92227627404cb1298c68cc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 7, 2026.

Transparency log

Release files / wedap-1.3.0-py3-none-any.whl

Download URL wedap-1.3.0-py3-none-any.whl
Size 139.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5d56c62c3dc60442a70ac74f8cf0c7cd46591e628860c4c658ae63d2407260f9
BLAKE2b-256 checksum
How to use checksums
3859fe2b92e6c216244847bc382edc4cd1486b495b6ec26028cc826a575ae82c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 7, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

1.3.0 This release

2 release files

1.1.0

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.0.19

2 release files

0.0.17

2 release files

0.0.16

2 release files

0.0.15

2 release files

0.0.14

2 release files

0.0.13

2 release files

0.0.12

2 release files

0.0.11

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

0.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page