Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Errors #3

Open
JLiLab opened this issue Jan 30, 2023 · 3 comments
Open

Errors #3

JLiLab opened this issue Jan 30, 2023 · 3 comments

Comments

@JLiLab
Copy link

JLiLab commented Jan 30, 2023

Hi,

Thank you for sharing the wonderful method. Recently, I ran into issues with my new Apple silicon computer when I use cosg with a Seurat object. I could not figure out what was the problem. I will appreciate it if you can help.

marker_cosg <- COSG::cosg(seu, groups='all', assay='RNA', slot='data', mu=1, n_genes_user=2) \

Error in tabulate(genexcell[, idx_i]@i + 1) :
trying to get slot "i" from an object of a basic class ("matrix") with no slots

Here is my sessionInfo:

R version 4.2.2 (2022-10-31)
Platform: aarch64-apple-darwin20 (64-bit)
Running under: macOS Ventura 13.1

Matrix products: default
LAPACK: /Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

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

other attached packages:
[1] forcats_0.5.2 stringr_1.5.0 dplyr_1.0.10 purrr_1.0.1 readr_2.1.3
[6] tidyr_1.2.1 tibble_3.1.8 ggplot2_3.4.0 tidyverse_1.3.2 SeuratObject_4.1.3
[11] Seurat_4.3.0

loaded via a namespace (and not attached):
[1] googledrive_2.0.0 Rtsne_0.16 colorspace_2.0-3 deldir_1.0-6
[5] ellipsis_0.3.2 ggridges_0.5.4 fs_1.5.2 rstudioapi_0.14
[9] spatstat.data_3.0-0 leiden_0.4.3 listenv_0.9.0 ggrepel_0.9.2
[13] lubridate_1.9.0 fansi_1.0.3 xml2_1.3.3 codetools_0.2-18
[17] splines_4.2.2 polyclip_1.10-4 jsonlite_1.8.4 COSG_0.9.0
[21] broom_1.0.2 ica_1.0-3 cluster_2.1.4 dbplyr_2.3.0
[25] png_0.1-8 uwot_0.1.14 shiny_1.7.4 sctransform_0.3.5
[29] spatstat.sparse_3.0-0 compiler_4.2.2 httr_1.4.4 backports_1.4.1
[33] assertthat_0.2.1 Matrix_1.5-3 fastmap_1.1.0 lazyeval_0.2.2
[37] gargle_1.2.1 cli_3.6.0 later_1.3.0 htmltools_0.5.4
[41] tools_4.2.2 igraph_1.3.5 gtable_0.3.1 glue_1.6.2
[45] RANN_2.6.1 reshape2_1.4.4 Rcpp_1.0.9 scattermore_0.8
[49] cellranger_1.1.0 vctrs_0.5.1 spatstat.explore_3.0-5 nlme_3.1-160
[53] progressr_0.13.0 lmtest_0.9-40 spatstat.random_3.0-1 globals_0.16.2
[57] rvest_1.0.3 timechange_0.2.0 mime_0.12 miniUI_0.1.1.1
[61] lifecycle_1.0.3 irlba_2.3.5.1 googlesheets4_1.0.1 goftest_1.2-3
[65] future_1.30.0 MASS_7.3-58.1 zoo_1.8-11 scales_1.2.1
[69] hms_1.1.2 promises_1.2.0.1 spatstat.utils_3.0-1 parallel_4.2.2
[73] RColorBrewer_1.1-3 reticulate_1.27 pbapply_1.7-0 gridExtra_2.3
[77] stringi_1.7.12 rlang_1.0.6 pkgconfig_2.0.3 matrixStats_0.63.0
[81] lattice_0.20-45 ROCR_1.0-11 tensor_1.5 patchwork_1.1.2
[85] htmlwidgets_1.6.1 cowplot_1.1.1 tidyselect_1.2.0 parallelly_1.34.0
[89] RcppAnnoy_0.0.20 plyr_1.8.8 magrittr_2.0.3 R6_2.5.1
[93] generics_0.1.3 DBI_1.1.3 withr_2.5.0 haven_2.5.1
[97] pillar_1.8.1 proxyC_0.3.3 fitdistrplus_1.1-8 survival_3.4-0
[101] abind_1.4-5 sp_1.5-1 future.apply_1.10.0 crayon_1.5.2
[105] modelr_0.1.10 KernSmooth_2.23-20 utf8_1.2.2 spatstat.geom_3.0-3
[109] plotly_4.10.1 tzdb_0.3.0 readxl_1.4.1 grid_4.2.2
[113] data.table_1.14.6 reprex_2.0.2 digest_0.6.31 xtable_1.8-4
[117] httpuv_1.6.8 RcppParallel_5.1.6 munsell_0.5.0 viridisLite_0.4.1

@genecell
Copy link
Owner

Hi,

Thank you for your interest! Sorry, I just saw your message, could you please try this example data (https://drive.google.com/file/d/1z-aqz08fCUJ9WmJBIPX0RIkLyEFXvirO/view?usp=share_link) and check whether the error still exists? You could also try seo@assays$RNA@data[1:4,1:4] to check the matrix is correct or not.
Thank you!

Best regards,
Min

@ventson
Copy link

ventson commented May 6, 2024

Dear Min,

Great work! Really fast!
I met the sample problem when dealing with a seurat object. I think the error is caused by the extremely low number of cells in a specific celltype. When I removed the celltype that had only 1 cell, it worked! Besides, I think calculate markers for a celltype with small population (less than 10 cells or more) may be not reliable, so I filtered these celltypes before running cosg.


Idents(sample) <- as.character(sample$celltype)
groups_selected <- names(table(sample$celltype)[table(sample$celltype) >= 10])
marker_cosg <- cosg(sample, groups = groups_selected, assay = 'RNA', slot = 'data', mu = 10, remove_lowly_expressed = T, expressed_pct = 0.1)

Yours,
Cong

@genecell
Copy link
Owner

Dear Min,

Great work! Really fast! I met the sample problem when dealing with a seurat object. I think the error is caused by the extremely low number of cells in a specific celltype. When I removed the celltype that had only 1 cell, it worked! Besides, I think calculate markers for a celltype with small population (less than 10 cells or more) may be not reliable, so I filtered these celltypes before running cosg.

Idents(sample) <- as.character(sample$celltype)

groups_selected <- names(table(sample$celltype)[table(sample$celltype) >= 10])
marker_cosg <- cosg(sample, groups = groups_selected, assay = 'RNA', slot = 'data', mu = 10, remove_lowly_expressed = T, expressed_pct = 0.1)
Yours, Cong

Dear Cong,

Thank you for your kind words and providing the solution!
I agree with you that we need to be cautious when identifying marker genes for clusters with limited number of cells.

Best,
Min

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants