Skip to main content

Mapping cell locations via multi-layer regionalization constraints

Introduction

Resolving spatial cell arrangement is crucial for understanding physiological and pathological processes. While scRNA-seq captures gene expression at single-cell resolution, it loses spatial context, and current spatial transcriptomics methods often compromise on throughput or resolution. Existing integration methods face challenges with accuracy and scalability due to noise from molecular diffusion, cell segmentation errors, and disproportionate cell-type representation. We present Zmap, an algorithm framework employing multi-layered regional constraints to accurately assign cell locations, enhancing spatial accuracy and resilience to noise. Comparative analysis on benchmark datasets demonstrates Zmap’s superior accuracy and scalability over existing methods. Applied to liver cancer tissue, Zmap revealed spatial heterogeneity of cDC cells, a detail missed by deconvolution-based techniques, and achieved cell-cell interaction resolution beyond traditional mapping approaches. Additionally, Zmap outperforms current techniques in computational efficiency and resource usage, particularly with large-scale stereo-seq data, underscoring its potential for broad application.

Installation

Zmap can be installed either through GitHub or PyPI.

To install from GitHub:

git clone https://github.com/caiquanyou/Zmap
cd Zmap
python setup.py install # or pip install .

Alternatively, install via PyPI using:

pip install Zmap-sc

Usage

After installation, Zmap can be used in Python as follows:

   import Zmap as zm
   import scanpy as sc
   scdata = sc.read_h5ad('/Path/to/scdata.h5ad')
   stdata = sc.read_h5ad('/Path/to/stdata.h5ad')
   stdata_grid = zm.generate_grid(stdata,width=none)
   zm_object = zm.Zmap(scdata,stdata_grid,cluster_time=1,device='cpu')
   zm_object.allocate()
   cell_alocated_data = zm.sc2sc(scdata, stdata, zm_object.spot_matrix,thres=0.1,method='max')

Also can running in terminal:

zmap \
   -sc SC_path \
   -st ST_path \
   -w Width_of_grid \
   [-o OUTPUT] \
   [--cluster_time CLUSTER_TIME] \
   [--custom_region CUSTOM_REGION] \
   [--cluster_thres CLUSTER_THRES] \
   [--thres THRES] \
   [--method {max,lap}] \
   [--device {cpu,cuda}]

Contributing

Contributions to Zmap are welcome. Please refer to the project's issues and pull requests for areas where you can help.

License

Free Software

Support and Contact

For support or to contact the developers, please use the project's GitHub Issues page.

Metadata

Release files for Zmap-sc 1.0.1

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

Built distribution (wheel)

Table of built distributions (wheels) for Zmap-sc 1.0.1
File Interpreter ABI Platform
Zmap_sc-1.0.1-py2.py3-none-any.whl Python 2, Python 3 none any Details

Release files / Zmap_sc-1.0.1-py2.py3-none-any.whl

Download URL Zmap_sc-1.0.1-py2.py3-none-any.whl
Size 78.8 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
4a0850ad6d1649f5c48e8b1e052fd336eab92713178419d014095e0464f51bc6
BLAKE2b-256 checksum
How to use checksums
8321fe84eaa67c955ca9ea3ef2eec0a82cb7a4b6faf286adf1ac9b3ee8fd73b3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.8.15

Security for Zmap-sc 1.0.1

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A 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.

Release history Release notifications | RSS feed

This release

1.0.1 This release

1 release file No provenance

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