This is a test version of Biostars. For the public version, visit https://www.biostars.org.
edgeR design matrix gives different results for the same data?

I have 4 different groups in the experiment: CTG0061.Group1, CTG0061.Group2, CTG0061.Group3 and CTG0061.Group4, each has 5 samples. The scientist wanted to ask questions about individual group comparisons, e.g. CTG0061.Group2 vs. CTG0061.Group1, and also a combination of comparisons, e.g., CTG0061.Group4 vs. (CTG0061.Group1, CTG0061.Group2 and CTG0061.Group3).

My original thought is to construct one design matrix and use the makeContrast function to make different comparisons. So I have:

my.contrasts <- makeContrasts(
    ## CTG0061
    CTG0061.G2vsG1 = CTG0061.Group2 - CTG0061.Group1,
    CTG0061.G3vsG1 = CTG0061.Group3 - CTG0061.Group1,
    CTG0061.G4vsG123 = CTG0061.Group4 - (CTG0061.Group1+CTG0061.Group2+CTG0061.Group3),
, level = design)

d <- DGEList(counts=counts)
d <- calcNormFactors(d)
d <- estimateGLMCommonDisp(d, design)
d <- estimateGLMTagwiseDisp(d, design)
fit <- glmFit(d, design)
lrt <- glmLRT(fit, contrast=contrast) ## <- here I loop through the colnames of (my.contrasts)

However, the above CTG0061.G4vsG123 gives me really weird result .. most of the genes have super low FDR and log2FC at ~45 for the top DE gene. The other comparisons with only one simple pair seems reasonable though.

So I made another design matrix that group CTG0061.Group1, CTG0061.Group2, CTG0061.Group3 to CTG0061.GroupA, and CTG0061.Group4 -> CTG0061.GroupB, then re-run the analysis again. This time the contrast becomes simply: CTG0061.GroupB - CTG0061.GroupA. And the result changed dramatically. It looks more reasonable and the top DE's log2FC is about 7.

Did I do anything wrong in the original make.contrast? What resulted in this dramatic difference?

Any suggestion is appreciated. Thanks in advance!

design-matrix edger

So I changed the design matrix to :

my.contrasts <- makeContrasts(
    ## CTG0061
    CTG0061.G2vsG1 = CTG0061.Group2 - CTG0061.Group1,
    CTG0061.G3vsG1 = CTG0061.Group3 - CTG0061.Group1,
    CTG0061.G4vsG123 = CTG0061.Group4 - (CTG0061.Group1+CTG0061.Group2+CTG0061.Group3)/3, #note the /3 at the end
, level = design)

And now the result looks more similar to my attempt to compare the aggregated group Group4 vs. GroupA, which is basically group 1,2,3 together.

So I guess I need to take average of the group when doing this kind of comparison? Does the numbers in contrast need to be added up to zero?

0 answers

No answers yet.

Log in to answer this question.