a diffusion model to impute ST data by learn scRNA-seq data
Project description
stDiff: A Diffusion Model for Imputing Spatial Transcriptomics through Single-Cell Transcriptomics
A novel method named stDiff investigates the potential of employing diffusion models for single-cell omics generation.
Framework
Arguments
stDiff
if gene num > 512 and num < 1024, batchsize = 512, hiddensize = 1024; if gene num < 512, batchsize = 2048, hiddensize = 512;
baseline
The specific parameter settings follow those in the Spatial Benchamark, and the baseline code is adapted from Spatial Benchmark, whose parameter settings also follow the default repositories of their respective models. The code for uniport is referenced in the example on its official website Impute genes for MERFISH.
How to run
ckpt
Five sets of cross-validated checkpoints(random_state = 0) for all datasets have been uploaded to https://drive.google.com/file/d/1oOSBm1cP0J5jYgiH3HNrgs1EDJS53YRR/view?usp=drive_link.
environment
conda env create -f environment.yml
conda activate stDiff
pip install -r requirements.txt
data preprocess
The datasets 2-16 in the experiment were all from the paper Benchmarking spatial and single-cell transcriptomics integration methods for transcript distribution prediction and cell type. The raw data were initially processed in 'process/data_process.py' to convert the txt file to h5ad, and only the genes shared by both ST and scRN-seq were retained.
run
test-stDiff for stDiff
test-baseline for baselines
python test-stDiff.py --sc_data 'sc_dataset(h5ad)' --sp_data 'sp_dataset(h5ad)' --document 'stDiff_result_name' --batch_size 512 --hidden_size 1024
python test-baseline.py --sc_data 'sc_dataset(h5ad)' --sp_data 'sp_dataset(h5ad)' --document 'base_result_name'
Use bash run.sh
run both methods
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for stDiff_sc-1.1.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 577d4710dd247e0eb5b681bda6cdee3070e030e43ee297bb7514e97c1288944c |
|
MD5 | 8cc703fc40a893407a8dfbd0e0d562e8 |
|
BLAKE2b-256 | 87550d25dc255f3415920d2ebf839c251b09487c76cc07e1b9ed81f45d64c6b9 |