SingleR-inc / SingleR

Clone of the Bioconductor repository for the SingleR package.
https://bioconductor.org/packages/devel/bioc/html/SingleR.html
GNU General Public License v3.0
173 stars 19 forks source link

Create SingleR object from an existing seurat object #144

Closed tonimaried closed 4 years ago

tonimaried commented 4 years ago

Hello,

I converted a h5ad file into a Seurat object. I am now trying to convert that into a singlecellexperiment so I can use singleR. results <- SingleR(test = as.SingleCellExperiment(LymphNodes_result), ref=hpca.se, assay.type.test=1, labels = hpca.se$label.main))

I get the following error: Error in method(object) : all assays must have the same nrow and ncol

Does anyone have any thoughts? One catch is that I can't update R and other packages so I'm trying to work with the packages that I have below.

And potentially of note, when I convert h5ad file , I get the following messages: sys:1: FutureWarning: The 'getvalues' method is deprecated and will be removed in a future version Warning: Feature names cannot have underscores (''), replacing with dashes ('-') Warning message: In SetAssayData.Assay(object = object[[assay]], slot = slot, new.data = new.data) : Adding features not currently present in the object

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

other attached packages: [1] scRNAseq_2.0.2 celldex_0.99.1
[3] usethis_1.5.0 devtools_2.0.2
[5] patchwork_1.0.1.9000 SingleR_1.0.6
[7] DropletUtils_1.6.1 SingleCellExperiment_1.8.0 [9] SummarizedExperiment_1.16.1 DelayedArray_0.12.3
[11] BiocParallel_1.20.1 matrixStats_0.56.0
[13] Biobase_2.46.0 GenomicRanges_1.38.0
[15] GenomeInfoDb_1.22.1 IRanges_2.20.2
[17] S4Vectors_0.24.4 BiocGenerics_0.32.0
[19] stringr_1.4.0 GSA_1.03.1
[21] gplots_3.0.1.1 Matrix_1.2-17
[23] dplyr_0.8.0.1 Seurat_3.0.0.9000
[25] cowplot_0.9.4 ggplot2_3.3.2
[27] reticulate_1.12

loaded via a namespace (and not attached): [1] backports_1.1.8 AnnotationHub_2.18.0
[3] BiocFileCache_1.10.2 plyr_1.8.4
[5] igraph_1.2.4.1 lazyeval_0.2.2
[7] splines_3.6.0 listenv_0.7.0
[9] digest_0.6.25 htmltools_0.3.6
[11] fansi_0.4.1 gdata_2.18.0
[13] magrittr_1.5 memoise_1.1.0
[15] cluster_2.0.8 ROCR_1.0-7
[17] remotes_2.0.4 limma_3.42.2
[19] globals_0.12.4 R.utils_2.8.0
[21] prettyunits_1.1.1 colorspace_1.4-1
[23] blob_1.1.1 rappdirs_0.3.1
[25] ggrepel_0.8.1 callr_3.4.3
[27] crayon_1.3.4 RCurl_1.95-4.12
[29] jsonlite_1.6 survival_2.44-1.1
[31] zoo_1.8-5 ape_5.3
[33] glue_1.4.1 gtable_0.3.0
[35] zlibbioc_1.32.0 XVector_0.26.0
[37] pkgbuild_1.1.0 Rhdf5lib_1.8.0
[39] future.apply_1.2.0 HDF5Array_1.14.4
[41] scales_1.1.1 DBI_1.0.0
[43] edgeR_3.28.1 bibtex_0.4.2
[45] Rcpp_1.0.1 metap_1.1
[47] viridisLite_0.3.0 xtable_1.8-4
[49] dqrng_0.2.0 bit_1.1-14
[51] rsvd_1.0.0 SDMTools_1.1-221.1
[53] tsne_0.1-3 htmlwidgets_1.3
[55] httr_1.4.0 RColorBrewer_1.1-2
[57] ellipsis_0.3.1 ica_1.0-2
[59] farver_2.0.3 pkgconfig_2.0.3
[61] R.methodsS3_1.7.1 dbplyr_1.4.0
[63] locfit_1.5-9.1 labeling_0.3
[65] tidyselect_0.2.5 rlang_0.4.7
[67] later_0.8.0 AnnotationDbi_1.48.0
[69] munsell_0.5.0 BiocVersion_3.10.1
[71] tools_3.6.0 cli_2.0.2
[73] RSQLite_2.1.1 ExperimentHub_1.12.0
[75] ggridges_0.5.1 yaml_2.2.0
[77] npsurv_0.4-0 fs_1.3.1
[79] processx_3.4.3 bit64_0.9-7
[81] fitdistrplus_1.0-14 caTools_1.17.1.2
[83] purrr_0.3.2 RANN_2.6.1
[85] pbapply_1.4-0 future_1.13.0
[87] nlme_3.1-139 mime_0.6
[89] R.oo_1.22.0 compiler_3.6.0
[91] plotly_4.9.0 curl_3.3
[93] png_0.1-7 interactiveDisplayBase_1.24.0 [95] testthat_2.3.2 lsei_1.2-0
[97] tibble_3.0.3 stringi_1.4.3
[99] ps_1.3.4 desc_1.2.0
[101] lattice_0.20-38 vctrs_0.3.2
[103] pillar_1.4.6 lifecycle_0.2.0
[105] BiocManager_1.30.4 Rdpack_0.11-0
[107] lmtest_0.9-37 BiocNeighbors_1.4.2
[109] data.table_1.12.2 bitops_1.0-6
[111] irlba_2.3.3 gbRd_0.4-11
[113] httpuv_1.5.1 R6_2.4.1
[115] promises_1.0.1 KernSmooth_2.23-15
[117] sessioninfo_1.1.1 codetools_0.2-16
[119] pkgload_1.1.0 MASS_7.3-51.4
[121] gtools_3.8.1 assertthat_0.2.1
[123] rhdf5_2.30.1 rprojroot_1.3-2
[125] withr_2.2.0 GenomeInfoDbData_1.2.2
[127] grid_3.6.0 tidyr_0.8.3
[129] DelayedMatrixStats_1.8.0 Rtsne_0.15

denvercal1234GitHub commented 3 years ago

@tonimaried Would you mind informing us how you resolved this issue? Thank you!

dtm2451 commented 3 years ago

For the Bioconductor version of SingleR, there is no "SingleR object" so I suspect the answer may have involved a combination of reading documentation and/or seeing other issues where we pointed users to using either Seurat::as.SingleCellExperiment() or Seurat::GetAssayData() to extract the relevant data for test / ref