lfcshrink() with no coef in resultsNames()
1
0
Entering edit mode
Assa Yeroslaviz ★ 1.5k
@assa-yeroslaviz-1597
Last seen 29 days ago
Germany

I was wondering how to run the DESeq() => results() => lfcShrink() when my resultsNames() doesn't list the comparisons I would like to do.

I have a data set with four different conditions within each of my two time-points. For my comparisons I would like to compare the four conditions within each of the timepoints against each other. As for a control condition, i have one for each of the two timepoints.

Unfortunately the resultsNames() function doesn't list all of the wanted comparisons.

my conditions are listed below

condition <- factor(rep(c("GFPMinus24","GFPPlus24","ArtMinus24", "ArtPlus24","Q97Plus24","Q97Minus24","GFPMinus40","GFPPlus40","ArtMinus40", "ArtPlus40","Q97Plus40","Q97Minus40"),each=3))

## or creating the three different vectors separately
Agg <- factor(rep(rep(c("Minus", "Plus"), each = 6), each = 3) )
group <- factor(rep(c("GFP", "Art", "Q97"), each = 12) )
TP <- factor(rep(rep(c(24, 40), each = 3), each = 6))

while the GFP samples are my (sort of) control I'm also comparing Art vs. Q97 samples. Minus and Plus state whether or not an additional compound was added, while the Art and Q97 stands for another additional aggregate.

So I'm not sure how to build my model.matrix here to include all the coefficients in resultsNames() object.

Would it make more sense (and easier to handle ) to analyze the different situations on a pair-wise basis? If not, can someone please help me to create a model.matrix for the various comparisons?

thanks Assa

lfcshrink coef DESeq2 • 2.4k views
ADD COMMENT
2
Entering edit mode
Kevin Blighe ★ 4.0k
@kevin
Last seen 28 days ago
Republic of Ireland

Via lfcShrink(), you can still perform pairwise contrasts (so, these don't have to appear in the output of resultsNames()) via ashr shrinkage, but not apeglm - see here: Extended section on shrinkage estimators.

Otherwise, if you must use coefficients from resultsNames() AND you must use apeglm shrinkage, given your experimental setup, it does seem like you would have to adopt a situation of fitting and re-fitting the model with different reference levels and orders of factors, in which case, you'd just need to re-run nbinomWaldTest() after re-levelling in each case, followed by lfcShrink() with apeglm.

Kevin

ADD COMMENT
0
Entering edit mode

Hi both,

I'm very new using DESeq2.

I have the same problem as Assa. I have a data set with 3 conditions. And the resultsNames() function only list two of the three comparasion that I need.

Conditions: Control, 18h_Polylack, 72_Polylack

so, when i run resultsNames() i get

> resultsNames(dds)
>         'Intercept''treatment_72h_Polylack_vs_18h_Polylack''treatment_Control_LB_vs_18h_Polylack'

but I need to compare treatment_Control_LB_vs_72h_Polylack using lfcShrink() with apeglm. And it doens't appear.

So, how I can run nbinomWaldTest() or what can i do?

Thanks

ADD REPLY
0
Entering edit mode

Did you read the section Kevin linked to yet?

See where it says "Although apeglm cannot be used with contrast, we note that many designs can be easily rearranged such that what was a contrast becomes its own coefficient..."

ADD REPLY

Login before adding your answer.

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