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

Error in (function (classes, fdef, mtable) #119

Open
CWYuan08 opened this issue Feb 13, 2025 · 9 comments
Open

Error in (function (classes, fdef, mtable) #119

CWYuan08 opened this issue Feb 13, 2025 · 9 comments

Comments

@CWYuan08
Copy link

您好,请问以下的报错如何解决?

cm <- clusterData(exps ,

  •               cluster.method = "mfuzz",
    
  •               cluster.num = 12)
    

Error in (function (classes, fdef, mtable) :
unable to find an inherited method for function ‘exprs’ for signature ‘"ExpressionSet"’

非常感谢!!

@junjunlab
Copy link
Owner

重新安装试试

@CWYuan08
Copy link
Author

不好意思已重新安装过了,但还是有这个error

@junjunlab
Copy link
Owner

没有安装好吧?

Image

@CWYuan08
Copy link
Author

您好,我试着重新安装了几次, 但是用cluster.method=“mfuzz“ 就会有同样的报错 (Error in (function (classes, fdef, mtable) : unable to find an inherited method for function ‘exprs’ for signature ‘"ExpressionSet), 如果用”kmeans“就没有。会不会是biobase的exprs的问题呢?感谢🙏

@hullv
Copy link

hullv commented Feb 18, 2025

没有安装好吧?

Image

我也遇到了这个问题。我是按照以下步骤进行安装的:
BiocManager::install("ComplexHeatmap",force = TRUE)
BiocManager::install("clusterProfiler",force = TRUE)
BiocManager::install("TCseq",force = TRUE)
BiocManager::install("Mfuzz",force = TRUE)
BiocManager::install("monocle",force = TRUE)
devtools::install_github('cole-trapnell-lab/monocle3',force = TRUE)
install.packages("circlize",force = TRUE)
devtools::install_github("junjunlab/ClusterGVis",force = TRUE)

但是,我在创建对象的时候依旧有报错:

cm <- clusterData(exp = result,

  •               cluster.method = "mfuzz",
    
  •               cluster.num = 9)
    

Error in h(simpleError(msg, call)) :
error in evaluating the argument 'assayData' in selecting a method for function 'ExpressionSet': cannot coerce type 'builtin' to vector of type 'any'

str(result)
'data.frame': 14751 obs. of 5 variables:
$ Neonatal : num 11.5 12.3 12.5 10.7 12.1 ...
$ Young : num 11.4 12 12.7 10.6 12 ...
$ Middle_early: num 11.5 12.1 12.8 10.6 12.1 ...
$ Middle_late : num 11.5 12.3 12.5 10.6 12.1 ...
$ Old : num 11.6 12.3 12.5 10.6 12.1 ...

请问俊俊大神这个问题应该如何解决?

@junjunlab
Copy link
Owner

我这里确实没问题,刚从github下载的,你们看看sessionInfo:

> sessionInfo()
R version 4.4.1 (2024-06-14 ucrt)
Platform: x86_64-w64-mingw32/x64
Running under: Windows 11 x64 (build 26100)

Matrix products: default


locale:
[1] LC_COLLATE=Chinese (Simplified)_China.utf8  LC_CTYPE=Chinese (Simplified)_China.utf8   
[3] LC_MONETARY=Chinese (Simplified)_China.utf8 LC_NUMERIC=C                               
[5] LC_TIME=Chinese (Simplified)_China.utf8    

time zone: Asia/Shanghai
tzcode source: internal

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

other attached packages:
[1] DynDoc_1.82.0       Biobase_2.64.0      BiocGenerics_0.50.0 widgetTools_1.82.0  ClusterGVis_0.1.2  

loaded via a namespace (and not attached):
 [1] SummarizedExperiment_1.34.0 circlize_0.4.16             shape_1.4.6.1              
 [4] rjson_0.2.21                httr2_1.1.0                 GlobalOptions_0.1.2        
 [7] lattice_0.22-6              vctrs_0.6.5                 tools_4.4.1                
[10] generics_0.1.3              stats4_4.4.1                parallel_4.4.1             
[13] tibble_3.2.1                proxy_0.4-27                fansi_1.0.6                
[16] cluster_2.1.6               pkgconfig_2.0.3             Matrix_1.7-0               
[19] RColorBrewer_1.1-3          S7_0.2.0                    S4Vectors_0.42.1           
[22] lifecycle_1.0.4             GenomeInfoDbData_1.2.12     stringr_1.5.1              
[25] compiler_4.4.1              codetools_0.2-20            ComplexHeatmap_2.20.0      
[28] clue_0.3-65                 GenomeInfoDb_1.40.1         class_7.3-22               
[31] pillar_1.9.0                crayon_1.5.3                SingleCellExperiment_1.26.0
[34] DelayedArray_0.30.1         iterators_1.0.14            abind_1.4-8                
[37] foreach_1.5.2               tidyselect_1.2.1            digest_0.6.37              
[40] stringi_1.8.4               purrr_1.0.2                 reshape2_1.4.4             
[43] dplyr_1.1.4                 grid_4.4.1                  colorspace_2.1-1           
[46] cli_3.6.3                   SparseArray_1.4.8           magrittr_2.0.3             
[49] S4Arrays_1.4.1              utf8_1.2.4                  e1071_1.7-16               
[52] withr_3.0.1                 UCSC.utils_1.0.0            rappdirs_0.3.3             
[55] XVector_0.44.0              httr_1.4.7                  matrixStats_1.3.0          
[58] png_0.1-8                   GetoptLong_1.0.5            tkWidgets_1.82.0           
[61] GenomicRanges_1.56.1        IRanges_2.38.1              doParallel_1.0.17          
[64] rlang_1.1.4                 Rcpp_1.0.13                 glue_1.7.0                 
[67] coro_1.1.0                  rstudioapi_0.17.0           jsonlite_1.8.8             
[70] plyr_1.8.9                  ellmer_0.1.0.9000           R6_2.5.1                   
[73] Mfuzz_2.64.0                MatrixGenerics_1.16.0       zlibbioc_1.50.0            
> 

@hullv
Copy link

hullv commented Feb 18, 2025

我通过先加载两个包解决了这个问题。
library(Biobase)
library(Mfuzz)

@xiahui625649
Copy link

您好,我试着重新安装了几次, 但是用cluster.method=“mfuzz“ 就会有同样的报错 (Error in (function (classes, fdef, mtable) : unable to find an inherited method for function ‘exprs’ for signature ‘"ExpressionSet), 如果用”kmeans“就没有。会不会是biobase的exprs的问题呢?感谢🙏

`> cm <- clusterData(exps,

  •               cluster.method = "mfuzz",
    
  •               cluster.num = 8)
    

[1] "0 genes excluded.\n"
Error: unable to find an inherited method for function ‘exprs’ for signature ‘x = "ExpressionSet"’`我也遇到同样问题,请问解决了吗?

@yinyeya
Copy link

yinyeya commented Feb 25, 2025

I noticed that the error occurs because the exprs function is defined in both the Biobase and ClusterGVis packages, causing a conflict when loading the ClusterGVis environment.

> find("exprs")
[1] ".conflicts"          "package:Biobase"     "package:ClusterGVis"

The mfuzz package relies on the exprs function from Biobase but does not explicitly specify it using ::.

To resolve this, I used the conflicted package with conflict_prefer("exprs", "Biobase") before running clusterData.

Alternatively, reordering the package load order (loading Biobase last) could prioritize its exprs function, like @hullv suggested, since the order of package loading determines which function takes precedence. But this approach did not work in my environment.

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

5 participants