LFQ shiny app from DEP package reports: Error: 'imputeMethods' is not an exported object from 'namespace:MSnbase'
1
0
Entering edit mode
Tobias ▴ 40
@tobias-24288
Last seen 15 months ago
Switzerland

Hi DEP package maintainers,

I am getting an error message when trying to load one of your shiny apps. It looks like the code tries to execute a function from MSnbase that does not exist or is not exported.

> library(DEP)
> run_app("LFQ")
Loading required package: shiny
Loading required package: MatrixGenerics
Loading required package: matrixStats

Attaching package: ‘matrixStats’

The following object is masked from ‘package:dplyr’:

    count


Attaching package: ‘MatrixGenerics’

The following objects are masked from ‘package:matrixStats’:

    colAlls, colAnyNAs, colAnys, colAvgsPerRowSet, colCollapse, colCounts, colCummaxs,
    colCummins, colCumprods, colCumsums, colDiffs, colIQRDiffs, colIQRs, colLogSumExps,
    colMadDiffs, colMads, colMaxs, colMeans2, colMedians, colMins, colOrderStats, colProds,
    colQuantiles, colRanges, colRanks, colSdDiffs, colSds, colSums2, colTabulates, colVarDiffs,
    colVars, colWeightedMads, colWeightedMeans, colWeightedMedians, colWeightedSds,
    colWeightedVars, rowAlls, rowAnyNAs, rowAnys, rowAvgsPerColSet, rowCollapse, rowCounts,
    rowCummaxs, rowCummins, rowCumprods, rowCumsums, rowDiffs, rowIQRDiffs, rowIQRs,
    rowLogSumExps, rowMadDiffs, rowMads, rowMaxs, rowMeans2, rowMedians, rowMins, rowOrderStats,
    rowProds, rowQuantiles, rowRanges, rowRanks, rowSdDiffs, rowSds, rowSums2, rowTabulates,
    rowVarDiffs, rowVars, rowWeightedMads, rowWeightedMeans, rowWeightedMedians, rowWeightedSds,
    rowWeightedVars

Loading required package: GenomicRanges
Loading required package: stats4
Loading required package: BiocGenerics

Attaching package: ‘BiocGenerics’

The following objects are masked from ‘package:dplyr’:

    combine, intersect, setdiff, union

The following objects are masked from ‘package:stats’:

    IQR, mad, sd, var, xtabs

The following objects are masked from ‘package:base’:

    anyDuplicated, append, as.data.frame, basename, cbind, colnames, dirname, do.call,
    duplicated, eval, evalq, Filter, Find, get, grep, grepl, intersect, is.unsorted, lapply,
    Map, mapply, match, mget, order, paste, pmax, pmax.int, pmin, pmin.int, Position, rank,
    rbind, Reduce, rownames, sapply, setdiff, sort, table, tapply, union, unique, unsplit,
    which.max, which.min

Loading required package: S4Vectors

Attaching package: ‘S4Vectors’

The following objects are masked from ‘package:dplyr’:

    first, rename

The following objects are masked from ‘package:base’:

    expand.grid, I, unname

Loading required package: IRanges

Attaching package: ‘IRanges’

The following objects are masked from ‘package:dplyr’:

    collapse, desc, slice

Loading required package: GenomeInfoDb
Loading required package: Biobase
Welcome to Bioconductor

    Vignettes contain introductory material; view with 'browseVignettes()'. To cite
    Bioconductor, see 'citation("Biobase")', and for packages 'citation("pkgname")'.


Attaching package: ‘Biobase’

The following object is masked from ‘package:MatrixGenerics’:

    rowMedians

The following objects are masked from ‘package:matrixStats’:

    anyMissing, rowMedians


Attaching package: ‘shinydashboard’

The following object is masked from ‘package:graphics’:

    box

Error: 'imputeMethods' is not an exported object from 'namespace:MSnbase'
> sessionInfo()
R version 4.1.2 (2021-11-01)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Catalina 10.15.7

Matrix products: default
BLAS:   /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/4.1/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] stats4    stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] shinydashboard_0.7.2        SummarizedExperiment_1.24.0 Biobase_2.54.0             
 [4] GenomicRanges_1.46.1        GenomeInfoDb_1.30.1         IRanges_2.28.0             
 [7] S4Vectors_0.32.3            BiocGenerics_0.40.0         MatrixGenerics_1.6.0       
[10] matrixStats_0.61.0          tibble_3.1.6                shiny_1.7.1                
[13] DEP_1.16.0                  gmm_1.6-6                   sandwich_3.0-1             
[16] dplyr_1.0.8                 readr_2.1.2                

loaded via a namespace (and not attached):
  [1] colorspace_2.0-3       rjson_0.2.21           ellipsis_0.3.2         circlize_0.4.14       
  [5] XVector_0.34.0         GlobalOptions_0.1.2    clue_0.3-60            rstudioapi_0.13       
  [9] mzR_2.28.0             affyio_1.64.0          DT_0.21                bit64_4.0.5           
 [13] fansi_1.0.2            mvtnorm_1.1-3          codetools_0.2-18       ncdf4_1.19            
 [17] doParallel_1.0.17      impute_1.68.0          knitr_1.37             cluster_2.1.2         
 [21] vsn_3.62.0             png_0.1-7              BiocManager_1.30.16    compiler_4.1.2        
 [25] assertthat_0.2.1       Matrix_1.4-0           fastmap_1.1.0          limma_3.50.1          
 [29] cli_3.2.0              later_1.3.0            htmltools_0.5.2        tools_4.1.2           
 [33] gtable_0.3.0           glue_1.6.2             GenomeInfoDbData_1.2.7 affy_1.72.0           
 [37] Rcpp_1.0.8             MALDIquant_1.21        vctrs_0.3.8            preprocessCore_1.56.0 
 [41] iterators_1.0.14       tmvtnorm_1.4-10        xfun_0.29              mime_0.12             
 [45] lifecycle_1.0.1        XML_3.99-0.9           rawrr_1.2.0            zlibbioc_1.40.0       
 [49] MASS_7.3-55            zoo_1.8-9              scales_1.1.1           vroom_1.5.7           
 [53] MSnbase_2.20.4         pcaMethods_1.86.0      hms_1.1.1              promises_1.2.0.1      
 [57] ProtGenerics_1.26.0    parallel_4.1.2         protViz_0.7.0          RColorBrewer_1.1-2    
 [61] ComplexHeatmap_2.10.0  yaml_2.3.5             ggplot2_3.3.5          foreach_1.5.2         
 [65] BiocParallel_1.28.3    shape_1.4.6            rlang_1.0.1            pkgconfig_2.0.3       
 [69] bitops_1.0-7           imputeLCMD_2.0         mzID_1.32.0            fontawesome_0.2.2     
 [73] evaluate_0.15          lattice_0.20-45        purrr_0.3.4            htmlwidgets_1.5.4     
 [77] bit_4.0.4              tidyselect_1.1.2       norm_1.0-9.5           plyr_1.8.6            
 [81] magrittr_2.0.2         R6_2.5.1               generics_0.1.2         DelayedArray_0.20.0   
 [85] DBI_1.1.2              pillar_1.7.0           withr_2.4.3            MsCoreUtils_1.6.2     
 [89] RCurl_1.98-1.6         crayon_1.5.0           utf8_1.2.2             tzdb_0.2.0            
 [93] rmarkdown_2.11         GetoptLong_1.0.5       grid_4.1.2             digest_0.6.29         
 [97] xtable_1.8-4           tidyr_1.2.0            httpuv_1.6.5           munsell_0.5.0         
>

A function named imputeMethods() exists in MSCoreUtils

> MsCoreUtils::imputeMethods()
 [1] "bpca"    "knn"     "QRILC"   "MLE"     "MinDet"  "MinProb" "min"     "zero"    "mixed"   "nbavg"  
[11] "with"    "none"

A code bug?

Best, Tobi

MSnbase MsCoreUtils DEP • 4.3k views
ADD COMMENT
0
Entering edit mode

Here is traceback of the error:


> run_app("LFQ")
Error: 'imputeMethods' is not an exported object from 'namespace:MSnbase'
> traceback()
26: normalizeChoicesArgs(choices, choiceNames, choiceValues)
25: radioButtons("imputation", "Imputation type", choices = c("man", 
        MSnbase::imputeMethods())[1:9], selected = "MinProb")
24: menuItem("Imputation options", radioButtons("imputation", "Imputation type", 
        choices = c("man", MSnbase::imputeMethods())[1:9], selected = "MinProb"), 
        p(a("Detailed information link", href = "https://www.rdocumentation.org/packages/MSnbase/versions/1.20.7/topics/impute-methods", 
            target = "_blank")))
23: sidebarMenu(menuItem("Files", selected = TRUE, fileInput("file1", 
        "ProteinGroups.txt", accept = c("text/csv", "text/comma-separated-values,text/plain", 
            ".csv")), fileInput("file2", "ExperimentalDesign.txt", 
        accept = c("text/csv", "text/comma-separated-values,text/plain", 
            ".csv")), radioButtons("anno", "Sample annotation", choices = list(`Parse from columns` = "columns", 
        `Use Experimental Design` = "expdesign"), selected = "expdesign")), 
        menuItemOutput("columns"), menuItem("Imputation options", 
            radioButtons("imputation", "Imputation type", choices = c("man", 
                MSnbase::imputeMethods())[1:9], selected = "MinProb"), 
            p(a("Detailed information link", href = "https://www.rdocumentation.org/packages/MSnbase/versions/1.20.7/topics/impute-methods", 
                target = "_blank"))), actionButton("analyze", "Analyze"), 
        tags$hr(), uiOutput("downloadTable"), uiOutput("downloadButton"))
22: dots_list(...)
21: tags$section(id = "sidebarItemExpanded", class = "sidebar", `data-disable` = if (disable) 1 else NULL, 
        list(...))
20: dots_list(...)
19: tags$aside(id = "sidebarCollapsed", class = "main-sidebar", `data-collapsed` = dataValueString, 
        custom_css, tags$section(id = "sidebarItemExpanded", class = "sidebar", 
            `data-disable` = if (disable) 1 else NULL, list(...)))
18: dashboardSidebar(sidebarMenu(menuItem("Files", selected = TRUE, 
        fileInput("file1", "ProteinGroups.txt", accept = c("text/csv", 
            "text/comma-separated-values,text/plain", ".csv")), fileInput("file2", 
            "ExperimentalDesign.txt", accept = c("text/csv", "text/comma-separated-values,text/plain", 
                ".csv")), radioButtons("anno", "Sample annotation", 
            choices = list(`Parse from columns` = "columns", `Use Experimental Design` = "expdesign"), 
            selected = "expdesign")), menuItemOutput("columns"), 
        menuItem("Imputation options", radioButtons("imputation", 
            "Imputation type", choices = c("man", MSnbase::imputeMethods())[1:9], 
            selected = "MinProb"), p(a("Detailed information link", 
            href = "https://www.rdocumentation.org/packages/MSnbase/versions/1.20.7/topics/impute-methods", 
            target = "_blank"))), actionButton("analyze", "Analyze"), 
        tags$hr(), uiOutput("downloadTable"), uiOutput("downloadButton")))
17: tagAssert(sidebar, type = "aside", class = "main-sidebar")
16: dashboardPage(dashboardHeader(title = "DEP - LFQ"), dashboardSidebar(sidebarMenu(menuItem("Files", 
        selected = TRUE, fileInput("file1", "ProteinGroups.txt", 
            accept = c("text/csv", "text/comma-separated-values,text/plain", 
                ".csv")), fileInput("file2", "ExperimentalDesign.txt", 
            accept = c("text/csv", "text/comma-separated-values,text/plain", 
                ".csv")), radioButtons("anno", "Sample annotation", 
            choices = list(`Parse from columns` = "columns", `Use Experimental Design` = "expdesign"), 
            selected = "expdesign")), menuItemOutput("columns"), 
        menuItem("Imputation options", radioButtons("imputation", 
            "Imputation type", choices = c("man", MSnbase::imputeMethods())[1:9], 
            selected = "MinProb"), p(a("Detailed information link", 
            href = "https://www.rdocumentation.org/packages/MSnbase/versions/1.20.7/topics/impute-methods", 
            target = "_blank"))), actionButton("analyze", "Analyze"), 
        tags$hr(), uiOutput("downloadTable"), uiOutput("downloadButton"))), 
        dashboardBody(helpText("Please cite: "), fluidRow(box(numericInput("p", 
            "adj. P value", min = 1e-04, max = 0.1, value = 0.05), 
            width = 2), box(numericInput("lfc", "Log2 fold change", 
            min = 0, max = 10, value = 1), width = 2), infoBoxOutput("significantBox"), 
            box(radioButtons("pres", "Data presentation", c("contrast", 
                "centered"), selected = "contrast"), width = 2), 
     ...
15: shinyUI(dashboardPage(dashboardHeader(title = "DEP - LFQ"), dashboardSidebar(sidebarMenu(menuItem("Files", 
        selected = TRUE, fileInput("file1", "ProteinGroups.txt", 
            accept = c("text/csv", "text/comma-separated-values,text/plain", 
                ".csv")), fileInput("file2", "ExperimentalDesign.txt", 
            accept = c("text/csv", "text/comma-separated-values,text/plain", 
                ".csv")), radioButtons("anno", "Sample annotation", 
            choices = list(`Parse from columns` = "columns", `Use Experimental Design` = "expdesign"), 
            selected = "expdesign")), menuItemOutput("columns"), 
        menuItem("Imputation options", radioButtons("imputation", 
            "Imputation type", choices = c("man", MSnbase::imputeMethods())[1:9], 
            selected = "MinProb"), p(a("Detailed information link", 
            href = "https://www.rdocumentation.org/packages/MSnbase/versions/1.20.7/topics/impute-methods", 
            target = "_blank"))), actionButton("analyze", "Analyze"), 
        tags$hr(), uiOutput("downloadTable"), uiOutput("downloadButton"))), 
        dashboardBody(helpText("Please cite: "), fluidRow(box(numericInput("p", 
            "adj. P value", min = 1e-04, max = 0.1, value = 0.05), 
            width = 2), box(numericInput("lfc", "Log2 fold change", 
            min = 0, max = 10, value = 1), width = 2), infoBoxOutput("significantBox"), 
            box(radioButtons("pres", "Data presentation", c("contrast", 
                "centered"), selected = "contrast"), width = 2), 
     ...
14: ..stacktraceon..({
        library(dplyr)
        library(tibble)
        library(SummarizedExperiment)
        library(DEP)
        library(shiny)
        library(shinydashboard)
        ui <- shinyUI(dashboardPage(dashboardHeader(title = "DEP - LFQ"), 
            dashboardSidebar(sidebarMenu(menuItem("Files", selected = TRUE, 
                fileInput("file1", "ProteinGroups.txt", accept = c("text/csv", 
                    "text/comma-separated-values,text/plain", ".csv")), 
                fileInput("file2", "ExperimentalDesign.txt", accept = c("text/csv", 
                    "text/comma-separated-values,text/plain", ".csv")), 
                radioButtons("anno", "Sample annotation", choices = list(`Parse from columns` = "columns", 
                    `Use Experimental Design` = "expdesign"), selected = "expdesign")), 
                menuItemOutput("columns"), menuItem("Imputation options", 
                    radioButtons("imputation", "Imputation type", 
                      choices = c("man", MSnbase::imputeMethods())[1:9], 
                      selected = "MinProb"), p(a("Detailed information link", 
                      href = "https://www.rdocumentation.org/packages/MSnbase/versions/1.20.7/topics/impute-methods", 
     ...
13: eval(exprs, envir)
12: eval(exprs, envir)
11: sourceUTF8(fullpath, envir = new.env(parent = sharedEnv))
10: func(fname, ...)
9: appObj()
8: shinyAppDir_appR("app.R", appDir, options = options)
7: shinyAppDir(x)
6: as.shiny.appobj.character(appDir)
5: as.shiny.appobj(appDir)
4: runApp(appDir, display.mode = "normal")
3: withCallingHandlers(expr, warning = function(w) if (inherits(w, 
       classes)) tryInvokeRestart("muffleWarning"))
2: suppressWarnings(runApp(appDir, display.mode = "normal"))
1: run_app("LFQ")
ADD REPLY
0
Entering edit mode

Looks like somebody else already reported this error, see Bioc issue, but the DEP package maintainer(s) don't seem to react (>14 days). How is this handled in general?

ADD REPLY
0
Entering edit mode
@laurent-gatto-5645
Last seen 6 weeks ago
Belgium

You are spot on with the description of the error. Functions related to imputation, including imputeMethods() have moved to MsCoreUtils. The DEP maintainers need to adapt their shinyapp (which should be straightforward). In the meantime, I'll try to share a quick fix.

ADD COMMENT
0
Entering edit mode

Here's an updated app with that line fixed (and an updated link to the documentation page) - https://gist.github.com/lgatto/a88f7c68f42cf96e68dd42c12c8a76af. I haven't tested it.

ADD REPLY
0
Entering edit mode

It works! Thanks a lot for providing the hot fix. Out of curiosity: Why did this error escape the testing?

ADD REPLY
0
Entering edit mode

Because they don't test their shiny app. There are warnings though that point indirectly to the issue.

ADD REPLY
0
Entering edit mode

issue is acknowledged with workaround patch here: https://github.com/arnesmits/DEP/issues/26

ADD REPLY

Login before adding your answer.

Traffic: 810 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6