huayc09 / SeuratExtend

https://huayc09.github.io/SeuratExtend/
GNU General Public License v3.0
101 stars 8 forks source link

unable to find an inherited method for function 'select' for signature '"grouped_df" #5

Closed asmlgkj closed 3 months ago

asmlgkj commented 3 months ago

Thanks a lot for this great package. seurat v5 example code

VlnPlot2(

  • pbmc,
  • features = genes,
  • group.by = "cluster",
  • cells = cells,
  • stat.method = "wilcox.test") Error in (function (classes, fdef, mtable) : unable to find an inherited method for function 'select' for signature '"grouped_df"'
huayc09 commented 3 months ago

Thank you for reporting this issue. I've tested the following code on my end:

library(SeuratExtend)
genes <- c("CD3D","CD14","CD79A")
cells <- colnames(pbmc)[pbmc$cluster %in% c("B cell", "Mono CD14", "CD8 T cell")]
VlnPlot2(pbmc, features = genes, group.by = "cluster", cell = cells,
         stat.method = "wilcox.test", hide.ns = TRUE)

The plot was generated without any issues. I'm also using Seurat v5. Here's part of my session info:

R version 4.4.0 (2024-04-24)
Platform: x86_64-pc-linux-gnu
Running under: Ubuntu 20.04.6 LTS
time zone: Europe/Brussels
tzcode source: system (glibc)

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

other attached packages:
[1] dplyr_1.1.4            ggpubr_0.6.0           ggplot2_3.5.1          reshape2_1.4.4        
[5] SeuratExtend_1.0.0     SeuratObject_5.0.2     sp_2.1-4               SeuratExtendData_0.2.0

My suspicion is that this might be related to the select function. Multiple packages have a select function, and it's possible that when VlnPlot2 is trying to use dplyr::select internally, it's being masked by another package's select function. However, I'm not sure which package might be causing this.

Could you please try the following:

  1. Open a new R session to ensure a clean environment.
  2. Run the code again in this new session.
  3. If the error persists, could you please share your full sessionInfo()? This will help us identify any potential conflicts or version mismatches.

This information will help me pinpoint the source of the problem and provide a more targeted solution. Thank you for your patience and cooperation in resolving this issue.

asmlgkj commented 3 months ago

thanks a lot, after did as your suggestions, it is fine now. I also do not know whereis the problem

huayc09 commented 3 months ago

I've recently updated the VlnPlot2 function to explicitly specify that it's using the select function from the dplyr package.