DESeq2 combining factors in contrasts
1
0
Entering edit mode
chang02_23 ▴ 30
@chang02_23-7435
Last seen 6.0 years ago
United States

I have a data set comprised of 3 conditions - a, b, and c. I want to compare DEG between group a and average of (group b + c), also just DEG between group a in b. In Limma, I would construct a design matrix like the following

design = cbind(a=c(1,1,1,0,0,0,0,0,0),
               b=c(0,0,0,1,1,1,0,0,0),
               c=c(0,0,0,0,0,0,1,1,1))
cont.matrix = makeContrasts(a-(b+c)/2, a-b, levels=design)

I'm trying to replicate my analysis with DESeq2. Here is some test data, and code to show I can extract DEG results between group a and b, b.

However, How do I get DEG between group a and average of (group b + c) ?

test_data=sapply(rep(20,9), function(x) { sample(seq(1:100), x) })
col_data = data.frame(condition=c("a","a","a","b","b","b","c","c","c"))
dds = DESeqDataSetFromMatrix(countData = test_data,
                       colData = col_data,
                       design = ~ condition)
dds <- DESeq(dds)
resultsNames(dds)
results(dds, contrast=c("condition","a","b"))

 

deseq2 • 2.1k views
ADD COMMENT
1
Entering edit mode
@mikelove
Last seen 1 day ago
United States

Take a look at numeric contrasts described here ?results

ADD COMMENT
0
Entering edit mode

Is this the correct way for comparing group a and average of (group b + c)

resultsNames(dds)
[1] "Intercept"  "conditiona" "conditionb" "conditionc"
results(dds, contrast=c(0,1,-0.5,-0.5))
ADD REPLY
2
Entering edit mode

Yes that's it.

ADD REPLY

Login before adding your answer.

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