STABox is a one-stop platform for spatial transcriptomics data that provide a unified data processing pipeline, versatile data analysis modules, and interactive visualization. It integrates a suite of advanced analysis tools based on graph neural networks. STABox supports interactive 2D/3D visualization of spatial transcriptomics data, simplifying the generation and refinement of publication-ready high-quality images. STABox is extensible, allowing for seamless integration with various analysis methods to facilitate comprehensive downstream analysis of spatial transcriptomics data.
Folder structure:
stabox
├─src
│ └─stabox
│ ├─dataset
│ ├─extension
│ ├─model
│ ├─module_3D
│ ├─pl
│ ├─pp
│ └─view
└─tests
config
: save configuration yaml filesextension
: save the third-party code, e.g.SEDR
,SpaGCN
dataset
: save the code for loading data. All loading functions should return anAnnData
object with spatial information in.obsm['spatial']
.model
: save the model code, includingSTAgate
,STAligner
andSTAMarker
. All methods should be inherited fromBaseModelMixin
in_mixin.py
.module_3D
: save the converted 3D data for subsequent interactive visualization of 3D data.pl
: save the result image output after model training.pp
: save the preprocessing code, all preporcessing functions should takeAnnData
as input and returnAnnData
as output.view
: save the visualization code for gui.
The STABox package is developed based on the Python libraries Scanpy, PyTorch, DGL, and PyG (PyTorch Geometric) framework, and can be run on GPU (recommend) or CPU.
First clone the repository.
git clone https://github.com/zhanglabtools/STABox.git
cd STABox-main
It's recommended to create a separate conda environment for running STABox:
#create an environment called env_STABox
conda create -n env_STABox python=3.8
#activate your environment
conda activate env_STABox
The use of the mclust algorithm requires R environment, the rpy2 package (Python) and the mclust package (R). See https://pypi.org/project/rpy2/ and https://cran.r-project.org/web/packages/mclust/index.html for detail.
Install R environment in python by conda:
conda install -c conda-forge r-base
Other required packages are listed in STABox_env.yaml.
cd STABox-main\src
python -m stabox.view.app
If run successfully, you will launch the following GUI:
https://stabox-tutorial.readthedocs.io/en/latest/
If you have any questions, please feel free to contact us [email protected].
...
Q: How to install PyG from whl files?
A: Please download the whl files from https://pytorch-geometric.com/whl/index.html. Note that the version of python, torch, PyG, and cuda should match.