Skip to main content

Jupyter widget facilitating interactive visualization of spatial single-cell data with Vitessce

Project description

vitessce-python

PyPI docs

Binder Open In Colab

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
$ uv sync --extra dev --extra docs --extra all

Alternatively, use conda:

$ conda create -n vitessce-dev python=3.12
$ conda activate vitessce-dev
$ pip install -e ".[dev,docs,all]"

Troubleshooting SpatialQuery installation on macOS:

$ # Use the macOS clang instead of from homebrew.
$ CC=/usr/bin/clang CXX=/usr/bin/clang++ pip install -e ".[dev,docs,all,sq]"

Linting and testing

uv run flake8
uv run pytest

Formatting

One file:

uv run autopep8 --in-place --aggressive ./path/to/file.py

All .py files:

find . -name '*.py' -exec uv run autopep8 --in-place --aggressive '{}' \;

Documentation

uv run make html

Deployment

To deploy a new version, increment the version of the Python package in pyproject.toml.

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.

This is also typically required when running !pip install vitessce[all] from within a Jupyter notebook cell in the same session as running vc.widget() for the first time. The Kernel restart/Output clearing is required when a new Jupyter widget is installed in the environment, otherwise Jupyter will not yet recognize the newly-installed widget (as the notebook was opened with a different set of Jupyter widgets installed, and widget discovery is performed only at certain stages in the notebook lifecycle).

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")

For more information see the data location options documentation.

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

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

vitessce-3.8.4.tar.gz (337.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

vitessce-3.8.4-py3-none-any.whl (82.8 kB view details)

Uploaded Python 3

File details

Details for the file vitessce-3.8.4.tar.gz.

File metadata

  • Download URL: vitessce-3.8.4.tar.gz
  • Upload date:
  • Size: 337.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for vitessce-3.8.4.tar.gz
Algorithm Hash digest
SHA256 0fdc84954b93d013005c6f77ceada3f199a69dbf04b6626ede8cf64c299abe40
MD5 0ad951110af471d9515a7594de28d735
BLAKE2b-256 5a5198d3ab59be19aa296492b9860b72fc51bcda169c46903199efc581fb24a7

See more details on using hashes here.

File details

Details for the file vitessce-3.8.4-py3-none-any.whl.

File metadata

  • Download URL: vitessce-3.8.4-py3-none-any.whl
  • Upload date:
  • Size: 82.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for vitessce-3.8.4-py3-none-any.whl
Algorithm Hash digest
SHA256 bf0c7ce34af0a9af7888cbadd5830c9b8b9801ed0b1f3be0c73db43175bbae1f
MD5 a687ec0e72a33facfde5a1614e9e15f4
BLAKE2b-256 98f60b116b0a746a61fb915e09c6f4e41d781384bbd0a745801a22bca27445ed

See more details on using hashes here.

Supported by

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