Jupyter widget facilitating interactive visualization of spatial single-cell data with Vitessce
Project description
vitessce-python
Python API and Jupyter widget facilitating interactive visualization of spatial single-cell data with Vitessce.
Installation
To install with pip:
$ pip install vitessce[all]
Getting started
Explore our example notebooks. These contain demos of different use cases and integrations with single-cell data analysis packages.
Development
For a development installation (requires NodeJS and NPM),
$ git clone https://github.com/vitessce/vitessce-python.git
$ cd vitessce-python
$ conda env create -f environment.yml
$ conda activate vitessce-python-dev
$ pip install -e ".[dev,docs,all]"
Conda environments
In this repository, there are multiple conda environments for different purposes:
vitessce-python-dev
(defined in environment.yml) is used for the development of thevitessce
package itselfvitessce-python-notebooks
(defined in docs/notebooks/environment.yml) is used for running the example notebooks in thedocs/notebooks/
directory (seedocs/notebooks/README.md
for more information)vitessce-python-binder
(defined in binder/environment.yml) is the environment used by Binder upon opening notebooks from this repository
Linting and testing
flake8
pytest
Formatting
One file:
autopep8 --in-place --aggressive ./path/to/file.py
All .py
files:
find . -name '*.py' -exec autopep8 --in-place --aggressive '{}' \;
Documentation
make html
Deployment
To deploy a new version, increment the version of the Python package in setup.py
.
Then, when you push or merge the code with the incremented versions to main
, the GitHub Action deploy.yml
workflow will build and push the package to PyPI.
Troubleshooting
Check JavaScript console
Check the JavaScript console in the web browser for error messages. To do so, shift+right click in Jupyter, then click Inspect element. You may need to enable your browser's develop mode in its preferences for this option to appear when you right-click.
Check your Python environment
Check that you have activated the correct conda or other virtual environment as you expect.
When sharing errors, it can be helpful to share the current versions of packages in the environment, e.g., by conda list
or pip list
.
Restart Kernel and Clear All Outputs, then refresh the browser tab
To ensure that older widget JavaScript output is not causing conflicts with newer JavaScript output (which may persist via notebook outputs even without running notebook cells), clear old outputs by Kernel -> Restart Kernel and Clear All Outputs. Then refresh the browser tab (containing Jupyter) to ensure all JavaScript outputs are fresh.
Check the widget configuration
If the widget renders successfully, you can get its current configuration by
vw = vc.widget()
vw
vw.config
Usage when Jupyter is running on a remote machine
If Jupyter is running on a remote machine, then use proxy=True
. You may need to specify host_name
as well (widget
should be able to detect this but the plain display
cannot).
vw = vc.widget(proxy=True)
vw
or
vc.display(proxy=True, host_name="http://localhost:8888")
Ensure that Vitessce and Jupyter are installed in the same environment
With the environment activated, run pip list
on the command line:
Package Version
----------------------------- -----------
...
jupyterlab 3.x.x
...
vitessce 3.x.x
Resources
- ipywidget docs: Building a Custom Widget
- ipywidget docs: Low Level Widget Tutorial
- ipywidget example: ipyleaflet
- ipywidget example (with React): ipymaterialui
- ipywidget example (with React): higlass-python
- ipywidget cookiecutter
- Sphinx: Getting Started
- Read the Docs Sphinx Theme
- jupyter server proxy
Getting/Offering Help
If you have a specific bug or feature request, please feel free to open an issue. Otherwise our discussions section is a great place to get help or offer it. If you aren't sure if something is a bug or not, don't have all the reproduction steps, or just have a general question, feel free to open a discussion post.
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 vitessce-3.0.5.tar.gz
.
File metadata
- Download URL: vitessce-3.0.5.tar.gz
- Upload date:
- Size: 45.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.17
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2c85c99ffe10b537ea0764d3a02f506e38cdf0197d133f0725edd82616599c59 |
|
MD5 | a6021069fc0f3b1f02c8dccd569fdc27 |
|
BLAKE2b-256 | dd1af45a1b923f0c58c359b4f069d035070755f4ad11f12acf56a16f5819a94d |
File details
Details for the file vitessce-3.0.5-py2.py3-none-any.whl
.
File metadata
- Download URL: vitessce-3.0.5-py2.py3-none-any.whl
- Upload date:
- Size: 45.3 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.17
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c77ac3a484a272dbdb6daff1deb92513682e985094bbc20bf07bd543fcf2f2d1 |
|
MD5 | 807b90c92ba351b805c2a4b75a0c8d55 |
|
BLAKE2b-256 | c79d94853333b731fa5daffd8aa067376425e309f058bfd0738a96d6e45d85d3 |