I have four genes in four rows in a matrix. The results
function of the DESeq2 calculated the baseMean of the four row as
37.6, 2071.5, 1.0, 491.6
But if I calculate the means with rowMeans(counts(dds,normalized=TRUE)), then I get
45.2, 2679.8, 1.0, 491.6
Why is this happen?
And when I calculate the base mean per level with
baseMeanPerLvl <- sapply( levels(dds$condition), function(lvl) rowMeans( counts(dds,normalized=TRUE)[,dds$condition == lvl] ) )
which was posted on this forum by Michael Love, and I calculate the log2 fold change, then I get a different value then it is calculated by the results
function.
In ?DESeq we say:
"the replacement counts used for fitting are kept in assays(dds)[["replaceCounts"]]"
So you would use the same code as above but with this matrix instead:
Why does the
summary
show that I have no outlier?DESeq() if appropriate replaces outliers, and so in the final results table, there are no outliers which would lead to filtering of genes. They are flagged in other ways, documented in the man pages.