Spanve: A Statistical Method for Detecting Downstream-friendly Spatially Variable Genes in Large-scale Spatial Transcriptomics Data
@article{gpb.25.SpanveStatistical,
title = {Spanve: {{A Statistical Method}} for {{Downstream-friendly Spatially Variable Genes}} in {{Large-scale Data}}},
shorttitle = {Spanve},
author = {Cai, Guoxin and Chen, Yichang and Chen, Shuqing and Gu, Xun and Zhou, Zhan},
date = {2025-11-24},
journaltitle = {Genomics, Proteomics \& Bioinformatics},
shortjournal = {genom. proteom. bioinform.},
pages = {qzaf111},
issn = {1672-0229},
doi = {10.1093/gpbjnl/qzaf111},
url = {https://doi.org/10.1093/gpbjnl/qzaf111},
urldate = {2025-11-25},
}
Analysis code for the paper is available at Evaluate directory.
- Install by pip (recommend):
pip install Spanve- Install by source
if there are some problems with the pip installation, you can install it from source code.
git clone https://github.com/gx-Cai/Spanve.git # or download the zip file and unzip
cd Spanve
pip install -e . # install in editable mode- no install usage:
# install required packages
cd Evaluate/Softs
pip install spanve_requirements.txt
cp Spanve.py $your_pathspanve --helpUsage: Spanve [OPTIONS]
Options:
-i, --input_file PATH input anndata file(h5ad file.)
-r, --running_mode TEXT running mode, default is f(c:cluster;
i:imputation; f:fitting)
-s, --save_path PATH save path
-v, --verbose BOOLEAN verbose
-n, --njobs INTEGER
-p, --preprocessed BOOLEAN int preprocessed or not.
--help Show this message and exit.****
command line usage can only run in a standard h5ad file, where there is a anndata.AnnData.obsm key named 'spatial'.
from Spanve import Spanve
adata = sc.read_h5ad('data.h5ad')
spanve = Spanve(adata)
# -- fitting for spatial genes
spanve.fit()
spanve.save('result.csv')
# -- spatial imputation
X = adata_preprocess(adata)
X_ = spanve.impute_from_graph(X[:,spanve.rejects])see tutorial notebook or html page.
- When numpy version is 1.24 or higher, you may enrounter the following error:
AttributeError: module 'numpy' has no attribute 'int0'
solution: downgrade numpy, or install by source code. [will fix in future release]