Question: How to specify contrasts in DESeqDataSetFromMatrix
0
gravatar for florian.dufey
10 weeks ago by
florian.dufey0 wrote:

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 • 78 views
ADD COMMENTlink modified 10 weeks ago by Michael Love22k • written 10 weeks ago by florian.dufey0
Answer: How to specify contrasts in DESeqDataSetFromMatrix
0
gravatar for Michael Love
10 weeks ago by
Michael Love22k
United States
Michael Love22k wrote:

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 COMMENTlink written 10 weeks ago by Michael Love22k

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 REPLYlink written 10 weeks ago by florian.dufey0

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 REPLYlink written 10 weeks ago by Michael Love22k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 16.09
Traffic: 100 users visited in the last hour