CreateSeuratObject problem
0
0
Entering edit mode
2.1 years ago
sandy • 0

Hello everyone,

Please help me solve this problem.

My code is: p9<-CreateSeuratObject(counts = p9, min.features = 200, min.cells = 3, project='panc_health').

The R said the error is:

Error in UseMethod(generic = "as.sparse", object = x) : 
  no applicable method for 'as.sparse' applied to an object of class "Seurat". 

I do not understand the problem. Please help.

My read files are: matrix, barcode, and features.gz files.

R seq seurat scrna • 3.2k views
ADD COMMENT
1
Entering edit mode

Please, do not shotgun multiple posts on the same problem:

CreateSeuratObject problem

CreatSeuratObject command issue

input scrna seq data file into R on linux Conda environment

CreatSeuratObject command issue

Lets solve it in this post here. It creates unnecessary effort if you do that sort of posting.

Please provide all code that let to the problem. It seems that p9 is already a Seurat object.

ADD REPLY
0
Entering edit mode

Ok, I will do that. Thanks

ADD REPLY
0
Entering edit mode
Session info: locale: [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=en_US.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

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

other attached packages: [1] ggthemes_4.2.4 RColorBrewer_1.1-3 patchwork_1.1.2 ggplot2_3.3.6
[5] Matrix_1.5-1 cowplot_1.1.1 sp_1.5-0 SeuratObject_4.1.2 [9] Seurat_4.2.0 dplyr_1.0.10 readr_2.1.3

loaded via a namespace (and not attached): [1] Rtsne_0.16 colorspace_2.0-3 deldir_1.0-6
[4] ellipsis_0.3.2 ggridges_0.5.4 spatstat.data_3.0-0
[7] leiden_0.4.3 listenv_0.8.0 ggrepel_0.9.1
[10] bit64_4.0.5 fansi_1.0.3 codetools_0.2-18
[13] splines_4.0.5 polyclip_1.10-4 jsonlite_1.8.3
[16] ica_1.0-3 cluster_2.1.3 png_0.1-7
[19] rgeos_0.5-9 uwot_0.1.14 shiny_1.7.3
[22] sctransform_0.3.5 spatstat.sparse_3.0-0 compiler_4.0.5
[25] httr_1.4.4 fastmap_1.1.0 lazyeval_0.2.2
[28] cli_3.4.1 later_1.3.0 htmltools_0.5.3
[31] tools_4.0.5 igraph_1.3.5 gtable_0.3.1
[34] glue_1.6.2 RANN_2.6.1 reshape2_1.4.4
[37] Rcpp_1.0.9 scattermore_0.8 vctrs_0.5.0
[40] nlme_3.1-159 progressr_0.11.0 lmtest_0.9-40
[43] spatstat.random_2.2-0 stringr_1.4.1 globals_0.16.1
[46] mime_0.12 miniUI_0.1.1.1 lifecycle_1.0.3
[49] irlba_2.3.5.1 goftest_1.2-3 future_1.28.0
[52] MASS_7.3-58.1 zoo_1.8-11 scales_1.2.1
[55] spatstat.core_2.4-4 vroom_1.6.0 hms_1.1.2
[58] promises_1.2.0.1 spatstat.utils_3.0-1 parallel_4.0.5
[61] reticulate_1.26 pbapply_1.5-0 gridExtra_2.3
[64] rpart_4.1.16 stringi_1.7.8 rlang_1.0.6
[67] pkgconfig_2.0.3 matrixStats_0.62.0 lattice_0.20-45
[70] ROCR_1.0-11 purrr_0.3.5 tensor_1.5
[73] htmlwidgets_1.5.4 bit_4.0.4 tidyselect_1.2.0
[76] parallelly_1.32.1 RcppAnnoy_0.0.20 plyr_1.8.7
[79] magrittr_2.0.3 R6_2.5.1 generics_0.1.3
[82] pillar_1.8.1 withr_2.5.0 mgcv_1.8-40
[85] fitdistrplus_1.1-8 survival_3.4-0 abind_1.4-5
[88] tibble_3.1.8 future.apply_1.9.1 crayon_1.5.2
[91] KernSmooth_2.23-20 utf8_1.2.2 spatstat.geom_3.0-3
[94] plotly_4.10.0 tzdb_0.3.0 grid_4.0.5
[97] data.table_1.14.4 digest_0.6.30 xtable_1.8-4
[100] tidyr_1.2.1 httpuv_1.6.6 munsell_0.5.0
[103] viridisLite_0.4.1
ADD REPLY
0
Entering edit mode

Can you include the code you used to create the p9 variable?

ADD REPLY
0
Entering edit mode

as.sparse is a function that is used to convert between data frames into sparse matrices. The error is saying that p9 variable cannot be changed into a sparse matrix. It looks like the count data is also called p9. Would you be able to change the variable names so that the count data has a different name to the the first p9? This might help.

ADD REPLY

Login before adding your answer.

Traffic: 2847 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6