Question: DESeq2 lfcShrink with interactions
gravatar for hannepainter
8 months ago by
hannepainter0 wrote:

Dear Bioconductor Community,

I am using DESeq2 to analyse a mouse RNAseq dataset and have an identical study design to one described in in example section of ?results.I have pasted below:

## Example 3: two conditions, three genotypes

# Using interaction terms

dds <- makeExampleDESeqDataSet(n=100,m=18)
dds$genotype <- factor(rep(rep(c("I","II","III"),each=3),2))
design(dds) <- ~ genotype + condition + genotype:condition
dds <- DESeq(dds)

# the condition effect for genotype I (the main effect)
results(dds, contrast=c("condition","B","A"))

# the condition effect for genotype III.
# this is the main effect *plus* the interaction term
# (the extra condition effect in genotype III compared to genotype I).
results(dds, contrast=list( c("condition_B_vs_A","genotypeIII.conditionB") ))

I am specifically interested in looking at the condition effect for genotypes I-III and have adapted the contrasts listed above for my own dataset. However, I am struggling to perform lfcShrink() using types "apeglm" and "ashr".

Does any one have any suggestions on how to perform log fold change shrinkage on this design?

I look forward to your replies.

deseq2 interactions lfcshrink • 224 views
ADD COMMENTlink modified 8 months ago by Michael Love25k • written 8 months ago by hannepainter0
Answer: DESeq2 lfcShrink with interactions
gravatar for Michael Love
8 months ago by
Michael Love25k
United States
Michael Love25k wrote:

There is a section in the vignette where we show how to arrange various contrasts so they are a single coefficient in the design and therefore can be used with apeglm.

Note that ashr can work with a results table alone, so it works already without rearrangement.

ADD COMMENTlink written 8 months ago by Michael Love25k

Hello Michael, I think I'm having a similar issue, and although I went to look in the vignette to solve the problem, I'm still confused. Basically I have RNA-seq data for two tissues (A and C) exposed to 3 different conditions (M, C, D). I'm using design = ~ tissue + treatment + tissue:treatment and my reference level was set to condition M

[1] "Intercept"             "tissue_C_vs_A"       "treatment_D_vs_M"     
[4] "treatment_HD_vs_M"     "tissueC.treatmentD"  "tissueC.treatmentHD"

To test for the effect of D vs M in tissue C, and the effect of HD vs M in tissue C, I use:

res.C.DvsM <- results(dds, contrast=list( c("treatment_D_vs_M","tissueC.treatmentD") ), lfcThreshold=0.5)

res.C.HDvsM <- results(dds, contrast=list( c("treatment_HD_vs_M","tissueC.treatmentD") ), lfcThreshold=0.5)

How can I arrange the contrasts in order to set a single coefficient and use lfcshrink() with type="apeglm" in this case ? It was not very clear to me in the tutorial.

Thank's in advance, Pedro

ADD REPLYlink modified 5 months ago • written 5 months ago by pbarros0

You can use a design of ~tissue + tissue:treatment such that each tissue will have its own treatment coefficient, which can be used with lfcShrink and type="apeglm". This design is equivalent to what you have above, it just rearranges the terms so you don't have to add the coefficients together.

ADD REPLYlink written 5 months ago by Michael Love25k

Yes, it's also a bit more simple. Thank you for the quick reply!

ADD REPLYlink written 5 months ago by pbarros0
Please log in to add an answer.


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