Skip to main content

A module for displaying NMR data with bokeh in Python or Jupyter Notebooks.

Project description

What is drawnmr?

drawnmr is a module for viewing NMR data in Python. When used with the nmrglue and bokeh packages, drawnmr provides functions to view and interact with NMR data.

drawnmr is a wrapper around nmrglue capabilities and provide helper functions to show the data in bokeh, which is an interactive visualisation library.

The main purpose is to show NMR data in a Jupyter Notebook. If a Jupyter Notebook installation is not running, bokeh allow the output to be saved to static HTML files.

nmrglue is used for processing nmrdata, and bokeh is used for showing and interacting. The function get_contour_widget() create ipywidgets to easily control contour levels. The function get_peakpick() calls nmrglue peakpick.pick() to find peaks, convert from data point to ppm coordinates, store in a pandas dataframe for easy inspection and add the peaks to the bokeh plot.

See examples

Use to:

Launch interactive Jupyter Notebook to try examples:

How to install?

If using conda, these steps will install an environment

# With pip from
pip install drawnmr

Developer install for local conda environment:

# Create environment
conda env create -f environment.yml

# Activate environment
conda env list
source activate drawnmr

# Enable ipywidgets
jupyter nbextension list
jupyter nbextension enable --py widgetsnbextension --sys-prefix

# Start jupyter
jupyter notebook

Or manual install in root environment:

# Manually install package
python install --force

#  Manually uninstall
python install --record files.txt
PACK=`dirname $(head -n 1 files.txt)`
rm -rf $PACK
#cat files.txt | xargs rm -rf


# Modify version in: drawnmr/

# Create tag
VERS=`python -c "from drawnmr import __version__; print(__version__)"`
# Adds a tag so that we can put this on PyPI
git tag $VERS -m ""
git push --tags origin master

# Upload your package to PyPI Test
python sdist upload -r pypitest

# Upload to PyPI Live
# Once you've successfully uploaded to PyPI Test, perform the same steps but point to the live PyPI server instead.
python sdist upload -r pypi

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

drawnmr-0.24.tar.gz (18.4 kB view hashes)

Uploaded source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page