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:
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.
> 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...
I see
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...
Good for me ! Thanks a lot. Best Etienne