carmonalab / ProjecTILs

Interpretation of cell states using reference single-cell maps
GNU General Public License v3.0
252 stars 29 forks source link

Issue Making a Reference - Dimension is zero #54

Closed dkwon6 closed 1 year ago

dkwon6 commented 1 year ago

I'm trying to create a reference from a processed scRNAseq dataset (downloaded online). It appears the dataset is already normalized with the UMAP data present. When I run:

DimPlot(dataset, group.by = "cell_type", label = T, repel = T, label.size = 4) + theme(aspect.ratio = 1) + NoLegend()

It produces the UMAP plot with the labels.

However, when I try to make the reference:

ref <- make.reference(ref = dataset, ndim = ndim, seed = seed, recalculate.umap = TRUE, annotation.column = "cell_type")

It produces:

Error in svd(x, nu = 0, nv = k) : a dimension is zero

Here is the session_info():

R version 4.2.0 (2022-04-22 ucrt) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows 10 x64 (build 22621)

Matrix products: default

locale: [1] LC_COLLATE=English_Canada.utf8 LC_CTYPE=English_Canada.utf8 LC_MONETARY=English_Canada.utf8 LC_NUMERIC=C
[5] LC_TIME=English_Canada.utf8

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

other attached packages: [1] scGate_1.4.1 data.table_1.14.8 ProjecTILs_3.0.3 lubridate_1.9.2
[5] forcats_1.0.0 stringr_1.5.0 purrr_1.0.1 readr_2.1.4
[9] tibble_3.2.1 tidyverse_2.0.0 plyr_1.8.8 scMiko_0.1.0
[13] flexdashboard_0.6.1 tidyr_1.3.0 SeuratObject_4.1.3 Seurat_4.3.0
[17] dplyr_1.1.1 ggplot2_3.4.1 SingleCellExperiment_1.20.1 DESeq2_1.36.0
[21] SummarizedExperiment_1.28.0 Biobase_2.58.0 GenomicRanges_1.50.2 GenomeInfoDb_1.34.9
[25] IRanges_2.32.0 S4Vectors_0.34.0 BiocGenerics_0.44.0 MatrixGenerics_1.8.1
[29] matrixStats_0.62.0

loaded via a namespace (and not attached): [1] utf8_1.2.3 spatstat.explore_3.1-0 reticulate_1.28 tidyselect_1.2.0 RSQLite_2.2.14
[6] AnnotationDbi_1.58.0 htmlwidgets_1.6.2 grid_4.2.0 BiocParallel_1.32.6 Rtsne_0.16
[11] munsell_0.5.0 codetools_0.2-19 ica_1.0-3 umap_0.2.10.0 future_1.32.0
[16] miniUI_0.1.1.1 withr_2.5.0 spatstat.random_3.1-4 colorspace_2.1-0 progressr_0.13.0
[21] knitr_1.42 rstudioapi_0.14 ROCR_1.0-11 tensor_1.5 listenv_0.9.0
[26] labeling_0.4.2 GenomeInfoDbData_1.2.9 polyclip_1.10-4 farver_2.1.1 bit64_4.0.5
[31] pheatmap_1.0.12 parallelly_1.35.0 vctrs_0.6.1 generics_0.1.3 xfun_0.38
[36] timechange_0.2.0 R6_2.5.1 locfit_1.5-9.7 flexmix_2.3-19 bitops_1.0-7
[41] spatstat.utils_3.0-2 cachem_1.0.7 DelayedArray_0.24.0 promises_1.2.0.1 scales_1.2.1
[46] nnet_7.3-17 gtable_0.3.3 globals_0.16.2 goftest_1.2-3 rlang_1.1.0
[51] genefilter_1.78.0 splines_4.2.0 lazyeval_0.2.2 spatstat.geom_3.1-0 yaml_2.3.7
[56] reshape2_1.4.4 abind_1.4-5 httpuv_1.6.9 tools_4.2.0 ellipsis_0.3.2
[61] jquerylib_0.1.4 RColorBrewer_1.1-3 ggridges_0.5.4 Rcpp_1.0.10 zlibbioc_1.44.0
[66] RCurl_1.98-1.12 openssl_2.0.6 deldir_1.0-6 pbapply_1.7-0 cowplot_1.1.1
[71] zoo_1.8-11 ggrepel_0.9.3 cluster_2.1.4 magrittr_2.0.3 RSpectra_0.16-1
[76] scattermore_0.8 lmtest_0.9-40 RANN_2.6.1 fitdistrplus_1.1-8 hms_1.1.3
[81] patchwork_1.1.2 mime_0.12 evaluate_0.20 xtable_1.8-4 XML_3.99-0.9
[86] gridExtra_2.3 UCell_2.2.0 compiler_4.2.0 KernSmooth_2.23-20 crayon_1.5.2
[91] htmltools_0.5.5 later_1.3.0 tzdb_0.3.0 geneplotter_1.74.0 DBI_1.1.3
[96] MASS_7.3-58.2 Matrix_1.5-3 cli_3.6.1 parallel_4.2.0 igraph_1.4.1
[101] pkgconfig_2.0.3 sp_1.6-0 plotly_4.10.1 spatstat.sparse_3.0-1 annotate_1.74.0
[106] bslib_0.4.2 EnhancedVolcano_1.14.0 XVector_0.38.0 digest_0.6.31 sctransform_0.3.5
[111] RcppAnnoy_0.0.20 pracma_2.4.2 spatstat.data_3.0-1 Biostrings_2.64.0 rmarkdown_2.21
[116] leiden_0.4.3 uwot_0.1.14 shiny_1.7.4 modeltools_0.2-23 lifecycle_1.0.3
[121] nlme_3.1-162 jsonlite_1.8.4 BiocNeighbors_1.16.0 viridisLite_0.4.1 askpass_1.1
[126] fansi_1.0.4 pillar_1.9.0 lattice_0.20-45 KEGGREST_1.36.3 fastmap_1.1.1
[131] httr_1.4.5 survival_3.3-1 glue_1.6.2 png_0.1-8 bit_4.0.4
[136] stringi_1.7.12 sass_0.4.5 blob_1.2.4 memoise_2.0.1 irlba_2.3.5.1
[141] future.apply_1.10.0

Thanks

cedmo001 commented 1 year ago

Hello @dkwon6 ,

I am also having this issue. Have you figured out a fix?

Best Wishes, Carina

mass-a commented 1 year ago

Hello,

can you link to the dataset you want to convert into a reference? does it contain (normalized) gene counts?

-m

cedmo001 commented 1 year ago

Hello,

Actually I figured it out by changing the DefaultAssay from "RNA" to "SCT".

Thanks for the help!

Best, Carina