我想安装 DESeq2 包,以便我可以使用调试器逐步完成它。

该包的源代码可通过 GitHub 获得,但我不清楚如何安装该包,以便我可以在调试器中单步调试它的 R 代码。

有没有办法做到这一点?

顺便说一句,我尝试了 this earlier thread 中提出的方法,但我一无所获:

> trace(DESeq2::plotPCA, browser, at=1)
> devnull <- DESeq2::plotPCA(rld, intgroup = "q", returnData = TRUE)
Tracing DESeq2::plotPCA(rld, intgroup = "q", returnData = TRUE) step 1
Called from: eval(expr, envir, enclos)
Browse[1]> n
debug: `{`
Browse[2]> n
debug: standardGeneric("plotPCA")
Browse[2]> n
>

(即,在上面最后一个 n 之后,我又回到了顶级提示。)

如果我在顶级提示中输入 DESeq2::plotPCA,我得到的只是
> DESeq2::plotPCA
nonstandardGenericFunction for "plotPCA" defined from package "BiocGenerics"

function (object, ...)
{
    standardGeneric("plotPCA")
}
<environment: 0x26bee20>
Methods may be defined for arguments: object
Use  showMethods("plotPCA")  for currently available ones.

我还尝试仅获取定义 DESeq2::plotPCA 的源文件,但这失败了
Error in setMethod("plotDispEsts", signature(object = "DESeqDataSet"),  :
  no existing definition for function ‘plotDispEsts’

很明显,在获取此文件之前需要进行一些设置。这种认识是导致这篇文章的原因。

最佳答案

debug()signature= 参数一起使用,例如,

> showMethods("plotPCA")
Function: plotPCA (package BiocGenerics)
object="DESeqTransform"

> debug(plotPCA, signature="DESeqTransform")
Tracing specified method for function "plotPCA" in environment
<namespace:BiocGenerics>

无需特殊安装,只需 BiocInstaller::biocLite("DESeq2")

关于r - 如何安装包以便我可以使用调试器单步调试它的 R 代码?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/41686680/

10-13 08:54
查看更多