Skip to main content

Reconstructing True 3D Spatial Omics at Single-Cell Resolution

Project description

DeepSpatial

PyPI Homepage Docs BioRxiv License

DeepSpatial is a package for true 3D reconstruction of spatial omics tissues from serial 2D slices, built with PyTorch and designed to work smoothly with AnnData/Scanpy workflows.

3D spatial omics reconstruction

DeepSpatial provides an end-to-end framework for learning continuous 3D tissue representations:

  • Reconstructs missing biological structure between adjacent sections.
  • Jointly models spatial coordinates, gene expression, and cell identities.
  • Supports large-scale training and sampling with GPU acceleration.
  • Produces outputs that can be directly used in downstream single-cell/spatial analysis.

The package exposes a high-level API (DeepSpatial) for data setup, model training, and 3D reconstruction with minimal boilerplate.

Installation

Recommended (PyPI):

pip install deepspatial

From source (development):

git clone https://github.com/yyh030806/DeepSpatial.git
cd DeepSpatial
pip install -e .

If you use GPU, install a PyTorch build matching your CUDA version.

Quick start

  1. Download an example dataset first: Google Drive dataset folder

    Then place files under data/merfish_mouse_hypothalamus/.

  2. Run DeepSpatial:

import glob
import scanpy as sc
import deepspatial as ds

adatas = [
    sc.read_h5ad(p)
    for p in sorted(glob.glob("data/merfish_mouse_hypothalamus/merfish_*.h5ad"))
]

model = ds.DeepSpatial()
model.setup_data(adatas)
model.build_model()
model.fit(max_epochs=100)

adata_3d = model.reconstruct_full_volume(adatas, thickness=10.0)

Resources

Citation

If you use DeepSpatial in your research, please cite:

@article {yang2026deepspatial,
	author = {Yang, Yuhang and Luo, Yiming and Zhang, Kai and Bu, Yonggan and Xia, Zheng and Peng, Haoxin and Yan, Rui and Liu, Qi and Chen, Yang and Shen, Lin and Chen, Enhong},
	title = {Reconstructing True 3D Spatial Omics at Single-Cell Resolution},
	year = {2026},
	doi = {10.64898/2026.04.28.721395},
	journal = {bioRxiv}
}

License

DeepSpatial is released under the MIT License.

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

deepspatial-1.0.0.tar.gz (50.7 kB view details)

Uploaded Source

Built Distribution

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

deepspatial-1.0.0-py3-none-any.whl (52.1 kB view details)

Uploaded Python 3

File details

Details for the file deepspatial-1.0.0.tar.gz.

File metadata

  • Download URL: deepspatial-1.0.0.tar.gz
  • Upload date:
  • Size: 50.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for deepspatial-1.0.0.tar.gz
Algorithm Hash digest
SHA256 1ff5626ea18137e5c455a435147e406da092513fe3b96079a9ff4233e80bac21
MD5 eef9432410e2da91e853608d09ffcc8c
BLAKE2b-256 ac2a2dab158a18472da85820b6acd64569f458166113cad507d4fa5a519ee3ec

See more details on using hashes here.

Provenance

The following attestation bundles were made for deepspatial-1.0.0.tar.gz:

Publisher: publish-pypi.yml on yyh030806/DeepSpatial

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file deepspatial-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: deepspatial-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 52.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for deepspatial-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 32fa6aa6d452913cd023c8433e7dd3771246e0f7bd18efd460f23baf24fcaa18
MD5 2e0ea420b35627d90dbdaf5d822790c7
BLAKE2b-256 643c96c80bbefafad180765622a8930938e229e9cf3c51f5b3ef8abfc13f7285

See more details on using hashes here.

Provenance

The following attestation bundles were made for deepspatial-1.0.0-py3-none-any.whl:

Publisher: publish-pypi.yml on yyh030806/DeepSpatial

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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