diff --git a/README.md b/README.md index 1ca9013..6137b91 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ https://doi.org/10.5281/zenodo.11120922 To download: ``` -cd ~/xenium_benchmark +cd ~/benchmark-spatial-transcriptomics bash download_data.sh ``` @@ -26,7 +26,7 @@ This will place the data at `data/example_spinal_chord_inactive/`. If that folde If automatic download fails, download `example_spinal_chord_inactive.zip` manually from the link above and extract it into `data/`. ## Setup -Clone this repository along with the origianl Xenium benchmarking pipeline: +Clone this repository along with the original Xenium benchmarking pipeline: ``` git clone --recurse-submodules https://github.com/CBDatCMU/benchmark-spatial-transcriptomics.git @@ -36,6 +36,11 @@ cd benchmark-spatial-transcriptomics Install the conda environment: ``` +# Make sure that the current shell session is able to use conda +# This must be run once per login session. +source ~/miniconda3/etc/profile.d/conda.sh + +# create and activate the conda environment conda env create --file Xenium_benchmarking/xenium_benchmarking.yml --prefix ./envs/xb conda activate ./envs/xb pip install -e Xenium_benchmarking/ @@ -48,7 +53,7 @@ pip install -e Xenium_benchmarking/ sbatch submit_xenium.sh # Run directly -cd ~/xenium_benchmark +cd ~/benchmark-spatial-transcriptomics conda activate ~/xenium_benchmark/envs/xb python run_xenium_benchmark.py ``` diff --git a/run_xenium_benchmark.py b/run_xenium_benchmark.py index 243aee2..ff9f710 100644 --- a/run_xenium_benchmark.py +++ b/run_xenium_benchmark.py @@ -2,6 +2,12 @@ import os import sys + +# ── Banksy submodule path ────────────────────────────────────────────────────── +_repo = os.path.dirname(os.path.abspath(__file__)) +sys.path.insert(0, os.path.join(_repo, 'Xenium_benchmarking')) +sys.path.insert(0, os.path.join(_repo, 'Xenium_benchmarking', 'Banksy_py')) + import time import logging import numpy as np @@ -13,11 +19,6 @@ import matplotlib.pyplot as plt import squidpy as sq -# ── Banksy submodule path ────────────────────────────────────────────────────── -banksy_path = os.path.join(os.path.expanduser('~'), 'xenium_benchmark', 'Xenium_benchmarking', 'Banksy_py') -if banksy_path not in sys.path: - sys.path.insert(0, banksy_path) - # ── xb package imports ───────────────────────────────────────────────────────── from xb.formatting import * from xb.plotting import *