Skip to main content

stars-badge Downloads build-badge docs-badge license-badge PyPI Python 3.10

DECIPHER aims to learn cells’ disentangled intracellular molecular identity embedding and extracellular spatial context embedding from spatial omics data.

Please check our paper DECIPHER for learning disentangled cellular embeddings in large-scale heterogeneous spatial omics data on Nature Communications.

DECIPHER

Installation

PyPI

We recommend to install cell-decipher to a new conda environment:

conda create -n decipher -c conda-forge python==3.11 uv -y && conda activate decipher
uv pip install cell-decipher
install_pyg_dependencies

(Optional) You can install RAPIDS to accelerate visualization.

conda create -n decipher -c conda-forge -c rapidsai -c nvidia python=3.11 rapids=25.06 uv 'cuda-version>=12.0,<=12.8' -y && conda activate decipher
uv pip install cell-decipher
install_pyg_dependencies

Docker

Build docker image from Dockerfile or pull image from Docker Hub directly:

docker pull huhansan666666/decipher:latest
docker run --gpus all -it --rm huhansan666666/decipher:latest

Documentation

Minimal example

Here is a minimal example for quick start:

import scanpy as sc
from decipher import DECIPHER
from decipher.utils import scanpy_viz

# Init model
model = DECIPHER(work_dir='/path/to/work_dir')

# Register data (adata.X is raw counts, adata.obsm['spatial'] is spatial coordinates)
adata = sc.read_h5ad('/path/to/adata.h5ad')
model.register_data(adata)

# Fit DECIPHER model
model.fit_omics()

# Clustering disentangled embeddings
adata.obsm['X_center'] = model.center_emb  # intracellular molecular embedding
adata.obsm['X_nbr'] =  model.nbr_emb  # spatial context embedding
adata = scanpy_viz(adata, ['center', 'nbr'], rapids=False)

# Plot
adata.obsm['X_umap'] = adata.obsm['X_umap_center'].copy()
sc.pl.umap(adata, color=['cell_type'])
adata.obsm['X_umap'] = adata.obsm['X_umap_nbr'].copy()
sc.pl.umap(adata, color=['region'])

Tutorials

Please check documentation for all tutorials.

Name Description Colab
Basic Model Tutorial Tutorial on how to use DECIPHER Open In Colab
Multi-slices with Batch Effects Tutorial on how to apply DECIPHER to multiple slices with batch effects Open In Colab
Identify Localization-related LRs Tutorial on how to identify ligand-receptors which related with cells’ localization based on DECIPHER embeddings Insufficient resources
Multi-GPUs Training Tutorial on how to use DECIPHER with multi-GPUs on spatial atlas Insufficient resources
More technologies Tutorial on how to use DECIPHER with multiple spatial technologies Insufficient resources

Citation

DECIPHER for learning disentangled cellular embeddings in large-scale heterogeneous spatial omics data (Nature Communications)

If you want to repeat our benchmarks and case studies, please check the benchmark and experiments folder.

FAQ

Please open a new github issue if you meet problem.

  1. Visium or ST data

DECIPHER is designed for single cell resolution data. As for Visium or ST, you can still use DECIPHER after obtaining single-cell resolution through deconvolution or spatial mapping strategies.

Acknowledgement

We thank the following great open-source projects for their help or inspiration:

Metadata

Release files for cell-decipher 0.3.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cell-decipher 0.3.2
File Size Uploaded
cell_decipher-0.3.2.tar.gz 30.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for cell-decipher 0.3.2
File Interpreter ABI Platform
cell_decipher-0.3.2-py3-none-any.whl Python 3 none any Details

Total release size: 68.9 kB

Release files / cell_decipher-0.3.2.tar.gz

Download URL cell_decipher-0.3.2.tar.gz
Size 30.4 kB
Tags Source
SHA-256 checksum
How to use checksums
a2d92bdaf3ebf4e6e0a06f0b14dbb17af929e2496a850cf8bf4fc7d634dd4e3d
BLAKE2b-256 checksum
How to use checksums
2ffc3c1be6d070a2f77504ebca9b2db9ff966449385e0eaaaa21fd717b36343e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / cell_decipher-0.3.2-py3-none-any.whl

Download URL cell_decipher-0.3.2-py3-none-any.whl
Size 38.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9da4808d92e3f31bf2ae46f21428de01f4b8775b1ccfd67baad99a167459f73e
BLAKE2b-256 checksum
How to use checksums
7bb6cdbfde2732ebac58292cc3743e1ea0e98f486d21b56b2231ef26c5d65d7c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release history Release notifications | RSS feed

This release

0.3.2 This release

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page