Dear all,
First of all, I realize there are already several topics on this forum regarding this subject, however none of these seemed to solve my question.
I am analyzing RNA-Seq data with EdgeR. I have found several DE genes and now my idea is to plot these DE genes. I would like to do so in terms of changes in logCPM, aswell as in logFC.
Furthermore, I realize these values can be found in the LRT table provided by the glmLRT function when testing for a particular coefficient or contrast matrix. However, I can not seem to reproduce these results using my count matrix (DGE list) to start with.
Here is what I have tried so far:
'y' is my DGE list with counts and fitted tagwise dispersion
'fit' is my glmFit, fitted according to my design matrix.
'SignGeneID' is the gene ID of a DE gene
The three columns I provide in my calculation code are the columns of the respective coefficients I want to test (so, in this particular case, columns 1,7 and 13 represent three control treatments of three separate patients and columns 3,9,15 represent three treatments.
For the LogCpm:
I have tried several variations on this basic calculations, however I can not reach the same conclusion as the LRT table provided me with.
For the LogFC, I can get to the same results of the LRT table through the coefficients of my glmFit in this fashion, with "TreatDPN" being the coefficient I have tested:
However, again, I can not come to the LRT table reported value starting from my raw count data. What am I overlooking here?
Any help would be greatly appreciated.
Koen.
First of all, I realize there are already several topics on this forum regarding this subject, however none of these seemed to solve my question.
I am analyzing RNA-Seq data with EdgeR. I have found several DE genes and now my idea is to plot these DE genes. I would like to do so in terms of changes in logCPM, aswell as in logFC.
Furthermore, I realize these values can be found in the LRT table provided by the glmLRT function when testing for a particular coefficient or contrast matrix. However, I can not seem to reproduce these results using my count matrix (DGE list) to start with.
Here is what I have tried so far:
'y' is my DGE list with counts and fitted tagwise dispersion
'fit' is my glmFit, fitted according to my design matrix.
'SignGeneID' is the gene ID of a DE gene
The three columns I provide in my calculation code are the columns of the respective coefficients I want to test (so, in this particular case, columns 1,7 and 13 represent three control treatments of three separate patients and columns 3,9,15 represent three treatments.
For the LogCpm:
Code:
design <- model.matrix(~ patient +Treat+Time + Treat:Time) fcRaw <- y$counts[SignGeneID,c(1,7,13)] / y$counts[SignGeneID,c(3,9,15)] log2FC <- log(fcRaw , base = 2) mean(log2FC) #not equal to LRT table FC
For the LogFC, I can get to the same results of the LRT table through the coefficients of my glmFit in this fashion, with "TreatDPN" being the coefficient I have tested:
Code:
coef <- "TreatDPN" logFC <- fit2$coefficients[, coef, drop = FALSE]/log(2)
Any help would be greatly appreciated.
Koen.