How to specify contrasts in DESeqDataSetFromMatrix
1
0
Entering edit mode
@floriandufey-19767
Last seen 5.1 years ago

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

deseq2 • 603 views
ADD COMMENT
0
Entering edit mode
@mikelove
Last seen 2 hours ago
United States

Yes, DESeqDataSetFromMatrix is an import function, and while you specify the design, you don't specify the contrasts. This happens in results. We have extensive help in the vignette as well as a workflow. Can you take a look there?

ADD COMMENT
0
Entering edit mode

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

ADD REPLY
0
Entering edit mode

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.

ADD REPLY

Login before adding your answer.

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