Question: DESeq2 one group vs multiple groups comparison in presence of batch effect
0
gravatar for amin.ghareyazi
12 weeks ago by
amin.ghareyazi0 wrote:

Hi

I have 5 groups and 3 levels of batches. This is my code:

rna.o=DESeqDataSetFromMatrix(data,colD,design = ~projects+Subtypes)

rna.d.pair=DESeq(rna.o,parallel = T)

this is my resultsNames:

resultsNames(rna.d.pair) [1] "Intercept" "projectsPACA.CAvsPACA.AU" "projectsPAEN.AUvsPACA.AU" [4] "Subtypes2vs1" "Subtypes3vs1" "Subtypes4vs1"
[7] "Subtypes
5vs1"

For the next step, how should I use contrasts for one vs multiple groups for example 2 VS 1,3,4,5?

deseq2 batch comparison • 151 views
ADD COMMENTlink modified 12 weeks ago by Michael Love26k • written 12 weeks ago by amin.ghareyazi0
Answer: DESeq2 one group vs multiple groups comparison in presence of batch effect
2
gravatar for Michael Love
12 weeks ago by
Michael Love26k
United States
Michael Love26k wrote:

If you use a design of ~0 + condition + batch, then you will have a coefficient for each level of condition. This is one of the cases where it helps to not have condition at the end of the design (for convenience, we often recommend to put condition at the end, but not in this case).

Then you can do:

results(dds, 
        contrast=list(c("conditionA"), 
                      c("conditionB","conditionC","conditionD","conditionE")),
        listValues=c(1, -1/4))

if you wanted to compare A to the average of B-E.

ADD COMMENTlink written 12 weeks ago by Michael Love26k

So I just need to switch conditions in this list to get my desired comparison? should I change reference level for comparisons other than condition 1?

ADD REPLYlink written 12 weeks ago by amin.ghareyazi0

If you use the code I suggested, it doesn't matter what the reference level is, all levels will be present in the resultsNames(dds).

ADD REPLYlink written 12 weeks ago by Michael Love26k

thanks Michael. It helped a lot...

ADD REPLYlink written 12 weeks ago by amin.ghareyazi0
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: 301 users visited in the last hour