Specify coefficient results group on dds in DESEq2
1
2
Entering edit mode
3.9 years ago
ecg1g15 ▴ 30

I would like to plot differentially expressed genes between two specific groups (1 and 7) however as explained here http://bioconductor.org/packages/release/bioc/vignettes/DESeq2/inst/doc/DESeq2.htmlmy "group five" is been picked alphabetically as the one to compare to. How can I select the group to which you want all the others to compare to? (Group one)

resultsNames(dds)
[1] "Intercept"              "group_four_vs_five"  "group_one_vs_five"   "group_seven_vs_five" "group_six_vs_five"  
[6] "group_three_vs_five" "group_two_vs_five"

I am aware you can do selective contracts between two groups:

res17<- results(dds, contrast=c("group","one","seven"), test="Wald")
plotMA(res17, ylim=c(-2,2))

which at the moment does not exist:

coef %in% resultsNamesDDS is not TRUE

but if I'd like to do Shrinkage and plotMA and others selecting dds, I need to select the "group_one_vs_seven" contrast

So instead of having to specify the contrast every time, or I run into some limitations such as:

res17 <- lfcShrink(dds,  contrast = c('group','one','seven'), res=res, type = "apeglm")

Error in lfcShrink(dds, ... type='apeglm' shrinkage only for use with 'coef'

can I specify it initially at the dds and have it as a coefficient when running these?

res17 <- lfcShrink(dds, coef="group_one_vs_seven", type="apeglm")
DESEq2 RNA-Seq R • 3.5k views
ADD COMMENT
2
Entering edit mode
3.9 years ago
thyleal ▴ 160

You can relevel your factor variable and specify your group 1 in the first position instead of group 5. For example, group1, group2, group3, group4, group5, group6, group7. This would natively include a coefficient comparing group7_vs_group1.

ADD COMMENT
1
Entering edit mode

Couldn't OP also just use contrasts and then use ashr as the shrinkage estimator?

ADD REPLY
0
Entering edit mode

Do you mean to re-name my coldata so the group one is now group1 and the program will then take it as default control to compare against?

ADD REPLY
0
Entering edit mode

that is a possibility, but I think thyleal meant to use the relevel R function to reorder your levels. See ?relevel.

ADD REPLY
1
Entering edit mode

Yes, exactly what @Carlo said. If you need to control all levels, just use x <- factor(y, levels = c(level1, level2, level3, leveln))

ADD REPLY

Login before adding your answer.

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