Elizabeth Mist
Elizabeth Mist

Reputation: 33

EdgeR DGE Matrix: Help Understanding Comparison / Contrast

I'm doing some differential expression analysis between two conditions (= Timepoint) and I'm including biological covariates in my design. I want to analyse further if differences between Timepoint are different in Men and Women.

So this is my design matrix:

Timepoint <- factor(meta.data_sub$Group3)
Age <- as.numeric(meta.data_sub$Age)
Sex <- factor(meta.data_sub$Sex2)
Ethnicity <- factor(meta.data_sub$Ethnicity)

design <- model.matrix(~Age +Ethnicity +Sex +Timepoint:Sex) 

head(design)

(sorry can't figure out how to fix the formating of the dataframes)


A matrix: 6 × 17 of type dbl    
(Intercept) Age EthnicityB  EthnicityC  EthnicityD  EthnicityE  EthnicityF  EthnicityH  EthnicityJ  EthnicityK  EthnicityL  EthnicityM  EthnicityN  EthnicityR  Sex2    Sex1:Timepoint1 Sex2:Timepoint1
1   1   50.5    0   0   0   0   0   0   0   0   0   0   0   0   1   0   0
2   1   39.7    0   0   0   0   0   0   0   0   0   0   1   0   1   0   0
3   1   33.5    0   0   1   0   0   0   0   0   0   0   0   0   1   0   0
4   1   51.7    0   1   0   0   0   0   0   0   0   0   0   0   1   0   0
5   1   30.5    0   0   0   0   0   0   0   0   0   0   0   0   1   0   0
6   1   37.7    0   0   0   0   0   0   0   0   0   0   0   0   0   0   00  0   0   0   0   0

And then I do

dge <- estimateDisp(dge, design = design)
fit <- glmQLFit(dge, design = design,dispersion=dge$common.dispersion, coef=16:17)
qlf <- glmQLFTest(fit, coef=16:17)

The output looks like

tt <- topTags(qlf, n = Inf) 
head(tt)

      logFC.Sex1.Timepoint1 logFC.Sex2.Timepoint1   logCPM    F PValue  FDR

APOA1   0.35602471          0.3927851         15.964477 70.22736    5.186215e-23    1.747755e-20

Does logFC.Sex1.Timepoint1 mean fold change in sex 1 between timepoint 0 and 1? And is the PValue / FDR comparing sexes or timepoints?

Thanks!

Upvotes: 1

Views: 46

Answers (0)

Related Questions