Closed bumpingbell closed 1 year ago
Have you tried restarting R? Not the same error, but also related to BPCells matrix plus Integrate. https://github.com/satijalab/seurat/issues/7329
I also encountered a similar problem (also only occured when I used scvi and NOT rpca), restarting also helped. https://github.com/satijalab/seurat/issues/7373
Also Gesmira said that this error should be fixed in the seuratv5 branch, so maybe try updating:
remotes::install_github("satijalab/seurat", "seurat5", quiet = TRUE)
Hi @bumpingbell, Thank you for pointing out this bug! This has been fixed in the newest version of Seurat v5! Please clear and restart your R session and install using:
remotes::install_github("mojaveazure/seurat-object", "seurat5", quiet = TRUE)
remotes::install_github("satijalab/seurat", "seurat5", quiet = TRUE)
Hi Team,
I still met the same issue about CCA when running an intermediate step of "Celltrek" with some data storing with BPCells
. The problem seems to occur in Seurat::FindTransferAnchors
. My codes:
# link to count matrix
counts.mat <- BPCells::open_matrix_dir(dir = "/virtual_path_to_BPCell_storage")
adata_ref[["RNA"]]$counts <- counts.mat
DefaultAssay(adata_ref) <- "RNA"
adata_ref_conv = adata_ref
adata_ref_conv$orig.ident <- adata_ref_conv$v2.subclass.l1
adata_ref_conv[["ATAC"]] <- NULL
adata_ref_conv = NormalizeData(adata_ref_conv)
adata_vis = readRDS("/virtual_path_to_spatial_data")
traint <- my_traint(st_data=adata_vis, sc_data=adata_ref_conv, sc_assay='RNA', cell_names='v2.subclass.l1') #error occurs here
The error:
Error: Not compatible with requested type: [type=S4; target=double].
Traceback:
8: stop(structure(list(message = "Not compatible with requested type: [type=S4; target=double].",
call = NULL, cppstack = NULL), class = c("Rcpp::not_compatible",
"C++Error", "error", "condition")))
7: Standardize(mat = object1, display_progress = FALSE)
6: RunCCA.default(object1 = data1, object2 = data2, standardize = TRUE,
num.cc = num.cc, verbose = verbose, )
5: RunCCA(object1 = data1, object2 = data2, standardize = TRUE,
num.cc = num.cc, verbose = verbose, )
4: RunCCA.Seurat(object1 = reference, object2 = query, features = features,
num.cc = max(dims), renormalize = FALSE, rescale = FALSE,
verbose = verbose)
3: RunCCA(object1 = reference, object2 = query, features = features,
num.cc = max(dims), renormalize = FALSE, rescale = FALSE,
verbose = verbose)
2: Seurat::FindTransferAnchors(reference = sc_data, query = st_data,
reference.assay = sc_assay, query.assay = st_assay, normalization.method = norm,
features = sc_st_features, reduction = "cca", ...) at celltrek_functions.R#30
1: my_traint(st_data = adata_vis, sc_data = adata_ref_conv, sc_assay = "RNA",
cell_names = "v2.subclass.l1")
I believe I'm using the a newer version of Seurat which should have fixed this problem. My session info:
R version 4.3.1 (2023-06-16)
Platform: x86_64-conda-linux-gnu (64-bit)
Running under: Red Hat Enterprise Linux 9.4 (Plow)
Matrix products: default
BLAS/LAPACK: /data/home/zz5708/miniconda3/envs/R/lib/libopenblasp-r0.3.21.so; LAPACK version 3.9.0
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C LC_TIME=en_US.UTF-8
[4] LC_COLLATE=en_US.UTF-8 LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=en_US.UTF-8 LC_NAME=C LC_ADDRESS=C
[10] LC_TELEPHONE=C LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
time zone: America/New_York
tzcode source: system (glibc)
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] BPCells_0.2.0 magrittr_2.0.3 RANN_2.6.1
[4] SeuratDisk_0.0.0.9021 reticulate_1.38.0 ConsensusClusterPlus_1.66.0
[7] viridis_0.6.5 viridisLite_0.4.2 Seurat_5.1.0
[10] SeuratObject_5.0.99.9001 sp_2.1-4 dplyr_1.1.4
[13] CellTrek_0.0.94
loaded via a namespace (and not attached):
[1] RColorBrewer_1.1-3 rstudioapi_0.16.0 jsonlite_1.8.8
[4] spatstat.utils_3.0-5 zlibbioc_1.48.2 vctrs_0.6.5
[7] ROCR_1.0-11 spatstat.explore_3.3-1 RCurl_1.98-1.14
[10] rstatix_0.7.2 htmltools_0.5.8.1 dynamicTreeCut_1.63-1
[13] broom_1.0.6 sctransform_0.4.1 parallelly_1.37.1
[16] KernSmooth_2.23-24 htmlwidgets_1.6.4 ica_1.0-3
[19] plyr_1.8.9 plotly_4.10.4 zoo_1.8-12
[22] igraph_2.0.3 mime_0.12 lifecycle_1.0.4
[25] pkgconfig_2.0.3 Matrix_1.6-4 R6_2.5.1
[28] fastmap_1.2.0 magic_1.6-1 GenomeInfoDbData_1.2.11
[31] MatrixGenerics_1.14.0 fitdistrplus_1.2-1 future_1.33.2
[34] shiny_1.8.1.1 digest_0.6.36 colorspace_2.1-0
[37] patchwork_1.2.0 S4Vectors_0.40.2 tensor_1.5
[40] RSpectra_0.16-1 irlba_2.3.5.1 GenomicRanges_1.54.1
[43] akima_0.6-3.4 ggpubr_0.6.0 philentropy_0.8.0
[46] progressr_0.14.0 fansi_1.0.5 spatstat.sparse_3.1-0
[49] httr_1.4.7 polyclip_1.10-6 abind_1.4-5
[52] compiler_4.3.1 withr_3.0.0 bit64_4.0.5
[55] backports_1.5.0 carData_3.0-5 fastDummies_1.7.3
[58] ggsignif_0.6.4 MASS_7.3-58 tools_4.3.1
[61] lmtest_0.9-40 httpuv_1.6.15 future.apply_1.11.2
[64] goftest_1.2-3 glue_1.7.0 dbscan_1.2-0
[67] DiagrammeR_1.0.11 nlme_3.1-163 promises_1.3.0
[70] grid_4.3.1 Rtsne_0.17 cluster_2.1.6
[73] reshape2_1.4.4 generics_0.1.3 hdf5r_1.3.11
[76] gtable_0.3.5 spatstat.data_3.1-2 tidyr_1.3.1
[79] data.table_1.15.4 car_3.1-2 utf8_1.2.4
[82] XVector_0.42.0 BiocGenerics_0.48.1 spatstat.geom_3.3-2
[85] RcppAnnoy_0.0.22 ggrepel_0.9.5 pillar_1.9.0
[88] stringr_1.5.1 spam_2.10-0 RcppHNSW_0.6.0
[91] later_1.3.2 splines_4.3.1 lattice_0.22-5
[94] bit_4.0.5 survival_3.7-0 deldir_1.0-9
[97] tidyselect_1.2.1 miniUI_0.1.1.1 pbapply_1.7-2
[100] gridExtra_2.3 IRanges_2.36.0 scattermore_1.2
[103] stats4_4.3.1 Biobase_2.62.0 matrixStats_1.3.0
[106] visNetwork_2.1.2 stringi_1.8.4 lazyeval_0.2.2
[109] codetools_0.2-20 data.tree_1.1.0 tibble_3.2.1
[112] packcircles_0.3.6 cli_3.6.3 uwot_0.2.2
[115] geometry_0.4.7 xtable_1.8-4 randomForestSRC_3.3.1
[118] munsell_0.5.1 Rcpp_1.0.12 GenomeInfoDb_1.38.8
[121] globals_0.16.3 spatstat.random_3.3-1 png_0.1-8
[124] fastcluster_1.2.6 spatstat.univar_3.0-0 parallel_4.3.1
[127] ggplot2_3.5.1 dotCall64_1.1-1 bitops_1.0-7
[130] listenv_0.9.1 scales_1.3.0 ggridges_0.5.6
[133] crayon_1.5.3 leiden_0.4.3.1 purrr_1.0.2
[136] rlang_1.1.4 cowplot_1.1.3
Could you please take a look to see what the problem might be? Thanks!
Also, the code remotes::install_github("mojaveazure/seurat-object", "seurat5", quiet = TRUE)
seems not to be correct.
> remotes::install_github("mojaveazure/seurat-object", "seurat5", quiet = TRUE)
Error: Failed to install 'unknown package' from GitHub:
HTTP error 404.
No commit found for the ref seurat5
Did you spell the repo owner and repo name correctly?
- If spelling is correct, check that you have the required permissions to access the repo.
I've been following by the "Integrative analysis in Seurat v5" vignette for dataset integration, but I store my matrix on-disk by BPCells since my dataset is a large one. When I run RPCA integration through
IntegrateLayers
:I got this error:
Error in h(simpleError(msg, call)) : error in evaluating the argument 'x' in selecting a method for function 'as.matrix': requires numeric/complex matrix/vector arguments
It seems like this error occurs in the FindIntegrationAnchors step, where a function tries to run a crossprod but one of the inputs is not a numeric/complex matrix/vector. I traced the function, and I believe the faulty line of code lies in Seurat:::ProjectSVD,
projected.u <- as.matrix(x = crossprod(x = vt, y = data))
. Thedata
object is an S4 object of type "RenameDims".Here is the traceback:
Following up, I tried with CCAIntegration, and the error is:
My sessionInfo: