DOI: 10.5281/zenodo.18795737
title: StHistDDComp

description: # StHistDDComp

### _Spatial Transcriptomics Histology-based Domain Detection Comparison_

---

## Overview

Currently, the repository supports and integrates the following methods:

1.  [stLearn](https://github.com/BiomedicalMachineLearning/stLearn)2.  [SpaGCN](https://github.com/jianhuupenn/SpaGCN)3.  [conST](https://github.com/ys-zong/conST)4.  [DeepST](https://github.com/JiangBioLab/DeepST)5.  [ScribbleDom](https://github.com/1alnoman/ScribbleDom)

Each method is wrapped with a uniform interface for running experiments, saving results, and ensuring reproducibility across random seeds.

---

## Repository Structure

```txt    StHistDDComp/    │    ├── README.md    ├── conST_run/                 # Runner and setup scripts for conST    │   ├── README.md    │   ├── run_20.py    │   └── setup_conST_run.sh    ├── datasets/                  # Dataset folder (DLPFC, HBC, etc.)    │   └── ...    ├── DeepST_run/                # Runner and setup scripts for DeepST    │   ├── README.md    │   ├── config.json    │   ├── run_20.py    │   └── setup_DeepST_run.sh    ├── results/                   # Output folder for domain labels and metrics    ├── run_analysis/              # Analysis scripts for metrics and visualization    │   ├── config.json    │   └── wilcox.py    ├── ScribbleDom_run/           # Runner and setup scripts for ScribbleDom    │   ├── README.md    │   ├── config.json    │   ├── run_20.py    │   ├── ScribbleDom_run.py    │   └── setup_ScribbleDom_run.sh    ├── SpaGCN_run/                # Runner and setup scripts for SpaGCN    │   ├── README.md    │   ├── config.json    │   ├── run_20.py    │   └── setup_SpaGCN_run.sh    └── stLearn_run/               # Runner and setup scripts for stLearn        ├── README.md        ├── config.json        ├── run_20.py        └── setup_stLearn_run.sh```

---

## Setup Instructions

### 1\. Clone the repository

```bashgit clone https://github.com/asifajrof/StHistDDComp.gitcd StHistDDComp```

### 2\. Prepare datasets

Download and place your spatial transcriptomics datasets in the `datasets/` directory.  By default, the pipeline expects:

```txt    datasets/    └── DLPFC/        ├── 151507/        │   └── filtered_feature_bc_matrix.h5        ├── 151508/        └── ...```

---

## Running the Methods

Each method has its own environment and setup instructions.  You can run them independently as described below.

---

### **conST**

#### Setup

```bashcd conST_runconda create -n conST_run python=3.10conda activate conST_runbash setup_conST_run.sh```

#### MAE model weights download

download the model weights from [here](https://drive.google.com/file/d/1I7uLoL8ay8Scu_sYdjPg1jRaOtcpTNnP/view?usp=drive_link)

#### Configuration

Edit `/conST_run/config.json` to customize.

#### Run

```bashpython conST_run.py <path/to/config.json> <seed>```

Or run multiple seeds automatically:

```bashpython run_20.py DLPFC```

**Outputs:**

- `results/<histology_use>/results_seed_<seed>/<sample_name>/labels.csv`    Contains columns:

  - `label` – domain assignments  - `refined_label` – post-refinement domains

---

### **DeepST**

#### Setup

```bashcd DeepST_runconda create -n DeepST_run python=3.10conda activate DeepST_runbash setup_DeepST_run.sh```

#### Configuration

Edit `/DeepST_run/config.json` to customize.

#### Run

```bashpython DeepST_run.py <path/to/config.json> <seed>```

Or run multiple seeds automatically:

```bashpython run_20.py DLPFC```

**Outputs:**

- `results/w_hist/results_seed_<seed>/<sample_name>/labels.csv`    Contains columns:

  - `label` – domain assignments  - `refined_label` – post-refinement domains

---

### **SpaGCN**

#### Setup

```bashcd SpaGCN_runconda create -n SpaGCN_run python=3.10conda activate SpaGCN_runbash setup_SpaGCN_run.sh```

#### Configuration

Edit `/SpaGCN_run/config.json` to customize.

#### Run

```bashpython SpaGCN_run.py <path/to/config.json> <seed>```

Or run multiple seeds automatically:

```bashpython run_20.py DLPFC```

**Outputs:**

- `results/<histology_use>/results_seed_<seed>/<sample_name>/labels.csv`    Contains columns:

  - `label` – domain assignments  - `refined_label` – post-refinement domains

---

### **stLearn**

#### Setup

```bashcd stLearn_runconda create -n stLearn_run python=3.10conda activate stLearn_runbash setup_stLearn_run.sh```

#### Configuration

Edit `/stLearn_run/config.json` to customize.

#### Run

```bashpython stLearn_run.py <path/to/config.json> <seed>```

Or run multiple seeds automatically:

```bashpython run_20.py DLPFC```

**Outputs:**

- `results/w_hist/results_seed_<seed>/<sample_name>/labels.csv`    Contains columns:

  - `label` – domain assignments  - `refined_label` – post-refinement domains

---

### **ScribbleDom**

#### Setup

```bashcd ScribbleDom_rungit clone https://github.com/1alnoman/ScribbleDom.gitcd ScribbleDomconda env create -f environment.ymlcd ..```

#### Run

```bashconda activate scribble_dompython run_20.py```

This executes **ScribbleDom_run.py**, which:

- Updates seed values dynamically- Runs the model on DLPFC and HBC datasets- Saves results in `ScribbleDom_run/results/<seed>/`

---

## Reproducibility

Each runner script supports a **`seed`** parameter to ensure reproducibility.

Example:

```bashpython DeepST_run.py config.json 123```

The framework also provides `run_20.py` scripts to batch-run experiments across 20 predefined seeds for robust comparison.

---

Data - https://drive.google.com/drive/folders/1Dj2f8JlJGBpOxx1yEfNs0WWzrBq3hRKN?usp=sharingResults - https://drive.google.com/drive/folders/1bP-MZtCpAIwonRhDFwiFBbkTxIZgemGY?usp=sharing

# Analysis

For analysis from follow the guideline in Analysis/README.md. It will download the data from: (https://drive.google.com/drive/folders/1Dj2f8JlJGBpOxx1yEfNs0WWzrBq3hRKN?usp=sharing) and execute all the analysis if you don't have any /Analysis/data/ folder. If you want to run analysis on your own data, keep your data in, Analysis/Data folder.

For getting the data accross all the method download the data from: https://drive.google.com/drive/folders/1Dj2f8JlJGBpOxx1yEfNs0WWzrBq3hRKN?usp=sharing

For getting the reproducible result downlonload the results from: https://drive.google.com/drive/folders/1bP-MZtCpAIwonRhDFwiFBbkTxIZgemGY?usp=sharing