Skip to content
keyalonePublic

About

No description, website, or topics provided.

Resources

Stars

3 stars

Watchers

1 watching

Forks

Latest commit

 

History

3 Commits

Folders and files

Repository files navigation

EnSDD

R package supporting the paper "Enhancing spatial domain detection in spatial transcriptomics with EnSDD".

EnSDD integrates multiple base spatial domain detection (SDD) methods using a weighted optimization model to generate a consensus similarity matrix and introduces Louvain's algorithm to define spatial domains. EnSDD mainly includes four steps: (1) Running each base SDD method individually to obtain the base clustering label vector; (2) For each individual clustering result vector, a binary similarity matrix is then constructed based on the corresponding spot labels: if two spots belong to the same cluster, their similarity is set to 1; otherwise, it is 0; (3) Utilizing the binary similarity matrices generated by the base SDD methods, EnSDD introduces an optimization model to obtain a consensus similarity matrix of spots. This model aims to simultaneously derive the fully spatial similarity matrix between spots and adaptive weights assigned to each method. In addition, these learned weights serve as an evaluation metric for individual spatial clustering methods; (4) EnSDD incorporates Louvain's algorithm with adaptive resolution for the identification of spatial domains based on the ensemble similarity matrix of spots. R package applies ensemble learning for the deconvolution of spatial transcriptomic data. We offer an interactive platform to facilitate easier implementation and visualization for users EnSDD-shiny.

Schematic overview of EnSDD

The EnSDD package requires the main following R-package dependencies: Seurat, parallel, abind, SingleCellExperiment, scran, scater, BayesSpace, DR.SC, mclust, reticulate, spdep, spacexr, igraph, ggplot2, ggrepel, ggpubr, and several python packages: GraphST, STAGATE, spaGCN and stlearn. For the R-package dependencies, you can automatically load on most of the R package dependencies on your R when install the EnDecon R package by running the code:

devtools::install_github("Zhangxf-ccnu/EnSDD")

We check all the codes and examples in the EnSDD R package on the computer with the system of ubuntu 18.04, 64 GB RAM, i7-10700 CPU, RTX 3090 GPU. We also test the EnSDD R package on the linux sever with A100 GPU. If the dependencies are not installed correctly, please install them by yourself by the following instruction.

Install individual dependencies

  • Install python dependencies
### construct EnDecon python environment  
conda env create -f EnSDD.yml

If you want to run GraphST, STAGATE, spaGCN and stLearn for the ensemble learning, we advise that the users should install anaconda and run the upper command on the terminal (ubuntu)/CMD (windows) to install the python dependencies for running the methods. In our application, due to the computer with RTX3090 GPU, we install the pytorch with cudatookit. If you don't want to use the *.yml provided, you can install the python dependencies by the following code:

pip install -U stlearn
pip install GraphST
pip install SpaGCN
pip install scanpy
# install pytorch with CPU or GPU version

After install the python dependencies, the user need to get the path of environment of conda and set the path to the python_env variable in the function of run_individual_clustering in our package. The path is similar to "~/.conda/envs/EnSDD/bin/python" on the ubuntu and "~/anaconda3/envs/EnSDD/python.ext" on Windows.

  • Install R dependencies

BayesSpace

if (!requireNamespace("BiocManager", quietly = TRUE))
    install.packages("BiocManager")

BiocManager::install("BayesSpace")

DR.SC

install.packages("DR.SC")

spacexr

options(timeout = 600000000) 
devtools::install_github("dmcable/spacexr", build_vignettes = FALSE)

Seurat

install.packages("Seurat")

spdep

install.packages("spdep")

parallel and doParallel

install.packages("parallel")
install.packages("doParallel")

reticulate

install.packages('reticulate')

API allows users integrated spatial domain detection methods into the EnSDD

We provide the function 'deal_path' that allows users integrates the spatial domain detection methods into the process of EnSDD.

res_all <- patch_deal(res, clustering_df) 

The 'res' represents the clustering results generated by EnSDD, the 'clustering_df' represents the data frame provide users. The row represents the spots and the column represents the spatial domain detection methods provided by users.

Tutorials

Please do not hesitate to contact Prof. Zhang at zhangxf@ccnu.edu.cn to seek any clarifications regarding any content or operation of the archive.

About

No description, website, or topics provided.

Resources

Stars

3 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages