Small differences in limma with and without contrast matrix
1
0
Entering edit mode
Jake ▴ 90
@jake-7236
Last seen 20 months ago
United States

Hi,

I am doing pairwise RNA-Seq comparisons between 3 groups in limma. Looking at the manual it seems like this is best done with the contrasts. However, I wanted to compare the results using contrasts with the results doing just group 1 vs group 2 in limma. I've noticed some differences in the differential expression results. I understand the P values might be different due to slightly different variance estimates due to the counts from group 3. However, I noticed that some of the fold changes are slightly different and I don't understand why that would be.

Thanks

   > design
   Group1 Group2 Group3
1    0    1   0
2    0    0   1
3    0    0   1
4    0    1   0
5    1    0   0
6    1    0   0
7    0    1   0
8    0    1   0
9    0    0   1
10   0    0   1

v <- voom(count_mat_filtered, design, plot = T)

contrast.matrix <- makeContrasts(
  Group1 - Group2,
  Group1 - Group3,
  Group2 - Group3,
  levels = design)
fit <- lmFit(v, design)
fit2 <- contrasts.fit(fit, contrast.matrix)
fit2 <- eBayes(fit2)
Group1_Group2 <- topTable(fit2, coef = 1, number = nrow(count_mat_filtered))



> design2
  Group2 Group1
1     1    0
2     1    0
3     0    1
4     0    1
5     1    0
6     1    0

v2 <- voom(count_mat_filtered2, design2, plot = T)

fit3 <- lmFit(v2, design2)
fit3 <- eBayes(fit3)
topTable(fit3, coef = ncol(design2))
Group1_Group2 <- topTable(fit3, number = nrow(count_mat_filtered2))
limma • 658 views
ADD COMMENT
2
Entering edit mode
Aaron Lun ★ 28k
@alun
Last seen 4 hours ago
The city by the bay

The linear model fit (and thus the log-fold change) depends on the weights. The weights will change when you apply voom on a subset of the data. This is because the weights are dependent on the variance estimates, which are affected by the samples in group 3.

ADD COMMENT

Login before adding your answer.

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