lfcshrink() with no coef in resultsNames()
Entering edit mode
Assa Yeroslaviz ♦ 1.5k
Last seen 16 hours ago
Munich, 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 • 40 views
Entering edit mode
Last seen 5 hours 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.



Login before adding your answer.

Similar Posts
Loading Similar Posts
Help About
Access RSS

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.3