Welcome to spaceTree’s Documentation

Welcome to the official documentation for spaceTree! Here, you will find tutorials and guides to help you get started and make the most out of our tool.
Table of contents
Installation
PyTorch & PyTorch geometric dependencies
SpaceTree relies on pytorch
,pytorch geometric
, and pyg-lib
libraries for GNNs and efficient graph sampling routines. It was developed and tested with pytorch==2.0.1
, torch-geometric==2.5.0
and pyg-lib==0.2.0+pt20cu118
. We recommend using the same versions, when possible, otherwise, just go with the ones that are compatible with your CUDA version.
To install versions compatible with your CUDA version, please visit the official documentation of pytorch (1), pytorch geometric (2) and pyg-lib (3) and complete the installations in that order.
Please note, that access to GPU is advised, but not necessary, especially if the data size is not too large (i.e. for Visium HD we strongly recommend using GPU).
Example installation routine
To demonstrate the logic, here is an example installation for MacOS 14 without CUDA (CPU-only) and Python 3.10 (if that is not your desired configuration, please do not adjust the commands yourself, but refer to the official documentation of the libraries, because the syntax is platform dependent and some versions might be not compatible with each other):
conda create -y -n spacetree_env python=3.10
conda activate spacetree_env
conda install pytorch==2.3.0 torchvision==0.18.0 torchaudio==2.3.0 -c pytorch
pip install torch_geometric
pip install pyg_lib -f https://data.pyg.org/whl/torch-2.3.0+cpu.html
#test the installation
python -c "import torch_geometric; print(torch_geometric.typing.WITH_PYG_LIB)"
#TRUE
If the output is TRUE
, then the installation was successful. If not, please check the error message and try to resolve the issue based on the pytorch, pytorch geometric and pyg-lib documentation.
spaceTree Installation
Once you completed the installation of the dependencies, you can install spaceTree using pip or from source.
Installation with pip:
conda activate spacetree_env
pip install spaceTree
Installation from source:
conda activate spacetree_env
git clone https://github.com/PMBio/spaceTree.git
# cd in the spaceTree directory
cd spaceTree
pip install .
Tutorials
spaceTree is a versatile tool that can be used in a variety of applications. It works with both sequencing and imaging-based assays. The main difference in tutorials is the way spatial graph needs to be constructed. For technologies that are based on a grid (like Visium ST/HD) we rely on the grid for the graph construction. For technologies like Xenium, we compute the spatial similarity graph based on the spatial coordinates of the cells.
To understand the workflow please refer to our end-to-end tutorials.
For Visium/grid-based data:
For Xenium data, please refer to:
We do not provide a separate tutorial for Visium HD data, as the workflow is the same as for Visium data. However, we provide some tips and tricks for working with Visium HD data here.
If you need help defining clones based on your own scRNA-seq data, you can use tools such as inferCNV, inferCNVpy, copyKAT and others.
For the sake of the Visium and Xenium tutorials, we also show how we ran the clone inference based on inferCNVpy here
Citation
If you use spaceTree in your research, please cite our paper:
To be added