The implementations of SpatialZ, as well as tutorials, can be found at https://spatialz-tutorial.readthedocs.io/en/latest/.
This document provides detailed instructions for installing and setting up the SpatialZ project. Follow the steps below to configure your environment and install dependencies.
conda create -n spatialz python=3.9.19 -yconda activate spatialzpip install torch==1.13.0+cu117 -f https://download.pytorch.org/whl/cu117/torch_stable.htmlgit clone [https://github.com/senlin-lin/SpatialZ.git] /path/to/your/SpatialZ_code
cd /path/to/your/SpatialZ_codepip install -r requirements.txtWe also provide a Docker image that encapsulates our code and demo data, making it easier for users to directly download and use the provided resources. This image ensures a consistent and reproducible environment, allowing users to seamlessly run the code and explore the demo data without needing to configure dependencies or environments manually.
The following commands illustrate the basic steps to install Docker on Ubuntu system (Ubuntu system required):
sudo apt-get update
sudo apt-get install docker-ceTo download the Docker image, execute the following command:
sudo docker pull linsenlin/spatialz:latestOnce the image is pulled, users can start the Docker container on the new server. The following command will run the container and map port 8888 of the server to port 8888 of the container:
sudo docker run --gpus all -p 8888:8888 linsenlin/spatialz:latestAfter launching the Docker container, users can access Jupyter Notebook by navigating to port 8888 on the server. If the server's IP address is 'server_ip', simply enter the following URL in a web browser:
http://server_ip:8888
Reference: Lin, S., Wang, Z., Cui, Y., Zou, Q., Han, C., Yan, R., … & Yuan, Z. (2024). Bridging the Dimensional Gap from Planar Spatial Transcriptomics to 3D Cell Atlases. bioRxiv, 2024-12.