Repository: satijalab/seurat

Issue #2622: PrepSCTIntegration error: "RNA is not an assay present in the given object"
Created: 2020-02-14T18:59:44Z
ABC_list <- list(MHV01_A1, MHV02_B1, MHV03_C1)
list_features <- SelectIntegrationFeatures(object.list = ABC_list, nfeatures = 3000)
ABC_list <- PrepSCTIntegration(object.list = ABC_list, anchor.features = list_features, assay = "SCT", verbose = FALSE)
Error in GetAssay.Seurat(object = object, assay = assay) :
RNA is not an assay present in the given object. Available assays are: Spatial, SCT
I am getting the above error every time I try to merge Seurat objects, whether it's with the "merge" function or with PrepSCTIntegration. The strange thing is that I was able to do this a couple days ago without any issues. Adding "assay = "SCT" doesn't fix the error. Any help would be appreciated!

Duplicate issue #2579: Unable to merge more than 2 spatial objects: Error in GetAssay.Seurat
Created: 2020-02-05T20:33:01Z
Merging two spatial objects works fine:

A1 <- Load10X_Spatial(data.dir = "./Data/A1/")
A1 <- SCTransform(A1, assay = "Spatial", verbose = FALSE)
B1 <- Load10X_Spatial(data.dir = "./Data/B1/")
B1 <- SCTransform(B1, assay = "Spatial", verbose = FALSE)
merge1 <- merge(A1, B1)
Warning message:
In CheckDuplicateCellNames(object.list = objects) :
Some cell names are duplicated across objects provided. Renaming to enforce unique cell names.
merge1
An object of class Seurat
48734 features across 3910 samples within 2 assays
Active assay: SCT (17681 features)
1 other assay present: Spatial

But merging a third object in causes an error:

C1 <- Load10X_Spatial(data.dir = "./Data/C1/")
C1 <- SCTransform(C1, assay = "Spatial", verbose = FALSE)
merge2 <- merge(merge1, C1)
Error in GetAssay.Seurat(object = object, assay = assay) :
RNA is not an assay present in the given object. Available assays are: Spatial, SCT

However, I can merge A1 and C1, or B1 and C1, with no problems:

merge1b <- merge(A1 , C1)
Warning message:
In CheckDuplicateCellNames(object.list = objects) :
Some cell names are duplicated across objects provided. Renaming to enforce unique cell names.
merge1b
An object of class Seurat
48929 features across 4213 samples within 2 assays
Active assay: SCT (17876 features)
1 other assay present: Spatial


merge3 <- merge(merge1b, B1 )
Error in GetAssay.Seurat(object = object, assay = assay) :
RNA is not an assay present in the given object. Available assays are: Spatial, SC

What's really weird is that I can do these kinds of mutli-merges on the spatial data from SeuratData without issue:

brain <- LoadData("stxBrain", type = "anterior1")
brain <- SCTransform(brain, assay = "Spatial", verbose = FALSE)
There were 50 or more warnings (use warnings() to see the first 50)
brain2 <- LoadData("stxBrain", type = "posterior1")
brain2 <- SCTransform(brain2, assay = "Spatial", verbose = FALSE)
There were 50 or more warnings (use warnings() to see the first 50)
brain3 <- LoadData("stxBrain", type = "anterior2")
brain3 <- SCTransform(brain3, assay = "Spatial", verbose = FALSE)
There were 50 or more warnings (use warnings() to see the first 50)
brain4 <- LoadData("stxBrain", type = "posterior1")
brain4 <- SCTransform(brain4, assay = "Spatial", verbose = FALSE)
There were 50 or more warnings (use warnings() to see the first 50)


brain.merge1 <- merge(brain, brain2)
Warning message:
In CheckDuplicateCellNames(object.list = objects) :
Some cell names are duplicated across objects provided. Renaming to enforce unique cell names.
brain.merge1
An object of class Seurat
49293 features across 6049 samples within 2 assays
Active assay: SCT (18240 features)
1 other assay present: Spatial


brain.merge2 <- merge(brain.merge1, brain3)
brain.merge2
An object of class Seurat
49447 features across 8874 samples within 2 assays
Active assay: SCT (18394 features)
1 other assay present: Spatial


brain.merge3 <- merge(brain.merge2, brain4)
Warning message:
In CheckDuplicateCellNames(object.list = objects) :
Some cell names are duplicated across objects provided. Renaming to enforce unique cell names.
brain.merge3
An object of class Seurat
49447 features across 12227 samples within 2 assays
Active assay: SCT (18394 features)
1 other assay present: Spatial


sessionInfo()
R version 3.6.2 (2019-12-12)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 16299)

Matrix products: default
locale:
[1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252    LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C                           LC_TIME=English_United States.1252
attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base
other attached packages:
[1] dplyr_0.8.4               cowplot_1.0.0             ggplot2_3.2.1             stxBrain.SeuratData_0.1.1
[5] SeuratData_0.2.1          Seurat_3.1.2.9010
loaded via a namespace (and not attached):
[1] backports_1.1.5       sn_1.5-5              plyr_1.8.5            igraph_1.2.4.2        lazyeval_0.2.2
[6] splines_3.6.2         listenv_0.8.0         usethis_1.5.1         TH.data_1.0-10        digest_0.6.23
[11] htmltools_0.4.0       gdata_2.18.0          fansi_0.4.1           magrittr_1.5          memoise_1.1.0
[16] tensor_1.5            cluster_2.1.0         ROCR_1.0-7            remotes_2.1.0         globals_0.12.5
[21] RcppParallel_4.4.4    R.utils_2.9.2         sandwich_2.5-1        prettyunits_1.0.2     colorspace_1.4-1
[26] rappdirs_0.3.1        ggrepel_0.8.1         callr_3.4.0           crayon_1.3.4          jsonlite_1.6.1
[31] spatstat_1.63-0       spatstat.data_1.4-3   survival_3.1-8        zoo_1.8-7             ape_5.3
[36] glue_1.3.1            polyclip_1.10-0       gtable_0.3.0          leiden_0.3.3          pkgbuild_1.0.6
[41] future.apply_1.4.0    BiocGenerics_0.30.0   abind_1.4-5           scales_1.1.0          mvtnorm_1.0-12
[46] bibtex_0.4.2.2        miniUI_0.1.1.1        Rcpp_1.0.3            metap_1.3             plotrix_3.7-7
[51] viridisLite_0.3.0     xtable_1.8-4          reticulate_1.14       bit_1.1-15.1          rsvd_1.0.2
[56] SDMTools_1.1-221.2    tsne_0.1-3            stats4_3.6.2          htmlwidgets_1.5.1     httr_1.4.1
[61] gplots_3.0.1.2        RColorBrewer_1.1-2    TFisher_0.2.0         ellipsis_0.3.0        ica_1.0-2
[66] pkgconfig_2.0.3       R.methodsS3_1.7.1     uwot_0.1.5            deldir_0.1-25         tidyselect_1.0.0
[71] rlang_0.4.4           reshape2_1.4.3        later_1.0.0           munsell_0.5.0         tools_3.6.2
[76] cli_2.0.1             devtools_2.2.1        ggridges_0.5.2        stringr_1.4.0         fastmap_1.0.1
[81] goftest_1.2-2         npsurv_0.4-0          bit64_0.9-7           processx_3.4.1        fs_1.3.1
[86] fitdistrplus_1.0-14   caTools_1.18.0        purrr_0.3.3           RANN_2.6.1            pbapply_1.4-2
[91] future_1.16.0         nlme_3.1-143          mime_0.8              R.oo_1.23.0           hdf5r_1.3.1
[96] compiler_3.6.2        rstudioapi_0.10       plotly_4.9.1          curl_4.3              png_0.1-7
[101] testthat_2.3.1        lsei_1.2-0            spatstat.utils_1.15-0 tibble_2.1.3          stringi_1.4.5
[106] ps_1.3.0              desc_1.2.0            lattice_0.20-38       Matrix_1.2-18         multtest_2.40.0
[111] vctrs_0.2.2           mutoss_0.1-12         pillar_1.4.3          lifecycle_0.1.0       Rdpack_0.11-1
[116] lmtest_0.9-37         RcppAnnoy_0.0.14      data.table_1.12.8     bitops_1.0-6          irlba_2.3.3
[121] gbRd_0.4-11           httpuv_1.5.2          R6_2.4.1              promises_1.1.0        KernSmooth_2.23-16
[126] gridExtra_2.3         sessioninfo_1.1.1     codetools_0.2-16      MASS_7.3-51.5         gtools_3.8.1
[131] assertthat_0.2.1      pkgload_1.0.2         rprojroot_1.3-2       withr_2.1.2           sctransform_0.2.1
[136] mnormt_1.5-6          multcomp_1.4-12       mgcv_1.8-31           parallel_3.6.2        rpart_4.1-15
[141] grid_3.6.2            tidyr_1.0.2           Rtsne_0.15            numDeriv_2016.8-1.1   Biobase_2.44.0
[146] shiny_1.4.0

Closing comment (2020-02-14T23:33:34Z): Hi @andrewwbutler
I've uploaded a list of 4 objects (each subsetted to the same 100 features) here.

load("TestObjects.Robj")
merge1 <- merge(Objects$testA1, Objects$testB1)
Warning message:
In CheckDuplicateCellNames(object.list = objects) :
Some cell names are duplicated across objects provided. Renaming to enforce unique cell names.
merge2 <- merge(merge1, Objects$testC1)
Error in GetAssay.Seurat(object = object, assay = assay) :
RNA is not an assay present in the given object. Available assays are: Spatial, SCT

Also, I think this may be related to #2622