Question: DeSeq2 Design (A-B)-(C-D)
1
6 weeks ago by
Jonathan.allen10 wrote:

Hi everyone,

I'm hoping for some help modeling an RNA-Seq analysis in DeSeq2.

I have 4 populations (A,B,C,D) , and initially I used the following to compare them each to one another:

dds <- DESeqDataSetFromMatrix(countData = countData, colData = colData, design = ~ Experiment_Groups)

dds <- DESeq(dds, betaPrior = TRUE)

results(dds, contrast=c("Experiment_Groups","B","A"))

The above worked well finding AvsB, AvsC, AvsD, BvsC, BvsD, CvsD.

Now I'm interested in (A-B)-(C-D), is this possible in DeSeq2?

Would limma or ballgown be an alternative?

Thanks for your time.

limma deseq2 • 178 views
modified 6 weeks ago by Gordon Smyth39k • written 6 weeks ago by Jonathan.allen10

by writing (A-B)-(C-D) are you looking to test the differences between the commonly expressed genes of A/B Vs the ones from C/D?

ADD REPLYlink modified 6 weeks ago • written 6 weeks ago by theodore.georgomanolis0

Yes, that would be the goal.

Answer: DeSeq2 Design (A-B)-(C-D)
0
6 weeks ago by
Michael Love26k
United States
Michael Love26k wrote:

This can be modeled with an interaction. See the interaction section in the DESeq2 vignette.

is it possible to provide an example? thank you

Are the examples in the DESeq2 vignette not sufficient?

ADD REPLYlink written 6 weeks ago by James W. MacDonald51k

An Example would be helpful. I'm still having trouble modeling this.

My Data looks like so:

Name | Experiment_Groups

Sample_1 | A

Sample_2 | A

Sample_3 | A

Sample_4 | B

Sample_5 | B

Sample_6 | B

Sample_7 | C

Sample_8 | C

Sample_9 | C

Sample_10 | D

Sample_11 | D

Sample_12 | D

Would I make a second grouping with AB together and CD together? The examples I see of modeling with an interaction usually involve a factor that crosses across all groups, like a control and test groupings.

ADD REPLYlink modified 21 days ago • written 6 weeks ago by Jonathan.allen10
1

It's not a classical interaction, which is like you say, a cross between two different groups (like treated vs control for cells A and B). But algebraically (A - B) - (C - D) will give you the genes where the differences between A and B are different from the differences between C and D, which it seems is what you are after?

As Gorden says below, doing this test in limma or edgeR is routine, because you have to directly specify the design matrix and contrast. I think you can also do it using DESeq2, by doing something like

design <- model.matrix(~ 0 + gl(4,3))
colnames(design) <- LETTERS[1:4]
design(dds) <- design
dds <- DESeq(dds)
results(dds, contrast = c(1,-1,-1,1))

ADD REPLYlink written 6 weeks ago by James W. MacDonald51k

Thanks a lot, this seems to work well!

If I understand your aim correctly, you want something like

pheno.ext = data.frame( AB.vs.CD = as.numeric(Experiment_Groups %in% c(A, B)),
AC.vs.BD = as.numeric(Experiment_Groups %in% c(A, C)))


Then run DESeq2 or limma on your data, the pheno.ext data frame as colData (you may need to assign rownames to make DESeq2 happy) and with design ~AB.vs.CD * AC.vs.BD. Then take the results for the coefficient AB.vs.CD:AC.vs.BD. I hope I didn't mess up in this, definitely check that the results make sense (significant genes with a positive coefficient should behave as you expect, higher difference of A vs. B than C vs. D).

ADD REPLYlink modified 6 weeks ago • written 6 weeks ago by Peter Langfelder2.3k
Answer: DeSeq2 Design (A-B)-(C-D)
0
6 weeks ago by
Gordon Smyth39k
Walter and Eliza Hall Institute of Medical Research, Melbourne, Australia
Gordon Smyth39k wrote:

Well, yes, testing (A-B)-(C-D) would be routine for limma or edgeR, but DESeq2 can presumably do it as well (see Michael Love's answer).

ADD COMMENTlink modified 6 weeks ago • written 6 weeks ago by Gordon Smyth39k