compare one group to mean of two others in DESeq2 with betaprior=FALSE
1
0
Entering edit mode
@chris-stubben-12524
Last seen 4.1 years ago
Salt Lake City, Utah

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 • 1.2k views
ADD COMMENT
1
Entering edit mode
@mikelove
Last seen 15 hours ago
United States

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

ADD COMMENT
0
Entering edit mode

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

ADD REPLY
0
Entering edit mode

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
ADD REPLY
0
Entering edit mode

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 REPLY
0
Entering edit mode

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”.

ADD REPLY

Login before adding your answer.

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