DeSeq2 Design (A-B)-(C-D)
2
3
Entering edit mode
@jonathanallen-22040
Last seen 5.1 years ago

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.

deseq2 limma • 1.8k views
ADD COMMENT
0
Entering edit mode

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 REPLY
0
Entering edit mode

Yes, that would be the goal.

ADD REPLY
0
Entering edit mode
@mikelove
Last seen 1 day ago
United States

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

ADD COMMENT
0
Entering edit mode

is it possible to provide an example? thank you

ADD REPLY
0
Entering edit mode

Are the examples in the DESeq2 vignette not sufficient?

ADD REPLY
0
Entering edit mode

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 REPLY
1
Entering edit mode

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 REPLY
0
Entering edit mode

Thanks a lot, this seems to work well!

ADD REPLY
0
Entering edit mode

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 REPLY
0
Entering edit mode
@gordon-smyth
Last seen 57 minutes ago
WEHI, Melbourne, Australia

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 COMMENT

Login before adding your answer.

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