Hi,
I noticed that the size factor estimations when using type = "poscounts" with estimateSizeFactors() and estimateSizeFactorsForMatrix() differ slightly. From looking at the source code it appears that code to calculate the geometric means is different for the two functions. Is there particular reason for this, or does the difference in size factors comes from something else?
I'm using DESeq2 1.30.1 with R 4.0.2.
Thanks, Andreas
Oh I see now, the difference is just in scaling, which is arbitrary. So these differences you see shouldn't cause any downstream issues, and they are intentional. I just forgot the origin of this.
We have this following code in
estimateSizeFactorsForMatrix
. It is not strictly necessary (the scaling of the size factors just changes the intercept), but ensures the size factors have geometric mean of 1. In order to not have any changes with respect to the original DESeq and its size factors, the default size factor correction in DESeq2 is identical to the original 2010 paper's implementation and the geometric mean is not equal to 1.