An algorithm framework employing multi-layered regional constraints to accurately assign cell locations, enhancing spatial accuracy and resilience to noise.
Project description
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file Zmap_sc-1.0.1-py2.py3-none-any.whl.
File metadata
- Download URL: Zmap_sc-1.0.1-py2.py3-none-any.whl
- Upload date:
- Size: 78.8 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.8.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4a0850ad6d1649f5c48e8b1e052fd336eab92713178419d014095e0464f51bc6
|
|
| MD5 |
944f86193a8b51820e2984be3b3d5b21
|
|
| BLAKE2b-256 |
8321fe84eaa67c955ca9ea3ef2eec0a82cb7a4b6faf286adf1ac9b3ee8fd73b3
|