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
-
Download an example dataset first: Google Drive dataset folder
Then place files under
data/merfish_mouse_hypothalamus/. -
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
- Documentation, tutorials, and API reference: https://yyh030806.github.io/DeepSpatial/docs/
- Homepage: https://yyh030806.github.io/DeepSpatial/
- Bug reports and feature requests: https://github.com/yyh030806/DeepSpatial/issues
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.
Metadata
Release files for deepspatial 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| deepspatial-1.0.0.tar.gz | 50.7 kB | With provenance | Details for deepspatial-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| deepspatial-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for deepspatial-1.0.0-py3-none-any.whl |
Total release size: 102.8 kB
Release files / deepspatial-1.0.0.tar.gz
| Download URL | deepspatial-1.0.0.tar.gz |
|---|---|
| Size | 50.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1ff5626ea18137e5c455a435147e406da092513fe3b96079a9ff4233e80bac21
|
|
BLAKE2b-256 checksum How to use checksums |
ac2a2dab158a18472da85820b6acd64569f458166113cad507d4fa5a519ee3ec
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 13, 2026.
Transparency logRelease files / deepspatial-1.0.0-py3-none-any.whl
| Download URL | deepspatial-1.0.0-py3-none-any.whl |
|---|---|
| Size | 52.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
32fa6aa6d452913cd023c8433e7dd3771246e0f7bd18efd460f23baf24fcaa18
|
|
BLAKE2b-256 checksum How to use checksums |
643c96c80bbefafad180765622a8930938e229e9cf3c51f5b3ef8abfc13f7285
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 13, 2026.
Transparency logSecurity for deepspatial 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for deepspatial-1.0.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 13, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.