This repository contains the code to reproduce the analyses and benchmarking experiments performed in the NicheCompass manuscript. The NicheCompass source code can be found here.
-
Clone the nichecompass-reproducibility repository and navigate into it:
git clone https://github.com/Lotfollahi-lab/nichecompass-reproducibility.git
cd nichecompass-reproducibility
-
(Optional) Install the Libmamba solver to make the installation faster:
conda update -n base conda
conda install -n base conda-libmamba-solver
conda config --set solver libmamba
-
Create the nichecompass-reproducibility conda environment:
conda env create -f envs/environment.yaml
Install pyg dependencies with GPU support:
conda activate nichecompass-reproducibility
pip install pyg_lib torch_scatter torch_sparse -f https://data.pyg.org/whl/torch-${TORCH}+${CUDA}.html
where${TORCH}
and${CUDA}
should be replaced by the specific PyTorch and CUDA versions, respectively.To enable GPU support for JAX, after the installation run:
conda activate nichecompass-reproducibility
pip install jaxlib==0.3.25+cuda${CUDA}.cudnn${CUDNN} -f https://storage.googleapis.com/jax-releases/jax_cuda_releases.html
For example, for CUDA 11.7, type:
conda activate nichecompass-reproducibility
pip install jaxlib==0.4.7+cuda11.cudnn86 -f https://storage.googleapis.com/jax-releases/jax_cuda_releases.html
-
Create the deeplinc conda environment (for benchmarking deeplinc method which relies on legacy packages and is incompatible with dependencies of other methods):
conda env create -f envs/environment_deeplinc.yaml
-
Create the cellcharter conda environment (for benchmarking cellcharter method which relies on legacy packages and is incompatible with dependencies of other methods):
conda env create -f envs/environment_cellcharter.yaml
-
Create the stalign conda environment (for starmap_plus_mouse_cns analysis which requires specific dependencies and is incompatible with dependencies of other analyses):
conda env create -f envs/environment_stalign.yaml
Install STalign into the environment:
conda activate stalign
pip install --upgrade "git+https://github.com/JEFworks-Lab/STalign.git"
-
Clone the nichecompass-reproducibility repository:
git clone https://github.com/Lotfollahi-lab/nichecompass-reproducibility.git
-
Clone the nichecompass repository:
git clone https://github.com/Lotfollahi-lab/nichecompass.git
-
From the root repository that contains both the nichecompass and nichecompass-reproducibility repositories, run:
docker buildx build --load --platform linux/amd64 --file nichecompass-reproducibility/envs/Dockerfile --tag nichecompass . --no-cache
(macOS) -
(For Charliecloud) Export the Docker image to a tarball:
docker export $(docker create nichecompass) | gzip -c > ./nichecompass.tar.gz
All preprocessed data used in the manuscript and trained models are downloadable from GDrive.
@article{Birk2024Quantitative,
title = {Quantitative characterization of cell niches in spatial atlases},
author = {Birk, S. and others},
journal = {bioRxiv},
year = {2024},
doi = {10.1101/2024.02.21.581428},
url = {https://www.biorxiv.org/content/10.1101/2024.02.21.581428}
}