Hello,
I am using edgeR to perform a DE analysis between two groups and I'm trying to understand how the logFC is obtained.
I created a simple GL model without the intercept:
design <- model.matrix(~0+group)
And then performed a glmQLFTest with (1,-1) contrast. Then, I extracted the top genes via topTags, applying a BH correction and sorting by p_value. I selected the first gene to look into the results.
logFC logCPM F PValue
geneX 11.31014 4.756812 1770.353 0
Then I looked at the coefficients for this gene (in the DGELRT object obtained by performing the test)
groupX groupY
-9.774554 -17.614144
If I understand correctly, according to this model the coefficients would be the average, expression values for this gene and for each group. So, I would expect the difference between groupY and groupX to be the fold change (following how I modeled the contrast). But I figured that the reasoning is surely more involved; can someone explain it to me or point to a reliable source? I tried looking into the edgeR documentation but I can't seem to find an answer to this.
Thanks a lot, this was very helpful. I'll keep that in mind.