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

unable to find an inherited method for function ‘featureDefinitions’ for signature ‘"xcmsSet"’ #52

Open
priyanka-1802 opened this issue Jan 3, 2024 · 2 comments

Comments

@priyanka-1802
Copy link

Hi,

we tried to perform RAMClustR by importing the xcms preprocessed data as provided in your vignette. However, we couldn't proceed further due to the following error:

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

Note: we also got the same error on trying with the dataset from "faahKO" library that had been demonstrated in the RAMClustR vignette.

The session info of the same is given below for your reference:

sessionInfo()
R version 4.3.1 (2023-06-16 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19044)

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252 LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C LC_TIME=English_United States.1252

time zone: America/New_York
tzcode source: internal

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

other attached packages:
[1] devtools_2.4.5 usethis_2.2.2 RAMClustR_1.3.1 SummarizedExperiment_1.32.0
[5] GenomicRanges_1.54.1 GenomeInfoDb_1.38.2 IRanges_2.36.0 MatrixGenerics_1.14.0
[9] matrixStats_1.2.0 MsExperiment_1.4.0 pheatmap_1.0.12 pander_0.6.5
[13] RColorBrewer_1.1-3 faahKO_1.40.0 xcms_4.0.1 MSnbase_2.28.1
[17] ProtGenerics_1.34.0 S4Vectors_0.40.2 mzR_2.36.0 Rcpp_1.0.11
[21] Biobase_2.62.0 BiocGenerics_0.48.1 BiocParallel_1.36.0

loaded via a namespace (and not attached):
[1] rstudioapi_0.15.0 MultiAssayExperiment_1.28.0 magrittr_2.0.3 farver_2.1.1
[5] MALDIquant_1.22.1 fs_1.6.3 zlibbioc_1.48.0 vctrs_0.6.4
[9] multtest_2.58.0 memoise_2.0.1 RCurl_1.98-1.13 MultiDataSet_1.28.0
[13] htmltools_0.5.7 S4Arrays_1.2.0 progress_1.2.3 curl_5.2.0
[17] dynamicTreeCut_1.63-1 SparseArray_1.2.2 mzID_1.40.0 desc_1.4.3
[21] htmlwidgets_1.6.4 plyr_1.8.9 impute_1.76.0 cachem_1.0.8
[25] qqman_0.1.9 igraph_1.6.0 mime_0.12 lifecycle_1.0.4
[29] iterators_1.0.14 ropls_1.32.0 pkgconfig_2.0.3 Matrix_1.6-1.1
[33] R6_2.5.1 fastmap_1.1.1 GenomeInfoDbData_1.2.11 shiny_1.7.5.1
[37] clue_0.3-65 digest_0.6.33 pcaMethods_1.94.0 colorspace_2.1-0
[41] ps_1.7.5 pkgload_1.3.3 Spectra_1.12.0 fansi_1.0.6
[45] abind_1.4-5 compiler_4.3.1 remotes_2.4.2.1 proxy_0.4-27
[49] doParallel_1.0.17 pkgbuild_1.4.3 MASS_7.3-60 sessioninfo_1.2.2
[53] DelayedArray_0.28.0 tools_4.3.1 httpuv_1.6.13 glue_1.6.2
[57] callr_3.7.3 promises_1.2.1 QFeatures_1.12.0 grid_4.3.1
[61] cluster_2.1.4 generics_0.1.3 snow_0.4-4 gtable_0.3.4
[65] class_7.3-22 preprocessCore_1.64.0 hms_1.1.3 MetaboCoreUtils_1.10.0
[69] utf8_1.2.4 XVector_0.42.0 stringr_1.5.1 RANN_2.6.1
[73] foreach_1.5.2 pillar_1.9.0 limma_3.58.1 later_1.3.2
[77] robustbase_0.99-1 splines_4.3.1 dplyr_1.1.4 lattice_0.21-9
[81] survival_3.5-7 tidyselect_1.2.0 miniUI_0.1.1.1 statmod_1.5.0
[85] DEoptimR_1.1-3 stringi_1.7.12 lazyeval_0.2.2 codetools_0.2-19
[89] MsCoreUtils_1.14.1 tibble_3.2.1 BiocManager_1.30.22 cli_3.6.1
[93] affyio_1.72.0 xtable_1.8-4 processx_3.8.3 munsell_0.5.0
[97] MassSpecWavelet_1.68.0 XML_3.99-0.16 fastcluster_1.2.3 parallel_4.3.1
[101] ellipsis_0.3.2 ggplot2_3.4.4 prettyunits_1.2.0 profvis_0.3.8
[105] calibrate_1.7.7 urlchecker_1.0.1 AnnotationFilter_1.26.0 bitops_1.0-7
[109] MsFeatures_1.10.0 scales_1.3.0 affy_1.80.0 e1071_1.7-14
[113] ncdf4_1.22 purrr_1.0.2 crayon_1.5.2 rlang_1.1.1
[117] vsn_3.70.0

@sneumann
Copy link
Collaborator

sneumann commented Jan 5, 2024

Hi, thanks for reporting. To help us, it is always best to provide a copy&pasteable code snippet so we can reproduce things. Another easy thing to try after an error occurs is to run traceback() which gives the context where the error occurred.
In this case you seem to have hit an issue that featureDefinitions() is a method expecting an MsFeatureData, where you supplied an xcmsSet which is the old, deprecated XCMS data structure.
Yours, Steffen

@priyanka-1802
Copy link
Author

Hi, we tried to replicate the code in RAMClustR vignette. However, I providing the code below for your immediate reference:

library(BiocManager)
library(xcms)
library(faahKO)
library(devtools)
library(RAMClustR)

cdfpath <- system.file("cdf", package = "faahKO")
cdffiles <- list.files(cdfpath, recursive = TRUE, full.names = TRUE)
xset <- xcmsSet(cdffiles)
xset <- group(xset)
xset <- retcor(xset, family = "symmetric", plottype = NULL)
xset <- group(xset, bw = 10)
xset <- fillPeaks(xset)
experiment <- defineExperiment(csv = TRUE) # experiment <- defineExperiment(force.skip = TRUE)
RC <- ramclustR(xcmsObj = xset, ExpDes=experiment)

We got the error in the last step stating "Error in (function (classes, fdef, mtable) : unable to find an inherited method for function ‘featureDefinitions’ for signature "xcmsSet"".

The traceback of error is provided below:

6: stop(gettextf("unable to find an inherited method for function %s for signature %s",
sQuote(fdef@generic), sQuote(cnames)), domain = NA)
5: (function (classes, fdef, mtable)
{
methods <- .findInheritedMethods(classes, fdef, mtable)
if (length(methods) == 1L)
return(methods[[1L]])
else if (length(methods) == 0L) {
cnames <- paste0(""", vapply(classes, as.character,
""), """, collapse = ", ")
stop(gettextf("unable to find an inherited method for function %s for signature %s",
sQuote(fdef@generic), sQuote(cnames)), domain = NA)
}
else stop("Internal error in finding inherited methods; didn't return a unique method",
domain = NA)
})(list(structure("xcmsSet", package = "xcms")), new("standardGeneric",
.Data = function (object, ...)
standardGeneric("featureDefinitions"), generic = structure("featureDefinitions", package = "xcms"),
package = "xcms", group = list(), valueClass = character(0),
signature = "object", default = NULL, skeleton = (function (object,
...)
stop(gettextf("invalid call in method dispatch to '%s' (no default method)",
...
4: xcms::featureDefinitions(xcmsObj)
3: rownames(xcms::featureDefinitions(xcmsObj))
2: rc.get.xcms.data(xcmsObj = xcmsObj, taglocation = taglocation,
MStag = MStag, MSMStag = idMSMStag, ExpDes = ExpDes, mzdec = mzdec,
ensure.no.na = replace.zeros)
1: ramclustR(xcmsObj = xset, ExpDes = experiment)

Hence, we are confused how the xcmsSet object is handled in the RAMClustR vignette tutorial? Is that mean that the vignette of RAMClustR has to be updated?

Thanks,
Priyanka

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

2 participants