Search
Question: DESeq2 combining factors in contrasts
0
gravatar for chang02_23
10 weeks ago by
chang02_2320
United States
chang02_2320 wrote:

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"))

 

ADD COMMENTlink modified 10 weeks ago by Michael Love15k • written 10 weeks ago by chang02_2320
1
gravatar for Michael Love
10 weeks ago by
Michael Love15k
United States
Michael Love15k wrote:

Take a look at numeric contrasts described here ?results

ADD COMMENTlink written 10 weeks ago by Michael Love15k

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 REPLYlink written 10 weeks ago by chang02_2320
1

Yes that's it.

ADD REPLYlink written 10 weeks ago by Michael Love15k
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 2.2.0
Traffic: 277 users visited in the last hour