#### The support.bioconductor.org editor has been updated to markdown! Please see more info at: Tutorial: Updated Support Site Editor

Question: compare one group to mean of two others in DESeq2 with betaprior=FALSE
0
12 months ago by
Salt Lake City, Utah
Chris Stubben40 wrote:

Is it possible to compare one group with the mean of two others if betaPrior=FALSE?   In previous versions of DESeq2, I could group C vs A+B using a list below, but I'm not sure how to work with the new resultsNames output like trt_B_vs_A.

dds <- makeExampleDESeqDataSet(n=1000, m=18)
dds\$trt <- factor(rep(c("A","B","C"),each=6))
design(dds) <- ~ trt
dds <- DESeq(dds, betaPrior = TRUE)
resultsNames(dds)
[1] "Intercept" "trtA"      "trtB"      "trtC"

res <- results(dds, contrast = list("trtC", c("trtA","trtB")), listValues=c(1, -1/2))

dds <- DESeq(dds)
resultsNames(dds)
[1] "Intercept"  "trt_B_vs_A" "trt_C_vs_A"

deseq2 • 283 views
modified 12 months ago by Michael Love21k • written 12 months ago by Chris Stubben40
Answer: compare one group to mean of two others in DESeq2 with betaprior=FALSE
1
12 months ago by
Michael Love21k
United States
Michael Love21k wrote:

You can get the same comparison with ~0 + trt.

Thanks, I remember reading that you should not use ~0 + trt, but that must be when betaPrior=TRUE

Yeah, DESeq2 will actually stop you from using ~0 + trt when betaPrior=TRUE

 Error in designAndArgChecker(object, betaPrior) :
betaPrior=TRUE can only be used if the design has an intercept.
if specifying + 0 in the design formula, use betaPrior=FALSE

Is there any way to shrink fold changes if you use  ~0 + trt?  With betaPrior = FALSE, I get the same error at a later step running lfcShrink(dds, contrast= c("trt", "C", "A"))

ADD REPLYlink modified 12 months ago • written 12 months ago by Chris Stubben40

The easiest way to get this would be to use betaPrior=TRUE. This will always be supported. Or you can build the results table and then pass res to lfcShrink with type=“ashr”.