DESeq2 / agricolae packages conflict
1
0
Entering edit mode
@etiennerifa-23302
Last seen 4.6 years ago

Hello,

I'm developping package with DESeq2 and agricolae as dependencies. But DESeq() function seems to not work anymore when package agricolae is called.

library(agricolae)
library(DESeq2)

## DESeq() Example commands 
cnts <- matrix(rnbinom(n=1000, mu=100, size=1/0.5), ncol=10)
cond <- factor(rep(1:2, each=5))

# object construction
dds <- DESeqDataSetFromMatrix(cnts, DataFrame(cond), ~ cond)

# standard analysis
dds <- DESeq(dds)

Error:

Error in model.matrix.formula(design(object), colData(object)) : 
  data must be a data.frame

How can I handle this issue?

Thanks for your help Etienne

deseq2 dependendies conflict agricolae • 824 views
ADD COMMENT
1
Entering edit mode
@mikelove
Last seen 6 days ago
United States

Thanks for this report. I'm actually not sure why there is this conflict. I downloaded their package but I couldn't find where there would be some functions that change the behavior of DESeq2.

Anyway, I think I have modified the DESeq2 package calls to model.matrix that avoid the error. I was able to reproduce the error before the fix, and it is solved afterward.

This is then fixed in the latest version of DESeq2 on github (which will be the released version of DESeq2 on Bioconductor later in April). For now you can obtain this with:

install_github("mikelove/DESeq2", dependencies=FALSE)

I think this will work fine if you had the current release of Bioconductor, and then you can upgrade to the latest Bioconductor once it is released in end of April.

ADD COMMENT
0
Entering edit mode

I see

> dds <- DESeq(dds)
Error in model.matrix.formula(design(object), colData(object)) :
  data must be a data.frame
> traceback()
5: stop("data must be a data.frame")
4: model.matrix.formula(design(object), colData(object))
3: stats::model.matrix(design(object), colData(object))
2: designAndArgChecker(object, betaPrior)
1: DESeq(dds)
> class(design(dds))
[1] "formula"
> methods(model.matrix)
[1] model.matrix.coxph*    model.matrix.default   model.matrix.formula*
[4] model.matrix.lm        model.matrix.reStruct* model.matrix.survreg*
[7] model.matrix.terms*
see '?methods' for accessing help and source code
> getAnywhere("model.matrix.formula")
A single object matching 'model.matrix.formula' was found
It was found in the following places
  registered S3 method for model.matrix from namespace AlgDesign
  namespace:AlgDesign
with value

function (frml, data = sys.frame(sys.parent()), ...)
{
    if (!missing(data)) {
        if (!inherits(data, "data.frame"))
            stop("data must be a data.frame")
        if (!inherits(frml, "formula"))
            stop("frml must be a formula")
        frml <- expand.formula(frml, colnames(data))
    }
    model.matrix.default(frml, data, ...)
}
<bytecode: 0x7ff6e320e538>
<environment: namespace:AlgDesign>

so it looks like AlgDesign (poorly) implements a formula method that masks the (better written) default method. It seems like the AlgDesign people should be contacted...

ADD REPLY
0
Entering edit mode

Good for me ! Thanks a lot. Best Etienne

ADD REPLY

Login before adding your answer.

Traffic: 733 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