A Custom Jupyter Widget Library
Project description
Clustergrammer2 is an interactive heatmap Jupyter widget built using the widget-ts-cookiecutter library and the WebGL library regl. Clustergrammer2 is built to help researchers interactively explore single cell data (e.g. scRNA-seq). Please see Case Studies and Tutorials for examples.
Clustergrammer2 Examples
Basic Example of Running Clustergrammer2 on MyBinder
The above notebook shows how Clustergrammer2 can be used to load a small dataset and visualize a large random DataFrame. By running the notebook on MyBinder using Jupyter Lab it can also be used to visualize a user uploaded dataset. Please see the video tutorial above for more information.
For additional examples and tutorials please see:
- Case Studies and Tutorials
- Clustergrammer2-Notebooks GitHub repository
2,700 PBMC scRNA-seq
Single cell RNA-seq (scRNA-seq) is a powerful method to interrogate gene expression across thousands of single cells. This method produces thousands of measurements (single cells) across thousands of dimensions (genes). This notebook uses Clustergrammer2 to interactively explore an example dataset measuring the gene expression of 2,700 PBMCs obtained from 10X Genomics. Bulk gene expression signatures of cell types from CIBERSORT were used to obtain a tentative cell type for each cell. Please see the video tutorial above for more information.
Clustergrammer2 Roadmap
Please see the project Roadmap for information on where the project is heading.
Installation
A typical installation requires the following commands to be run:
pip install clustergrammer2
jupyter nbextension install --py --sys-prefix clustergrammer2
jupyter nbextension enable --py --sys-prefix clustergrammer2
Optionally: --sys-prefix|--user|--system
Or, if you use jupyterlab:
pip install clustergrammer2
jupyter labextension install @jupyter-widgets/jupyterlab-manager
Embedding the widget into static HTML Notebooks
jupyter nbconvert --to html notebook.ipynb
Development
During development run npm run watch
for real time updates. When releasing a new version, first confirm that latest version of the front and back ends are working locally (check console logs, etc).
Updating versions
Update the versions in the following files
JavaScript
- package.json
- widget.ts
Python
- _version.py
- example.py
- requirements.txt
- _frontend.py
Webpack
Run the following commands to build the JavaScript bundle:
npm run build
npm run build:nbextension
npm run build:labextension
Publish to npm using
npm publish
These instructions are based on the release instructions from the jupyter-widgets/widget-ts-cookiecutterREADME.
Bundling the Python Package
Next, bundle the python package using (optinally delete the old versions under dist
)
python setup.py sdist bdist_wheel
Then, upload the PYPI:
twine upload dist/*
Checklist after release
After releasing a new version several things need to be checked to ensure proper widget functioning.
Check Package Managers
- https://www.npmjs.com/package/clustergrammer2 (can be slow to update)
- https://pypi.org/project/clustergrammer2/
Check HTML Embedding
- Run
jupyter nbconvert --to html introduction_nb.ipynb
(from the examples directory) to generate a static HTML and check that the latest widget is working (uses unpkg.com, like https://unpkg.com/clustergrammer2@0.5.18/dist/index.js) - Check NBViewer using link to notebook on GitHub (e.g. https://nbviewer.jupyter.org/github/ismms-himc/clustergrammer2/blob/master/examples/introduction_nb.ipynb?flush_cache=true). Make sure to use the querystring
flush_cache=True
in the URL to ensure that NBVIewer re-runs nbconvert.
Check Cloud Services
- Check MyBinder
Note for Sublime Development
Use this in the where section to restrict search
clustergrammer2/*.py,-*/build/*
Contact
For issues and concerns please use the issue tracker or gitter discussion room.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file clustergrammer2-0.18.0.tar.gz
.
File metadata
- Download URL: clustergrammer2-0.18.0.tar.gz
- Upload date:
- Size: 3.5 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b7744e283c5621829fa33c7b6fdd08a1d101e829c04c518b08573ee39d99f529 |
|
MD5 | e963e0f1f0e58fbdc5e968f3dd7e80e2 |
|
BLAKE2b-256 | ca9cfa7809af5bb14723e09890ef605433dbfef526e8f414931604728b1f5099 |
File details
Details for the file clustergrammer2-0.18.0-py2.py3-none-any.whl
.
File metadata
- Download URL: clustergrammer2-0.18.0-py2.py3-none-any.whl
- Upload date:
- Size: 3.9 MB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0796afc7230c77135c7b1ef6bf699f72cce056c5c6a7dedb45391c4f038c3f08 |
|
MD5 | e12ad819470a77e649a922f48f580bbc |
|
BLAKE2b-256 | 492935a884c2cdeb2c77e6131787a927ca40571a6ff8d8afb536c56fb6a7dc55 |