I have a DGEGLM object from edgeR called fit2
fit2 <- glmFit(counts(Data), design, disp2$tagwise.dispersion,offset=-offst(dataOffset))
I want the logFC values so
logFC <- fit2$coefficients[geneA,2] # first column intercept, second column is my comparison fit2$fitted.values[geneA,] # is the vector with the fitted values TableWithFC <- aggregate(log2(fit2$fitted.values[geneA,]) ~ (condition),FUN= mean) logFC2 <- TableWithFC[2,2]-TableWithFC [1,2]
logFC is NOT equal to logFC2
If logFC is the right one (is the same I get if I continue the pipeline and I do glmLRT and topTags), how I can obtain the expression values of geneA for each sample in order to obtain a boxplot like this:
boxplot(log2(fit2$fitted.values["geneA",]) ~ (fit2$design[,2]))
but with the values giving the logFC of the fit2$coefficients[geneA,2] ?
In other words the boxplot with the fitted.values is not representative of the result with coefficients.
I want a boxplot representative of the logFC obtained with coefficients.