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.4.tar.gz (11.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

stDiff_sc-1.1.4-py3-none-any.whl (14.0 kB view details)

Uploaded Python 3

File details

Details for the file stDiff-sc-1.1.4.tar.gz.

File metadata

  • Download URL: stDiff-sc-1.1.4.tar.gz
  • Upload date:
  • Size: 11.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.9.6 readme-renderer/34.0 requests/2.25.1 requests-toolbelt/1.0.0 urllib3/1.26.5 tqdm/4.61.1 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.4 CPython/3.6.13

File hashes

Hashes for stDiff-sc-1.1.4.tar.gz
Algorithm Hash digest
SHA256 cb6f63a1bbb8439699370759fc3d1ad61a5eb05d21304a2bce5ea4dc7e74fa85
MD5 c3575b832b195db47f72874811d9c7af
BLAKE2b-256 790ca1bfad1c58e06fa8817b427234fb49cf9a60ac3e5d4d6264e9576902172c

See more details on using hashes here.

File details

Details for the file stDiff_sc-1.1.4-py3-none-any.whl.

File metadata

  • Download URL: stDiff_sc-1.1.4-py3-none-any.whl
  • Upload date:
  • Size: 14.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.9.6 readme-renderer/34.0 requests/2.25.1 requests-toolbelt/1.0.0 urllib3/1.26.5 tqdm/4.61.1 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.4 CPython/3.6.13

File hashes

Hashes for stDiff_sc-1.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 3dca59b036de90235e67f3609fbc4636807a1bc8bf4ec495e90a82852d0b7c13
MD5 dde07ade3c0cc2f6bdc1cd40f0dff545
BLAKE2b-256 bf5e5cad217f7bb55399f4959378632ecbe459cdf8c6a5f756e382f8325ccbf6

See more details on using hashes here.

Supported by

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