Skip to content

split.by error in Clustered_DotPlot function #172

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

Open
apal6 opened this issue Mar 29, 2024 · 10 comments
Open

split.by error in Clustered_DotPlot function #172

apal6 opened this issue Mar 29, 2024 · 10 comments
Assignees
Labels
more-info-needed Further information is requested Return Later New/Updated Feature? Potentially return to this issue at later date.

Comments

@apal6
Copy link

apal6 commented Mar 29, 2024

Hi,

Thank you for the package. I was able to use the function Clustered_DotPlot without using split.by parameter. I want to look at the expression at different timepoints and time2 column is there in my metadata but i get an error when I try to use split.by.

`Clustered_DotPlot(seurat_object = _Seurat, split.by = "time2", features = c("gene1"),

  •               colors_use_exp = PurpleAndYellow())
    

Error in [.data.frame(percent_mat, , idx) : undefined columns selected`

Could you help?

Thank you!

@samuel-marsh
Copy link
Owner

Hi,

Are you only providing one gene to the function to plot? Could you paste the output of traceback() after the error occurs?

Thanks,
Sam

@samuel-marsh samuel-marsh self-assigned this Mar 29, 2024
@samuel-marsh samuel-marsh added Return Later New/Updated Feature? Potentially return to this issue at later date. more-info-needed Further information is requested labels Mar 29, 2024
@samuel-marsh
Copy link
Owner

Hi @apal6,

Just wanted to followup on my previous message to try and figure out the issue.

Best,
Sam

@apal6
Copy link
Author

apal6 commented Apr 3, 2024

Hi @samuel-marsh,

Thank you for following up.
No, I using multiple genes. Here is the output of traceback()

5: stop("undefined columns selected") 4: [.data.frame(percent_mat, , idx) 3: percent_mat[, idx] 2: Clustered_DotPlot_Multi_Group(seurat_object = seurat_object, features = features, split.by = split.by, colors_use_exp = colors_use_exp, exp_color_min = exp_color_min, exp_color_middle = exp_color_middle, exp_color_max = exp_color_max, exp_value_type = exp_value_type, print_exp_quantiles = print_exp_quantiles, x_lab_rotate = x_lab_rotate, plot_padding = plot_padding, flip = flip, k = k, feature_km_repeats = feature_km_repeats, ident_km_repeats = ident_km_repeats, row_label_size = row_label_size, row_label_fontface = row_label_fontface, grid_color = grid_color, cluster_feature = cluster_feature, cluster_ident = cluster_ident, column_label_size = column_label_size, legend_label_size = legend_label_size, legend_title_size = legend_title_size, raster = raster, plot_km_elbow = plot_km_elbow, elbow_kmax = elbow_kmax, assay = assay, group.by = group.by, idents = idents, show_parent_dend_line = show_parent_dend_line, seed = seed) 1: Clustered_DotPlot(seurat_object = Seurat, split.by = "time2", features = c("IL4R", "IL9R", "IL21R", "IL7R"), colors_use_exp = PurpleAndYellow())

table([email protected]$time2)
3mo 6mo GMP Wk1 Wk2 Wk3 Wk4 Wk6 Wk8
368 7 118749 21085 17612 19872 5562 1 1535

Code:
Clustered_DotPlot(Seurat,split.by = "time2",features = c("IL4R","IL9R","IL21R","IL7R"),colors_use_exp = PurpleAndYellow())

Thank you!

@samuel-marsh
Copy link
Owner

Hi @apal6,

Sorry for delay getting back to you. Before we continue trying to troubleshoot back and forth I wanted to check if it is possible to share the object so I can try and troubleshoot directly? If so please send me an email: [email protected] and I will send you google drive link to upload the object.

If not let me know here and there are couple of things we can try back and forth here.

Best,
Sam

@apal6
Copy link
Author

apal6 commented Apr 19, 2024

Hi @samuel-marsh ,

I think I got it working. Thank you for your time.

@zhang-HZAU
Copy link

hi~I also encountered the same error when using the same code. How did you debug it?

@ishwarvh
Copy link

Hello @samuel-marsh ,

Unfortunately, I have come across this same issue in scCustomize_3.0.1.

Clustered_DotPlot( s_obj, features = c( "Pclaf","Nr2f1","Cdk1", "Tbx1","Oc90","Kcnq3", "Ptprt", "Gfra1" ,"E130114P18Rik", "Clu", "Rorb", "Thrb", "Tgfb2", "Adamtsl1", "Thsd7a", "Sema3e", "Fut9", "Nkain2" ), split.by = "orig.ident" )

results in

Error in `[.data.frame`(percent_mat, , idx) : undefined columns selected

Happy to share my seurat object if you can send me a upload link.

Here is my sessionInfo:

sessionInfo R version 4.4.1 (2024-06-14) Platform: x86_64-pc-linux-gnu Running under: Ubuntu 22.04.5 LTS

Matrix products: default
BLAS: /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.10.0
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.10.0

locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 LC_MONETARY=en_US.UTF-8
[6] LC_MESSAGES=en_US.UTF-8 LC_PAPER=en_US.UTF-8 LC_NAME=C LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

time zone: America/Los_Angeles
tzcode source: system (glibc)

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

other attached packages:
[1] SingleCellExperiment_1.26.0 SummarizedExperiment_1.34.0 Biobase_2.64.0 GenomicRanges_1.56.2 GenomeInfoDb_1.40.1
[6] IRanges_2.38.1 S4Vectors_0.42.1 BiocGenerics_0.50.0 MatrixGenerics_1.16.0 matrixStats_1.4.1
[11] EnhancedVolcano_1.22.0 ggrepel_0.9.6 SeuratWrappers_0.4.0 stringr_1.5.1 ggtree_3.12.0
[16] presto_1.0.0 data.table_1.16.4 Rcpp_1.0.13-1 scCustomize_3.0.1 ggplot2_3.5.1
[21] dplyr_1.1.4 Seurat_5.1.0 SeuratObject_5.0.2 sp_2.1-4

loaded via a namespace (and not attached):
[1] RcppAnnoy_0.0.22 splines_4.4.1 later_1.4.1 prismatic_1.1.2 ggplotify_0.1.2 tibble_3.2.1
[7] R.oo_1.27.0 polyclip_1.10-7 janitor_2.2.1 fastDummies_1.7.4 lifecycle_1.0.4 doParallel_1.0.17
[13] globals_0.16.3 lattice_0.22-6 MASS_7.3-64 magrittr_2.0.3 plotly_4.10.4 yaml_2.3.10
[19] remotes_2.5.0 httpuv_1.6.15 sctransform_0.4.1 spam_2.11-0 spatstat.sparse_3.1-0 reticulate_1.40.0
[25] cowplot_1.1.3 pbapply_1.7-2 RColorBrewer_1.1-3 lubridate_1.9.4 abind_1.4-8 zlibbioc_1.50.0
[31] Rtsne_0.17 purrr_1.0.2 R.utils_2.12.3 yulab.utils_0.1.8 circlize_0.4.16 GenomeInfoDbData_1.2.12
[37] irlba_2.3.5.1 listenv_0.9.1 spatstat.utils_3.1-1 tidytree_0.4.6 goftest_1.2-3 RSpectra_0.16-2
[43] spatstat.random_3.3-2 fitdistrplus_1.2-1 parallelly_1.41.0 DelayedArray_0.30.1 leiden_0.4.3.1 codetools_0.2-20
[49] tidyselect_1.2.1 shape_1.4.6.1 aplot_0.2.4 UCSC.utils_1.0.0 farver_2.1.2 spatstat.explore_3.3-3
[55] jsonlite_1.8.9 GetoptLong_1.0.5 progressr_0.15.1 iterators_1.0.14 ggridges_0.5.6 survival_3.8-3
[61] systemfonts_1.1.0 foreach_1.5.2 tools_4.4.1 ragg_1.3.3 treeio_1.28.0 ica_1.0-3
[67] glue_1.8.0 SparseArray_1.4.8 gridExtra_2.3 withr_3.0.2 BiocManager_1.30.25 fastmap_1.2.0
[73] digest_0.6.37 rsvd_1.0.5 timechange_0.3.0 R6_2.5.1 mime_0.12 gridGraphics_0.5-1
[79] textshaping_0.4.1 ggprism_1.0.5 colorspace_2.1-1 Cairo_1.6-2 scattermore_1.2 tensor_1.5
[85] spatstat.data_3.1-4 R.methodsS3_1.8.2 tidyr_1.3.1 generics_0.1.3 renv_1.0.11 S4Arrays_1.4.1
[91] httr_1.4.7 htmlwidgets_1.6.4 uwot_0.2.2 pkgconfig_2.0.3 gtable_0.3.6 ComplexHeatmap_2.20.0
[97] lmtest_0.9-40 XVector_0.44.0 htmltools_0.5.8.1 dotCall64_1.2 clue_0.3-66 scales_1.3.0
[103] png_0.1-8 spatstat.univar_3.1-1 snakecase_0.11.1 ggfun_0.1.8 rstudioapi_0.17.1 rjson_0.2.23
[109] reshape2_1.4.4 nlme_3.1-166 zoo_1.8-12 GlobalOptions_0.1.2 KernSmooth_2.23-26 parallel_4.4.1
[115] miniUI_0.1.1.1 vipor_0.4.7 ggrastr_1.0.2 pillar_1.10.0 grid_4.4.1 vctrs_0.6.5
[121] RANN_2.6.2 promises_1.3.2 xtable_1.8-4 cluster_2.1.8 beeswarm_0.4.0 paletteer_1.6.0
[127] cli_3.6.3 compiler_4.4.1 crayon_1.5.3 rlang_1.1.4 future.apply_1.11.3 labeling_0.4.3
[133] rematch2_2.1.2 plyr_1.8.9 forcats_1.0.0 fs_1.6.5 ggbeeswarm_0.7.2 stringi_1.8.4
[139] viridisLite_0.4.2 deldir_2.0-4 munsell_0.5.1 lazyeval_0.2.2 spatstat.geom_3.3-4 Matrix_1.7-1
[145] RcppHNSW_0.6.0 patchwork_1.3.0 future_1.34.0 shiny_1.10.0 ROCR_1.0-11 igraph_2.1.2
[151] ape_5.8-1

Thank you,
Ishwar

@lengfei5
Copy link

lengfei5 commented Apr 2, 2025

same error here with scCustomize_3.0.1

@samuel-marsh samuel-marsh reopened this Apr 2, 2025
@samuel-marsh
Copy link
Owner

@lengfei5 @ishwarvh,

Thanks for reports and I’ve reopened the issue. Could you both confirm that the genes you are plotting are expressed by at least one cell in each of the groups you are splitting the plot by?

Best,
Sam

@samuel-marsh
Copy link
Owner

You can run:

Feature_Present(data = OBJ, features = c("GENE1", "GENE2", ...)

Best,
Sam

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
more-info-needed Further information is requested Return Later New/Updated Feature? Potentially return to this issue at later date.
Projects
None yet
Development

No branches or pull requests

5 participants