EdgeR with Paired Sample Replicates
1
1
Entering edit mode
2.6 years ago
kmyers2 ▴ 40

I am running EdgeR to find differentially expressed genes and I want to make sure I am constructing the model and contrast correctly.

I have 9 total samples, 3 experimental samples (ExpA, ExpB, ExpC) and 6 controls samples (CtrlA1, CtrlA2, CtrlB1, CtrlB2, CtrlC1, CtrlC2). The samples with the same letter (ExpA, CtrlA1, CtrlA2 for example) were collected on the same day - thus the collections occurred on three different days. I need to find the genes that are differentially expressed between the experimental samples and the paired control samples but want to take into account the paired nature of the samples.

I have set up a group in EdgeR to use Exp/Ctrl and Day as grouping factors:

group <- factor(paste(targets$Experiment, targets$Day, sep = "."))


That yields six levels: Ctrl.A, Ctrl.B, Ctrl.C, Exp.A, Exp.B, Exp.C

I then use this to construct the design:

design <- model.matrix(~0+group)


That yields a design matrix that I use to perform the estimations and fit. Then to set up the differential comparison test, I use the following contrast:

my.contrasts <- makeContrasts(DipvsCtrl = (Exp.A-Ctrl.A)+(Exp.B-Ctrl.B)+(Exp.C-Ctrl.C), levels = design)


Quickly comparing the counts data seems to suggest this is the correct contrast to make, but I just wanted to see if anyone else could notice something I missed. Did I set up the contrast correctly to make the comparison I want to make?

Thanks!

edgeR R RNA-Seq • 1.5k views
1
Entering edit mode
2.6 years ago
Benn 8.1k

If you want to include "paired" in your design, you should not make the group factor, but include both experiment and day in the design.

experiment <- factor(targets$Experiment) day <- factor(targets$Day)
design <- model.matrix(~0+experiment+day)

# Depending on the column names of your design:
my.contrasts <- makeContrasts(ExpvsCtrl = Exp - Ctrl, levels = design)

0
Entering edit mode

Thanks! So if I understand, this will maintain the days in the comparison right? It is best to compare samples collected on the same day (ExpA vs CtrlA). I just want to make sure I'm understanding it correctly.

1
Entering edit mode

Yes you are testing "exp" vs "ctrl" with this design, but with the "day" effect taken into account (think of it as a similar approach to a paired t-test).

0
Entering edit mode

Thank you very much! That makes sense to me and I really appreciate the help!

Traffic: 2223 users visited in the last hour
FAQ
API
Stats

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