安装过程是很简单的,就照着官网里面描述的,直接:
if (!requireNamespace("BiocManager", quietly=TRUE))
install.packages("BiocManager")
BiocManager::install("DEP")
library("DEP")
但是,当我运行下面代码之后,
run_app("LFQ")
报错了:
载入需要的程辑包:shiny 载入程辑包:‘dplyr’ The following objects are masked from ‘package:stats’: filter, lag……
(此处省略一堆)
……
错误: 'imputeMethods' is not an exported object from 'namespace:MSnbase'
关键的是最后那一句。以前好像遇到过这种情况,大概是因为作者引用的imputeMethods方法所在的包的版本不兼容导致的。我第一个想到的解决方法,就是把对应的包更新为作者指定的版本。不过先不着急,先搜一下看看有没有更加简单的现成的解决方法,发现还真有。
在DEP的github issue里面,有人已经提问了,并且有一个人给出了解决方案:
I have found a solution to the issue. There was an issue of missing imputeMethod() in MSnbase, but no such method is available in the package.
This method is available in the MsCoreUtils package.
So, you can go to the R DEP installed directory and find "app.R" which may be available at path "~/R/x86_64-pc-linux-gnu-library/4.1/DEP/shiny_apps/LFQ".Edit the app.R file on line no 34 from
choices = c("man", MSnbase::imputeMethods())[1:9],
to this linechoices = c("man", MsCoreUtils::imputeMethods())[1:9],
This will allow the shiny app to run.
Hope this will help.
简单来说,就是改源码。按照上面的方法修改源码之后,成功运行: