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")
Couldn't OP also just use
contrasts
and then useashr
as the shrinkage estimator?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?
that is a possibility, but I think thyleal meant to use the
relevel
R function to reorder your levels. See?relevel
.Yes, exactly what @Carlo said. If you need to control all levels, just use
x <- factor(y, levels = c(level1, level2, level3, leveln))