Compare expression of one group to the mean of others using DESeq2
1
0
Entering edit mode
6.2 years ago
afli ▴ 190

Hi, I want to compare one condition to the mean of the other two conditions, sample data are as follows(the sample data is borrowed from someone else):

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)
[1] "Intercept"        "condition_b_vs_a" "condition_c_vs_a"

I use the command line that Michael suggested at https://support.bioconductor.org/p/69104/,

res<-results(dds, contrast=c(0,1,-0.5,-0.5))

But I get an error:

Error in checkContrast(contrast, resNames) :
numeric contrast vector should have one element for every element of 'resultsNames(object)'

I search much on google, and do not find any useful information yet. Could someone tell what is the right way to compare one condition to the mean of the other two condition using DESeq2? Thank you very much!

Cheers,

Aifu.

DESeq2 • 3.2k views
ADD COMMENT
0
Entering edit mode

Post the output of resultsNames(dds).

ADD REPLY
0
Entering edit mode
ADD REPLY
0
Entering edit mode

Yes, I also see this post, and I post question on this post too, but I did not get my answer.

ADD REPLY
0
Entering edit mode

Cross-post means that an OP (you) asked the exact same question in two different communities, which is generally not recommended as it might offend people in either community. My intend was to inform others, not you. Still, not a big deal, don't worry :)

ADD REPLY
1
Entering edit mode
6.2 years ago
afli ▴ 190

I get some progression, and I'll read the original DESeq2 paper for more information.

dds <- DESeq(dds, betaPrior = TRUE)
resultsNames(dds)
[1] "Intercept"  "conditiona" "conditionb" "conditionc"
ADD COMMENT

Login before adding your answer.

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