Dear forum,
I am trying to set up a data set in DESeq2 with DESeqDataSetFromMatrix to perform afterwards a likelihood ratio test in DESeq. In DESeq, I can specify a both a full and a reduced model using the standard R "model.matrix" function in which I can also set the "contrasts" (e.g. "contr.sum", or "contr.Helmert") . However, in DESeqDataSetFromMatrix it is apparently not possible to specify the contrasts.
ddsinputtimeseries <- DESeqDataSetFromMatrix(countdata, coldata,~Level + wi)
I am unsure as to why it is necessary at all to specify a model in DESeqDataSetFromMatrix and whether it will conflict with the full model I specify in DESeq.
An example would be:
ddsinput <- DESeqDataSetFromMatrix(countdata, coldata,~Level + wi)
mfull <- model.matrix(~Level+wi,coldata,contrasts=list(wi="contr.sum"))
mred <- model.matrix(~Level)
ddstimeseries <- DESeq(ddsinput,test="LRT",full=mfull, reduced = mred,betaPrior=F)
Kind regards and thank's for your answer, Florian
Hello Michael, thank you very much for your fast reply! Of course I already had a close look at the vignette. I find your answer quite astonishing. The result of the LRT will depend on the contrasts chosen to build the model matrix. I don't see how this can be changed in the "results" command when the LRT has already been calculated.
Kind regards, Florian
Contrasts are for Wald tests in DESeq2.
You specify the full and reduced design for an LRT in DESeq(). You can find more help in the man pages, eg ?DESeq and the vignette.