Entering edit mode
6.1 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.
Post the output of
resultsNames(dds)
.Cross-posted to https://support.bioconductor.org/p/69104/.
Yes, I also see this post, and I post question on this post too, but I did not get my answer.
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 :)