Skip to main content

A plugin to visualize 3D single cell omics

Project description

napari-sc3D-viewer

PyPI

tests codecov napari hub

A plugin to visualise 3D spatial single cell omics


This napari plugin was generated with Cookiecutter using @napari's cookiecutter-napari-plugin template.

Installation

You can install napari-sc3D-viewer via pip:

pip install .

(from the correct folder) or

pip install napari-sc3D-viewer

To install latest development version :

pip install git+https://github.com/GuignardLab/napari-sc3D-viewer.git

To install the surface computation enabled version it is necessary to use Python 3.9 (until VTK is ported to Python 3.10) and you can run one of the following commands:

pip install '.[pyvista]'

from the correct folder or

pip install napari-sc3D-viewer[pyvista]

to install directly from pip or

pip install 'napari-sc3D-viewer[pyvista] @ git+https://github.com/GuignardLab/napari-sc3D-viewer.git'

to install the latest version

Usage

napari-sc3D-viewer allows users to easily visualise and navigate 3D spatial single-cell transcriptomics using napari.

Loading and opening a dataset

The expected dataset is a scanpy/anndata h5ad file together with an optional json file that maps cluster id numbers to actual tissue/cluster name.

The json file should look like that:

{
    "1": "Endoderm",
    "2": "Heart",
    "10": "Anterior neuroectoderm"
}

If no json file or a wrong json file is given, the original cluster id numbers are used.

The h5ad file should be informed in (1) and the json file in (2). loading image

Let data be your h5ad data structure. To work properly, the viewer is expecting 4 different columns to be present in the h5ad file:

  • the cluster id column (by default named 'predicted.id' that can be accessed as data.obs['predicted.id'])
  • the 3D position column (by default named 'X_spatial_registered' that can be accessed as data.obsm['X_spatial_registered'])
  • the gene names if not already in the column name (by default named 'feature_name' that can be accessed as data.var['feature_name'])
  • umap coordinates (by default named 'X_umap' that can be accessed as data.obsm['X_umap'])

If the default column names are not consistent with your dataset, they can be changed in the tab Parameters (3) next to the tab Loading files

Once all the data paths and fields are correctly informed pressing the Load Atlas button (4) will load the dataset.

Exploring a dataset

Once the dataset is loaded there are few options to explore it.

The viewer should look like to the following: viewer

It is divided in two main parts, the Tissue visualisation (1) part and the Metric visualisation (2) one. Both of them are themselves split in two and three tabs respectively. All these tabs allow you to visualise and explore the dataset in different fashions.

The Tissues tab (1.1) allows to select the tissues to display, to show the legend and to colour the cells according to their tissue types.

The Surfaces tab (1.2) allows to construct coarse surfaces of tissues and to display them.

The Single metric tab (2.1) allows to display a metric, whether it is a gene intensity or a numerical metric that is embedded in the visualised dataset. This tab also allows to threshold cells according to the viewed metric, to change the contrast and the colour map.

The 2 Genes (2.2) tab allows to display gene coexpression.

The umap tab (2.3) allows to display the umap of the selected cells and to manually select subcategories of cells to be displayed.

viewer

Explanatory "videos".

The plugin is meant to be easy to use. That means that you should be able to play with it and figure things out by yourself.

That being said, it is not always that easy. You can find below a series of videos showing how to perform some of the main features.

Loading data

Loading data video

Selecting tissues

Selecting tissues video

Displaying one gene

Displaying one gene video

Displaying two genes co-expression

Displaying genes video

Playing with the umap

Playing with the umap video

Computing and processing the surface

Computing and processing the surface video

Contributing

Contributions are very welcome. Tests can be run with tox, please ensure the coverage at least stays the same before you submit a pull request.

License

Distributed under the terms of the MIT license, "napari-sc3D-viewer" is free and open source software

Issues

If you encounter any problems, please file an issue along with a detailed description.

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

napari-sc3D-viewer-0.1.0.tar.gz (19.9 kB view hashes)

Uploaded Source

Built Distribution

napari_sc3D_viewer-0.1.0-py3-none-any.whl (21.7 kB view hashes)

Uploaded Python 3

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