Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrating multiple Visium HD samples #9652

Open
pratibha-bioinfo opened this issue Jan 27, 2025 · 1 comment
Open

Integrating multiple Visium HD samples #9652

pratibha-bioinfo opened this issue Jan 27, 2025 · 1 comment

Comments

@pratibha-bioinfo
Copy link

Hi Seurat team,

Thank you for providing support to analyze Visium HD samples. This is the first time I am using github so apologies if I did not follow syntax.

Is it correct to follow the 10X spatial integration vignette[https://satijalab.org/seurat/articles/spatial_vignette.html#working-with-multiple-slices-in-seurat] to integrate multiple Visium HD samples?

Kindly,
Pratibha

@Scathacheng
Copy link

Scathacheng commented Feb 10, 2025

Hi Pratibha and Seurat team,

I am encountering the same problem and showing my problem under the same issue.

I am analyzing 10X Visium HD data of 15 samples. Following the vignette of 10X spatial integration, I found some confusing problems:

  1. I used to analyze scRNA-seq data using Seurat V2 and SCTransform, the Seurat object has two assays of "RNA" and "SCT". However, when I tried to analyze 10X Visium HD data (https://satijalab.org/seurat/articles/visiumhd_analysis_vignette), I found that the Seurat object already has two assays of "8 um" and "16 um", which cannot perform “SCTransform” function directly. I want to know if it is ok that I do not run “SCTransform” in integrating multiple slices, as shown in the vignette (https://satijalab.org/seurat/articles/spatial_vignette.html#working-with-multiple-slices-in-seurat).

  2. I next used “harmony” to correct the batch effect. However, it also reports a warning that “quick transfer stage steps exceeded maximum”, and the harmony only finished 1 cycle (1/10). I am concerned that the results are not reproducible.

  3. Here is my code. Please tell me if there is any problem or if there is anything I did wrong. Much appreciate!

dir = c("01rawdata/04alldata/X1725569","01rawdata/04alldata/X1807783","01rawdata/04alldata/X1913448","01rawdata/04alldata/X2008632","01rawdata/04alldata/X201426205","01rawdata/04alldata/X202031171","01rawdata/04alldata/X202035595","01rawdata/04alldata/X2020586","01rawdata/04alldata/X202239003","01rawdata/04alldata/X202242073","01rawdata/04alldata/X20230970","01rawdata/04alldata/X202410354","01rawdata/04alldata/X2123326","01rawdata/04alldata/X2307031","01rawdata/04alldata/X2313317")

names(dir) = c("X1725569","X1807783","X1913448","X2008632","X201426205","X202031171","X202035595","X2020586","X202239003","X202242073","X20230970","X202410354","X2123326","X2307031","X2313317")

seu_list <- list()
for (i in 1:length(dir)) {
seu_list[[i]] = Load10X_Spatial(data.dir = dir[i])
seu_list[[i]]@meta.data$orig.ident = names(dir)[i]
}

seurat_ob = merge(seu_list[[1]], y=c(seu_list[[2]],seu_list[[3]],seu_list[[4]],seu_list[[5]],seu_list[[6]],seu_list[[7]],seu_list[[8]],seu_list[[9]],seu_list[[10]],seu_list[[11]],seu_list[[12]],seu_list[[13]],seu_list[[14]],seu_list[[15]]))

here, I decide to run the function from “NormalizeData” to “FindClusters” using the 0.16um and 0.08um, separately. I have no idea if this is right.

DefaultAssay(seurat_ob) <- "Spatial.016um"
seurat_ob <- NormalizeData(seurat_ob)
seurat_ob <- FindVariableFeatures(seurat_ob)
seurat_ob <- ScaleData(seurat_ob)
seurat_ob <- RunPCA(seurat_ob, verbose=FALSE)
seurat_ob <- RunHarmony(seurat_ob, group.by.vars = "orig.ident") #some warnings reported in this step
seurat_ob <- RunUMAP(seurat_ob, reduction="harmony", dims=1:30)
seurat_ob <- FindNeighbors(seurat_ob, reduction="harmony", dims=1:30)
seurat_ob <- FindClusters(object = seurat_ob, resolution = 0.4, algorithm = 1, verbose = F)

DefaultAssay(seurat_ob) <- "Spatial.008um"
seurat_ob <- NormalizeData(seurat_ob)
seurat_ob <- FindVariableFeatures(seurat_ob)
seurat_ob <- ScaleData(seurat_ob)
seurat_ob <- RunPCA(seurat_ob, verbose=FALSE)
seurat_ob <- RunHarmony(seurat_ob, group.by.vars = "orig.ident")
seurat_ob <- RunUMAP(seurat_ob, reduction="harmony", dims=1:30)
seurat_ob <- FindNeighbors(seurat_ob, reduction="harmony", dims=1:30)
seurat_ob <- FindClusters(object = seurat_ob, resolution = 0.4, algorithm = 1, verbose = F)

  1. Here is my sessionInfo()

R version 4.3.3 (2024-02-29)
Platform: x86_64-conda-linux-gnu (64-bit)
Running under: CentOS Linux 7 (Core)

Matrix products: default
BLAS/LAPACK: /gpfs/hpc/home/zhangyongch/jcdai/anaconda3/envs/myR/lib/libopenblasp-r0.3.21.so; LAPACK version 3.9.0

locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=en_US.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

time zone: Asia/Shanghai
tzcode source: system (glibc)

attached base packages:
[1] stats graphics grDevices utils datasets methods base

other attached packages:
[1] harmony_1.2.3 Rcpp_1.0.13-1 Seurat_5.1.0 SeuratObject_5.0.2
[5] sp_2.1-4

loaded via a namespace (and not attached):
[1] deldir_2.0-4 pbapply_1.7-2 gridExtra_2.3
[4] rlang_1.1.4 magrittr_2.0.3 RcppAnnoy_0.0.22
[7] matrixStats_1.4.1 ggridges_0.5.6 compiler_4.3.3
[10] spatstat.geom_3.3-4 png_0.1-8 vctrs_0.6.5
[13] reshape2_1.4.4 stringr_1.5.1 pkgconfig_2.0.3
[16] fastmap_1.2.0 promises_1.3.2 purrr_1.0.2
[19] jsonlite_1.8.9 goftest_1.2-3 later_1.4.1
[22] spatstat.utils_3.1-1 irlba_2.3.5.1 parallel_4.3.3
[25] cluster_2.1.8 R6_2.5.1 ica_1.0-3
[28] stringi_1.8.4 RColorBrewer_1.1-3 spatstat.data_3.1-4
[31] reticulate_1.40.0 parallelly_1.41.0 spatstat.univar_3.1-1
[34] lmtest_0.9-40 scattermore_1.2 tensor_1.5
[37] future.apply_1.11.3 zoo_1.8-12 sctransform_0.4.1
[40] httpuv_1.6.15 Matrix_1.6-5 splines_4.3.3
[43] igraph_2.1.2 tidyselect_1.2.1 abind_1.4-8
[46] spatstat.random_3.3-2 codetools_0.2-20 miniUI_0.1.1.1
[49] spatstat.explore_3.3-3 listenv_0.9.1 lattice_0.22-6
[52] tibble_3.2.1 plyr_1.8.9 shiny_1.10.0
[55] ROCR_1.0-11 Rtsne_0.17 future_1.34.0
[58] fastDummies_1.7.4 survival_3.8-3 polyclip_1.10-7
[61] fitdistrplus_1.2-1 pillar_1.10.0 KernSmooth_2.23-26
[64] plotly_4.10.4 generics_0.1.3 RcppHNSW_0.6.0
[67] ggplot2_3.5.1 munsell_0.5.1 scales_1.3.0
[70] globals_0.16.3 xtable_1.8-4 glue_1.8.0
[73] lazyeval_0.2.2 tools_4.3.3 data.table_1.16.4
[76] RSpectra_0.16-2 RANN_2.6.2 leiden_0.4.3.1
[79] dotCall64_1.2 cowplot_1.1.3 grid_4.3.3
[82] tidyr_1.3.1 colorspace_2.1-1 nlme_3.1-166
[85] patchwork_1.3.0 cli_3.6.3 spatstat.sparse_3.1-0
[88] spam_2.11-0 viridisLite_0.4.2 dplyr_1.1.4
[91] uwot_0.2.2 gtable_0.3.6 digest_0.6.37
[94] progressr_0.15.1 ggrepel_0.9.6 htmlwidgets_1.6.4
[97] farver_2.1.2 htmltools_0.5.8.1 lifecycle_1.0.4
[100] httr_1.4.7 mime_0.12 MASS_7.3-60

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants