Both DESeq2 and edgeR have an FPKM/RPKM function that by default uses normalized library sizes ("robust" option in DESeq2). FPKMs have their own issues, but I thought the main benefit was to have comparable units across independent experiments. If you are adding an experiment-specific normalization factor, then why even use FPKMs?
1 Answer
FPKM are inherently experiment specific and can not be used to compare across samples. Let's consider the following two sequencing runs. Let $E1$ and $E2$ be the true, underlying expression in two samples of genes 1-6. Let $S1$ and $S2$ be the observed expression in our sequencing.
$$ \begin{matrix} Gene & E1 & S1 & E2 & S2 \\ G1 & 100 & 10 & 100 & 20 \\ G2 & 100 & 10 & 100 & 20 \\ G3 & 100 & 10 & 100 & 20 \\ G4 & 100 & 10 & 0 & 0 \\ G5 & 100 & 10 & 0 & 0 \\ G6 & 100 & 10 & 0 & 0 \\ \end{matrix} $$
Our totals are 60 counts for $S1$ and 60 for $S2$. We sequenced both libraries to the same depth, but as there are fewer genes expressed in $E2$, we just naturally capture the genes that are expressed more often. For simplicity's sake, let's assume the genes all have the same length of 1, so we ignore the "K" in FPKM. Let's also forget the scaling by a million, since that's just to make nice numbers:
$$ \begin{matrix} Gene & E1 & S1 & E2 & S2 \\ G1 & 100 & 0.167 & 100 & 0.333 \\ G2 & 100 & 0.167 & 100 & 0.333 \\ G3 & 100 & 0.167 & 100 & 0.333 \\ G4 & 100 & 0.167 & 0 & 0 \\ G5 & 100 & 0.167 & 0 & 0 \\ G6 & 100 & 0.167 & 0 & 0 \\ \end{matrix} $$
Now let's calculate size factors. In DESeq2, we create a pseudo-sample which is the geometric mean of all counts of each gene, so $\sqrt{10 \cdot 20} = 14.14$ for genes 1-3 and genes 3-6 are ignored as they have a member with 0-valued counts. The size factor for each library is the median ratio for each library compared to that pseudo-sample:
$$ med([\frac{10}{14.14}, \frac{10}{14.14}, \frac{10}{14.14}) = 0.71 $$
$$ med([\frac{20}{14.14}, \frac{20}{14.14}, \frac{20}{14.14}]) = 1.41 $$
So where do we end up if we divide by the size factors?
$$ \begin{matrix} Gene & E1 & S1 & E2 & S2 \\ G1 & 100 & 141 & 100 & 142 \\ G2 & 100 & 141 & 100 & 142 \\ G3 & 100 & 141 & 100 & 142 \\ G4 & 100 & 141 & 0 & 0 \\ G5 & 100 & 141 & 0 & 0 \\ G6 & 100 & 141 & 0 & 0 \\ \end{matrix} $$
So in this simple example, size factors produce a better estimate than FPKM or TPM to compare values across experiments, hence the "robustness". Please note that this is still not great for any statistical testing, and in general should be used with caution anywhere.
Finally, I'll leave some more reading material concerning FPKMs and cross-sample comparisons here:
- [1] Dillies M.A., Briefings in Bioinf. 2012
- [2] Soneson & Delorenzi, BMC Bioinf. 2013
- [3] Lior Pachter’s lecture at CSHL (Cold Spring Harbour Laboratory) from minutes 32 on: https://www.youtube.com/watch?v=5NiFibnbE8o&t=32m
- [4] From Answer: "Over-correction" in the size-factors of the DESeq2 package: https://support.bioconductor.org/p/80733/#80736
- [5] http://www.biomedcentral.com/1471-2105/14/370
- [6] https://liorpachter.wordpress.com/2014/04/30/estimating-number-of-transcripts-from-rna-seq-measurements-and-why-i-believe-in-paywall/
- [7] http://rnajournal.cshlp.org/content/22/6/839
-
$\begingroup$ Great explanation. Those would be normalized counts and I get why they make sense. But this does not really answer the question of why mix normalization and FPKMs. $\endgroup$– burgerCommented Oct 28, 2020 at 2:03
-
$\begingroup$ Right, maybe the point I was trying to make wasn't exactly clear. The "M" in FPKM is attempting to correct for library size, but simply taking the column sums is too naive of an approach. Using size factors as a library size estimate is a more robust way to calculate that (hence the name of the option). It's not really mixed, it just replaces what's used as the library size term in the formula, since the default is inadequate in many respects. $\endgroup$ Commented Oct 28, 2020 at 13:08