seurat icon indicating copy to clipboard operation
seurat copied to clipboard

Joining Layers after SCTransform

Open chungsai opened this issue 4 months ago • 1 comments

Hi, I have a merged object that I did SCTransform on,

merged_samples <- merge(seur_norm_list[[1]], c(seur_norm_list[[2]], seur_norm_list[[3]], seur_norm_list[[4]] ), # add.cell.ids = names(seur_raw_list), project = input_type, merge.data = TRUE)

merged_samples <- SCTransform(merged_samples )

but after trying

merged_samples <- JoinLayers(merged_samples) merged_samples <- JoinLayers(merged_samples, layers= 'SCT')

I get the error. Error in UseMethod(generic = "JoinLayers", object = object) : no applicable method for 'JoinLayers' applied to an object of class "c('SCTAssay', 'Assay', 'KeyMixin')"

Same error occurs even after IntegrateLayers.

I want to join layers get sce = GetAssayData(merged_samples, 'SCT')

This problem doesn't occur when I run the traditional

list <- lapply(X = raw, FUN = function(x) { x <- NormalizeData(x) x <- FindVariableFeatures(x, selection.method = "vst", nfeatures = 2000) })

and then merge using the same code then join layers.

session_info() ─ Session info ────────────────────────────────────────────────────────────────────────────────────────────────────────────── setting value version R version 4.3.2 (2023-10-31) os macOS Ventura 13.0 system aarch64, darwin20 ui RStudio language (EN) collate en_US.UTF-8 ctype en_US.UTF-8 tz America/Toronto date 2024-02-29 rstudio 2023.12.1+402 Ocean Storm (desktop) pandoc 3.1.1 @ /Applications/RStudio.app/Contents/Resources/app/quarto/bin/tools/ (via rmarkdown)

─ Packages ────────────────────────────────────────────────────────────────────────────────────────────────────────────────── package * version date (UTC) lib source abind * 1.4-5 2016-07-21 [1] CRAN (R 4.3.0) annotate * 1.80.0 2023-10-26 [1] Bioconductor AnnotationDbi * 1.64.1 2023-11-02 [1] Bioconductor AUCell * 1.24.0 2023-10-24 [1] Bioconductor beachmat 2.18.1 2024-02-17 [1] Bioconductor 3.18 (R 4.3.2) beeswarm 0.4.0 2021-06-01 [1] CRAN (R 4.3.0) Biobase * 2.62.0 2023-10-26 [1] Bioconductor BiocFileCache 2.10.1 2023-10-26 [1] Bioconductor BiocGenerics * 0.48.1 2023-11-02 [1] Bioconductor BiocIO 1.12.0 2023-10-26 [1] Bioconductor BiocManager * 1.30.22 2023-08-08 [1] CRAN (R 4.3.0) BiocNeighbors 1.20.2 2024-01-13 [1] Bioconductor 3.18 (R 4.3.2) BiocParallel * 1.36.0 2023-10-26 [1] Bioconductor BiocSingular 1.18.0 2023-11-06 [1] Bioconductor biomaRt * 2.58.2 2024-02-03 [1] Bioconductor 3.18 (R 4.3.2) Biostrings 2.70.2 2024-01-30 [1] Bioconductor 3.18 (R 4.3.2) bit 4.0.5 2022-11-15 [1] CRAN (R 4.3.0) bit64 4.0.5 2020-08-30 [1] CRAN (R 4.3.0) bitops 1.0-7 2021-04-24 [1] CRAN (R 4.3.0) blob 1.2.4 2023-03-17 [1] CRAN (R 4.3.0) bluster 1.12.0 2023-12-19 [1] Bioconductor 3.18 (R 4.3.2) cachem 1.0.8 2023-05-01 [1] CRAN (R 4.3.0) caTools 1.18.2 2021-03-28 [1] CRAN (R 4.3.0) cli 3.6.2 2023-12-11 [1] CRAN (R 4.3.1) cluster 2.1.6 2023-12-01 [1] CRAN (R 4.3.1) codetools 0.2-19 2023-02-01 [1] CRAN (R 4.3.2) colorspace 2.1-0 2023-01-23 [1] CRAN (R 4.3.0) combinat 0.0-8 2012-10-29 [1] CRAN (R 4.3.0) cowplot 1.1.3 2024-01-22 [1] CRAN (R 4.3.1) crayon 1.5.2 2022-09-29 [1] CRAN (R 4.3.0) curl 5.2.0 2023-12-08 [1] CRAN (R 4.3.1) data.table * 1.15.0 2024-01-30 [1] CRAN (R 4.3.1) DBI 1.2.2 2024-02-16 [1] CRAN (R 4.3.1) dbplyr 2.4.0 2023-10-26 [1] CRAN (R 4.3.1) DDRTree * 0.1.5 2017-04-30 [1] CRAN (R 4.3.0) DelayedArray * 0.28.0 2023-11-06 [1] Bioconductor DelayedMatrixStats * 1.24.0 2023-11-06 [1] Bioconductor deldir 2.0-2 2023-11-23 [1] CRAN (R 4.3.1) devtools * 2.4.5 2022-10-11 [1] CRAN (R 4.3.0) digest 0.6.34 2024-01-11 [1] CRAN (R 4.3.1) dotCall64 1.1-1 2023-11-28 [1] CRAN (R 4.3.1) dplyr 1.1.4 2023-11-17 [1] CRAN (R 4.3.1) dqrng 0.3.2 2023-11-29 [1] CRAN (R 4.3.1) edgeR 4.0.16 2024-02-20 [1] Bioconductor 3.18 (R 4.3.2) ellipsis 0.3.2 2021-04-29 [1] CRAN (R 4.3.0) evaluate 0.23 2023-11-01 [1] CRAN (R 4.3.1) fansi 1.0.6 2023-12-08 [1] CRAN (R 4.3.1) farver 2.1.1 2022-07-06 [1] CRAN (R 4.3.0) fastDummies 1.7.3 2023-07-06 [1] CRAN (R 4.3.0) fastICA 1.2-4 2023-11-27 [1] CRAN (R 4.3.1) fastmap 1.1.1 2023-02-24 [1] CRAN (R 4.3.0) fastmatch 1.1-4 2023-08-18 [1] CRAN (R 4.3.0) fgsea * 1.28.0 2023-10-26 [1] Bioconductor filelock 1.0.3 2023-12-11 [1] CRAN (R 4.3.1) fitdistrplus 1.1-11 2023-04-25 [1] CRAN (R 4.3.0) fs 1.6.3 2023-07-20 [1] CRAN (R 4.3.0) future 1.33.1 2023-12-22 [1] CRAN (R 4.3.1) future.apply 1.11.1 2023-12-21 [1] CRAN (R 4.3.1) generics 0.1.3 2022-07-05 [1] CRAN (R 4.3.0) GenomeInfoDb * 1.38.6 2024-02-10 [1] Bioconductor 3.18 (R 4.3.2) GenomeInfoDbData 1.2.11 2024-01-17 [1] Bioconductor GenomicAlignments 1.38.2 2024-01-20 [1] Bioconductor 3.18 (R 4.3.2) GenomicRanges * 1.54.1 2023-10-30 [1] Bioconductor ggbeeswarm 0.7.2 2023-04-29 [1] CRAN (R 4.3.0) ggplot2 * 3.5.0 2024-02-23 [1] CRAN (R 4.3.1) ggrastr 1.0.2 2023-06-01 [1] CRAN (R 4.3.0) ggrepel 0.9.5 2024-01-10 [1] CRAN (R 4.3.1) ggridges 0.5.6 2024-01-23 [1] CRAN (R 4.3.1) glmGamPoi 1.14.3 2024-02-10 [1] Bioconductor 3.18 (R 4.3.2) globals 0.16.2 2022-11-21 [1] CRAN (R 4.3.0) glue 1.7.0 2024-01-09 [1] CRAN (R 4.3.1) goftest 1.2-3 2021-10-07 [1] CRAN (R 4.3.0) gplots * 3.1.3.1 2024-02-02 [1] CRAN (R 4.3.1) gprofiler2 * 0.2.3 2024-02-23 [1] CRAN (R 4.3.1) graph * 1.80.0 2023-10-26 [1] Bioconductor gridExtra 2.3 2017-09-09 [1] CRAN (R 4.3.0) GSEABase * 1.64.0 2023-10-26 [1] Bioconductor GSVA * 1.50.0 2023-11-06 [1] Bioconductor gtable 0.3.4 2023-08-21 [1] CRAN (R 4.3.0) gtools 3.9.5 2023-11-20 [1] CRAN (R 4.3.1) harmony * 1.2.0 2023-11-29 [1] CRAN (R 4.3.1) HDF5Array 1.30.1 2024-02-17 [1] Bioconductor 3.18 (R 4.3.2) hdf5r 1.3.9 2024-01-14 [1] CRAN (R 4.3.1) hms 1.1.3 2023-03-21 [1] CRAN (R 4.3.0) HSMMSingleCell 1.22.0 2023-10-26 [1] Bioconductor htmltools 0.5.7 2023-11-03 [1] CRAN (R 4.3.1) htmlwidgets 1.6.4 2023-12-06 [1] CRAN (R 4.3.1) httpuv 1.6.14 2024-01-26 [1] CRAN (R 4.3.1) httr 1.4.7 2023-08-15 [1] CRAN (R 4.3.0) ica 1.0-3 2022-07-08 [1] CRAN (R 4.3.0) igraph 2.0.2 2024-02-17 [1] CRAN (R 4.3.1) IRanges * 2.36.0 2023-10-26 [1] Bioconductor irlba * 2.3.5.1 2022-10-03 [1] CRAN (R 4.3.0) jsonlite 1.8.8 2023-12-04 [1] CRAN (R 4.3.1) KEGGREST 1.42.0 2023-10-26 [1] Bioconductor KernSmooth 2.23-22 2023-07-10 [1] CRAN (R 4.3.2) knitr 1.45 2023-10-30 [1] CRAN (R 4.3.1) labeling 0.4.3 2023-08-29 [1] CRAN (R 4.3.0) later 1.3.2 2023-12-06 [1] CRAN (R 4.3.1) lattice 0.22-5 2023-10-24 [1] CRAN (R 4.3.1) lazyeval 0.2.2 2019-03-15 [1] CRAN (R 4.3.0) leiden 0.4.3.1 2023-11-17 [1] CRAN (R 4.3.1) leidenbase 0.1.27 2023-12-01 [1] CRAN (R 4.3.1) lifecycle 1.0.4 2023-11-07 [1] CRAN (R 4.3.1) limma * 3.58.1 2023-11-02 [1] Bioconductor listenv 0.9.1 2024-01-29 [1] CRAN (R 4.3.1) lmtest 0.9-40 2022-03-21 [1] CRAN (R 4.3.0) locfit 1.5-9.8 2023-06-11 [1] CRAN (R 4.3.0) magrittr 2.0.3 2022-03-30 [1] CRAN (R 4.3.0) MASS * 7.3-60.0.1 2024-01-13 [1] CRAN (R 4.3.1) Matrix * 1.6-5 2024-01-11 [1] CRAN (R 4.3.1) MatrixGenerics * 1.14.0 2023-10-26 [1] Bioconductor matrixStats * 1.2.0 2023-12-11 [1] CRAN (R 4.3.1) memoise 2.0.1 2021-11-26 [1] CRAN (R 4.3.0) metapod 1.10.1 2023-12-23 [1] Bioconductor 3.18 (R 4.3.2) mime 0.12 2021-09-28 [1] CRAN (R 4.3.0) miniUI 0.1.1.1 2018-05-18 [1] CRAN (R 4.3.0) multtest * 2.58.0 2023-10-26 [1] Bioconductor munsell 0.5.0 2018-06-12 [1] CRAN (R 4.3.0) nlme 3.1-164 2023-11-27 [1] CRAN (R 4.3.1) org.Hs.eg.db * 3.18.0 2024-02-15 [1] Bioconductor org.Rn.eg.db * 3.18.0 2024-02-15 [1] Bioconductor parallelly 1.37.0 2024-02-14 [1] CRAN (R 4.3.1) patchwork 1.2.0 2024-01-08 [1] CRAN (R 4.3.1) pbapply 1.7-2 2023-06-27 [1] CRAN (R 4.3.0) pheatmap * 1.0.12 2019-01-04 [1] CRAN (R 4.3.0) pillar 1.9.0 2023-03-22 [1] CRAN (R 4.3.0) pkgbuild 1.4.3 2023-12-10 [1] CRAN (R 4.3.1) pkgconfig 2.0.3 2019-09-22 [1] CRAN (R 4.3.0) pkgload 1.3.4 2024-01-16 [1] CRAN (R 4.3.1) plotly 4.10.4 2024-01-13 [1] CRAN (R 4.3.1) plyr 1.8.9 2023-10-02 [1] CRAN (R 4.3.1) png 0.1-8 2022-11-29 [1] CRAN (R 4.3.0) polyclip 1.10-6 2023-09-27 [1] CRAN (R 4.3.1) presto * 1.0.0 2024-02-08 [1] Github (immunogenomics/presto@31dc97f) prettyunits 1.2.0 2023-09-24 [1] CRAN (R 4.3.1) profvis 0.3.8 2023-05-02 [1] CRAN (R 4.3.0) progress 1.2.3 2023-12-06 [1] CRAN (R 4.3.1) progressr 0.14.0 2023-08-10 [1] CRAN (R 4.3.0) promises 1.2.1 2023-08-10 [1] CRAN (R 4.3.0) purrr 1.0.2 2023-08-10 [1] CRAN (R 4.3.0) R.methodsS3 1.8.2 2022-06-13 [1] CRAN (R 4.3.0) R.oo 1.26.0 2024-01-24 [1] CRAN (R 4.3.1) R.utils 2.12.3 2023-11-18 [1] CRAN (R 4.3.1) R6 2.5.1 2021-08-19 [1] CRAN (R 4.3.0) RANN 2.6.1 2019-01-08 [1] CRAN (R 4.3.0) rappdirs 0.3.3 2021-01-31 [1] CRAN (R 4.3.0) RColorBrewer 1.1-3 2022-04-03 [1] CRAN (R 4.3.0) Rcpp * 1.0.12 2024-01-09 [1] CRAN (R 4.3.1) RcppAnnoy 0.0.22 2024-01-23 [1] CRAN (R 4.3.1) RcppHNSW 0.6.0 2024-02-04 [1] CRAN (R 4.3.1) RCurl 1.98-1.14 2024-01-09 [1] CRAN (R 4.3.1) remotes 2.4.2.1 2023-07-18 [1] CRAN (R 4.3.0) reshape2 1.4.4 2020-04-09 [1] CRAN (R 4.3.0) restfulr 0.0.15 2022-06-16 [1] CRAN (R 4.3.0) reticulate 1.35.0 2024-01-31 [1] CRAN (R 4.3.1) rhdf5 2.46.1 2023-12-02 [1] Bioconductor 3.18 (R 4.3.2) rhdf5filters 1.14.1 2023-12-16 [1] Bioconductor 3.18 (R 4.3.2) Rhdf5lib 1.24.2 2024-02-10 [1] Bioconductor 3.18 (R 4.3.2) rjson 0.2.21 2022-01-09 [1] CRAN (R 4.3.0) rlang 1.1.3 2024-01-10 [1] CRAN (R 4.3.1) rmarkdown 2.25 2023-09-18 [1] CRAN (R 4.3.1) ROCR 1.0-11 2020-05-02 [1] CRAN (R 4.3.0) Rsamtools 2.18.0 2023-10-26 [1] Bioconductor RSpectra 0.16-1 2022-04-24 [1] CRAN (R 4.3.0) RSQLite 2.3.5 2024-01-21 [1] CRAN (R 4.3.1) rstudioapi 0.15.0 2023-07-07 [1] CRAN (R 4.3.0) rsvd 1.0.5 2021-04-16 [1] CRAN (R 4.3.0) rtracklayer 1.62.0 2023-10-26 [1] Bioconductor Rtsne 0.17 2023-12-07 [1] CRAN (R 4.3.1) S4Arrays * 1.2.0 2023-10-26 [1] Bioconductor S4Vectors * 0.40.2 2023-11-25 [1] Bioconductor 3.18 (R 4.3.2) ScaledMatrix 1.10.0 2023-11-06 [1] Bioconductor scales 1.3.0 2023-11-28 [1] CRAN (R 4.3.1) scater 1.30.1 2023-11-16 [1] Bioconductor scattermore 1.2 2023-06-12 [1] CRAN (R 4.3.0) scClustViz * 1.3.12 2023-11-21 [1] Github (BaderLab/scClustViz@6707c89) scDblFinder * 1.16.0 2023-12-23 [1] Bioconductor 3.18 (R 4.3.2) SCINA * 1.2.0 2019-07-18 [1] CRAN (R 4.3.0) scran * 1.30.2 2024-01-23 [1] Bioconductor 3.18 (R 4.3.2) sctransform 0.4.1 2023-10-19 [1] CRAN (R 4.3.1) scuttle * 1.12.0 2023-11-06 [1] Bioconductor sessioninfo 1.2.2 2021-12-06 [1] CRAN (R 4.3.0) Seurat * 5.0.1 2023-11-17 [1] CRAN (R 4.3.1) SeuratObject * 5.0.1 2023-11-17 [1] CRAN (R 4.3.1) shiny * 1.8.0 2023-11-17 [1] CRAN (R 4.3.1) SingleCellExperiment * 1.24.0 2023-11-06 [1] Bioconductor slam 0.1-50 2022-01-08 [1] CRAN (R 4.3.0) SoupX * 1.6.2 2022-11-01 [1] CRAN (R 4.3.0) sp * 2.1-3 2024-01-30 [1] CRAN (R 4.3.1) spam 2.10-0 2023-10-23 [1] CRAN (R 4.3.1) SparseArray * 1.2.4 2024-02-10 [1] Bioconductor 3.18 (R 4.3.2) sparseMatrixStats 1.14.0 2023-10-26 [1] Bioconductor spatstat.data 3.0-4 2024-01-15 [1] CRAN (R 4.3.1) spatstat.explore 3.2-6 2024-02-01 [1] CRAN (R 4.3.1) spatstat.geom 3.2-8 2024-01-26 [1] CRAN (R 4.3.1) spatstat.random 3.2-2 2023-11-29 [1] CRAN (R 4.3.1) spatstat.sparse 3.0-3 2023-10-24 [1] CRAN (R 4.3.1) spatstat.utils 3.0-4 2023-10-24 [1] CRAN (R 4.3.1) statmod 1.5.0 2023-01-06 [1] CRAN (R 4.3.0) stringi 1.8.3 2023-12-11 [1] CRAN (R 4.3.1) stringr * 1.5.1 2023-11-14 [1] CRAN (R 4.3.1) SummarizedExperiment * 1.32.0 2023-11-06 [1] Bioconductor survival 3.5-8 2024-02-14 [1] CRAN (R 4.3.1) tensor 1.5 2012-05-05 [1] CRAN (R 4.3.0) tibble 3.2.1 2023-03-20 [1] CRAN (R 4.3.0) tidyr 1.3.1 2024-01-24 [1] CRAN (R 4.3.1) tidyselect 1.2.0 2022-10-10 [1] CRAN (R 4.3.0) UCell * 2.6.2 2023-12-19 [1] Bioconductor 3.18 (R 4.3.2) urlchecker 1.0.1 2021-11-30 [1] CRAN (R 4.3.0) usethis * 2.2.3 2024-02-19 [1] CRAN (R 4.3.1) utf8 1.2.4 2023-10-22 [1] CRAN (R 4.3.1) uwot 0.1.16 2023-06-29 [1] CRAN (R 4.3.0) vctrs 0.6.5 2023-12-01 [1] CRAN (R 4.3.1) VGAM * 1.1-9 2023-09-19 [1] CRAN (R 4.3.1) vipor 0.4.7 2023-12-18 [1] CRAN (R 4.3.1) viridis * 0.6.5 2024-01-29 [1] CRAN (R 4.3.1) viridisLite * 0.4.2 2023-05-02 [1] CRAN (R 4.3.0) withr 3.0.0 2024-01-16 [1] CRAN (R 4.3.1) xfun 0.42 2024-02-08 [1] CRAN (R 4.3.1) xgboost 1.7.7.1 2024-01-25 [1] CRAN (R 4.3.1) XML * 3.99-0.16.1 2024-01-22 [1] CRAN (R 4.3.1) xml2 1.3.6 2023-12-04 [1] CRAN (R 4.3.1) xtable 1.8-4 2019-04-21 [1] CRAN (R 4.3.0) XVector 0.42.0 2023-10-26 [1] Bioconductor yaml 2.3.8 2023-12-11 [1] CRAN (R 4.3.1) zlibbioc 1.48.0 2023-10-26 [1] Bioconductor zoo 1.8-12 2023-04-13 [1] CRAN (R 4.3.0)

[1] /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library

chungsai avatar Feb 29 '24 16:02 chungsai

Hi @chungsai, what is the goal here? SCTransform is a v3 assay so there are no layers.

saketkc avatar Mar 01 '24 17:03 saketkc