Question: compare one group to mean of two others in DESeq2 with betaprior=FALSE
0
gravatar for Chris Stubben
20 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 • 417 views
ADD COMMENTlink modified 20 months ago by Michael Love25k • written 20 months ago by Chris Stubben40
Answer: compare one group to mean of two others in DESeq2 with betaprior=FALSE
1
gravatar for Michael Love
20 months ago by
Michael Love25k
United States
Michael Love25k wrote:

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

ADD COMMENTlink written 20 months ago by Michael Love25k

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

ADD REPLYlink written 20 months ago by Chris Stubben40

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 REPLYlink written 20 months ago by Michael Love25k

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 20 months ago • written 20 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”.

ADD REPLYlink written 20 months ago by Michael Love25k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 16.09
Traffic: 118 users visited in the last hour