Package: wedap
WEDAP:weightedensembledataanalysis andplotting (pronounced we-dap)wedapis primarily used to plot H5 files produced from runningWESTPA.mdapcan be used to plot data files from analysis of standard MD simulations.For a demo and summary of features, see thisjupyter notebook.Or view the same demo notebook on thedocumentation web page.Requirementsnumpymatplotlibh5pyscipytqdmOptionalgif (optional for making gifs)gooey (optional for GUI)InstallationIf you don't need the GUI, then installingGooeyis not required and you can just pip install.pipinstallwedapOtherwise you can install withGooey, e.g. into a new conda env:condaenvcreate--namewedappython=3.8+
condaactivatewedap
condainstall-cconda-forgegooey
pipinstallwedapOr update an existing environmnent:condaactivateENV_NAME
condainstall-cconda-forgegooey
pipinstallwedapNote thatGooeyis kindof troublesome to pip install in some systems, which is also why it's not included in the requirements (although it is required for the GUI). For now, I recommend conda installingGooey.GUIwedaphas a GUI built usingGooeywhich can be launched from the command line by simply runningwedaporpython wedapif you're in the mainwedapdirectory of this repository.If you're using MacOSX, you'll need to runpythonw wedapin the main directory since conda prevents wxPython from accessing the display on Mac.
If you pip install (instead of conda installing)wxPythonandGooeyon Mac you may be able to just runwedap.For MacOSX, you can set up an alias in your.bash_profileby running the following:echo"alias wedap=pythonw /Path/to/wedap/git/repo/wedap/wedap">>~/.bash_profileThen simply typewedapin the terminal to run the wedap GUI.ExamplesAfter installation, to run the CLI version and view available options:wedap--helpOr:wedap-hTo start the GUI simply input:wedapTo start the GUI on MacOSX:pythonw/"Path to wedap git repo"/wedap/wedapTo visualize the evolution of the pcoord for the example p53.h5 file via CLI:wedap-h5wedap/data/p53.h5To do the same with the API:importwedapimportmatplotlib.pyplotaspltwedap.H5_Plot(h5="wedap/data/p53.h5",data_type="evolution").plot()plt.show()The resultingp53.h5file evolution plot will look like this:See the examples directory for more realistic applications using the Python API.Evolution plots are created by default using the CLI and GUI 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--Xnameor--Ynamefields:wedap-h5wedap/data/p53.h5--data_typeaverage--Xnamedihedral_10--Ynamedihedral_11Or:wedap-h5wedap/data/p53.h5-dtaverage-Xdihedral_10-Ydihedral_11The resultingp53.h5file average plot of the dihedral aux datasets will look like this: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 usepcoordwith the corresponding index set to the appropriate dimension (this also works with aux datasets which may have an additional dimension):wedap-h5wedap/data/p53.h5--data_typeaverage--Xnamepcoord--Xindex0--Ynamepcoord--Yindex1Or:wedap-h5wedap/data/p53.h5-dtaverage-Xpcoord-Xi0-Ypcoord-Yi1Or (since the default X options are the first pcoord, only the second pcoord needs to be specified):wedap-h5wedap/data/p53.h5-dtaverage-Ypcoord-Yi1The resultingp53.h5file average plot of the pcoord datasets will look like this:MotivationWESTPAalready comes with some excellent analysis tools for generating probability distributions, so why iswedapneeded?wedapwas originally built as a way to simplify the originalWESTPAplotting pipeline:NativeWESTPACLI-based Analysis Tools:┌───────┐       w_pdist        ┌────────┐        plothist         ┌────────┐
│west.h5├─────────────────────►│pdist.h5├────────────────────────►│plot.pdf│
└───────┘ --construct-dataset  └────────┘ --postprocess-function  └────────┘
               module.py                      plot_settings.pyAnalysis usingwedap:┌───────┐     wedap       ┌────────┐
│west.h5├────────────────►│plot.pdf│
└───────┘ CLI/GUI/Python  └────────┘Sowedapcan 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, themoviepyorgifpackage can be used with wedap to easily create a gif of your h5 file (see an example of this inwedap/h5_movie.py).The actual data can also be easily extracted and then analyzed (seewedap/h5_cluster.pyfor an example of k-means clustering using the data from a WESTPA west.h5 file).The GUI allows for users who may not be comfortable with command line tools or Python to be able to quickly analyze their simulation results.A CLI is also available if using wedap on a system without access to a display.Since the original implementation ofwedap, many more features have been added that are not available using theWESTPAw_pdistandplothisttools, 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 theskip_basisargument (available through the Python API only currently).More to come!Note that theWESTPAanalysis tools have features not available inwedapand may still be of interest to you.ContributingHave 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_nameTo switch to an existing branch, use:git checkout branch_nameTo submit your feature to be incorporated into the main branch, you should submit aPull Request. The repository maintainers will review your pull request before accepting your changes.CopyrightCopyright (c) 2021, Darian Yang