DESeq2 : how to make model contrast with multifactors : cond1(env1 versus env2) versus cond2(env1 versus env2) ?
1
0
Entering edit mode
@samuelquentin-14555
Last seen 6.4 years ago

Hi,

I have the following matrix :

  Status Env
Sample1 del env1
Sample2 del env2
Sample3 del env1
Sample4 del env2
Sample5 wt env1
Sample6 wt env2
Sample7 wt env1
Sample8 wt env2

 

I need to compare : del(env1 versus env2) versus wt(env1 versus env2)

>design(dds) <- ~0+Status:Env

>resultsNames(dds)

[1] "Envenv1.Statusdel" "Envenv2.Statusdel"  "Envenv1.Statuswt" "Envenv2.Statuswt"

>res <- results(dds,contrast=list(c("Envenv1.Statusdel","Envenv2.Statusdel"),c("Envenv1.Statuswt","Envenv2.Statuswt")))

>res

log2 fold change (MLE): Envenv1.Statusdel+Envenv2.Statusdel vs Envenv1.Statuswt+Envenv2.Statuswt

Wald test p-value: Envenv1.Statusdel+Envenv2.Statusdel vs Envenv1.Statuswt+Envenv2.Statuswt

DataFrame with 21272 rows and 6 columns

 

 

Please, how to make contrast model to obtain this comparaison : del(env1 versus env2) versus wt(env1 versus env2) ?

Is it possible ?

Thanks for your help and advices,

Sam

 

deseq2 makecontrasts • 725 views
ADD COMMENT
0
Entering edit mode
@mikelove
Last seen 1 day ago
United States

"I need to compare : del(env1 versus env2) versus wt(env1 versus env2)"

This can be accomplished with a single interaction term. See this section:

https://bioconductor.org/packages/release/bioc/vignettes/DESeq2/inst/doc/DESeq2.html#interactions

You actually want to add an interaction to the design, so skip the first few paragraphs suggesting to use ~ group.

You can use a design of ~Status + Env + Status:Env, and then either use a Wald test or LRT to test the interaction term. An LRT would look like:

dds <- DESeq(dds, test="LRT", reduced=~Status + Env)
res <- results(dds)

 

ADD COMMENT

Login before adding your answer.

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