Skip to main content

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

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

stDiff-sc-1.1.3.tar.gz (12.8 kB view hashes)

Uploaded Source

Built Distribution

stDiff_sc-1.1.3-py3-none-any.whl (15.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page