Why use "robust" FPKMs? - Bioinformatics Stack Exchange most recent 30 from bioinformatics.stackexchange.com 2022-01-20T17:07:16Z https://bioinformatics.stackexchange.com/feeds/question/14661 https://creativecommons.org/licenses/by-sa/4.0/rdf https://bioinformatics.stackexchange.com/q/14661 1 Why use "robust" FPKMs? burger https://bioinformatics.stackexchange.com/users/35 2020-10-27T02:17:19Z 2020-10-27T07:23:12Z <p>Both DESeq2 and edgeR have an FPKM/RPKM function that by default uses normalized library sizes (&quot;robust&quot; 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?</p> https://bioinformatics.stackexchange.com/questions/14661/-/14662#14662 4 Answer by Bastian Schiffthaler for Why use "robust" FPKMs? Bastian Schiffthaler https://bioinformatics.stackexchange.com/users/9693 2020-10-27T07:23:12Z 2020-10-27T07:23:12Z <p>FPKM are inherently experiment specific and can not be used to compare across samples. Let's consider the following two sequencing runs. Let <span class="math-container">$E1$</span> and <span class="math-container">$E2$</span> be the true, underlying expression in two samples of genes 1-6. Let <span class="math-container">$S1$</span> and <span class="math-container">$S2$</span> be the observed expression in our sequencing.</p> <p><span class="math-container">$$\begin{matrix} Gene &amp; E1 &amp; S1 &amp; E2 &amp; S2 \\ G1 &amp; 100 &amp; 10 &amp; 100 &amp; 20 \\ G2 &amp; 100 &amp; 10 &amp; 100 &amp; 20 \\ G3 &amp; 100 &amp; 10 &amp; 100 &amp; 20 \\ G4 &amp; 100 &amp; 10 &amp; 0 &amp; 0 \\ G5 &amp; 100 &amp; 10 &amp; 0 &amp; 0 \\ G6 &amp; 100 &amp; 10 &amp; 0 &amp; 0 \\ \end{matrix}$$</span></p> <p>Our totals are 60 counts for <span class="math-container">$S1$</span> and 60 for <span class="math-container">$S2$</span>. We sequenced both libraries to the same depth, but as there are fewer genes expressed in <span class="math-container">$E2$</span>, 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 &quot;K&quot; in FPKM. Let's also forget the scaling by a million, since that's just to make nice numbers:</p> <p><span class="math-container">$$\begin{matrix} Gene &amp; E1 &amp; S1 &amp; E2 &amp; S2 \\ G1 &amp; 100 &amp; 0.167 &amp; 100 &amp; 0.333 \\ G2 &amp; 100 &amp; 0.167 &amp; 100 &amp; 0.333 \\ G3 &amp; 100 &amp; 0.167 &amp; 100 &amp; 0.333 \\ G4 &amp; 100 &amp; 0.167 &amp; 0 &amp; 0 \\ G5 &amp; 100 &amp; 0.167 &amp; 0 &amp; 0 \\ G6 &amp; 100 &amp; 0.167 &amp; 0 &amp; 0 \\ \end{matrix}$$</span></p> <p>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 <span class="math-container">$\sqrt{10 \cdot 20} = 14.14$</span> 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:</p> <p><span class="math-container">$$med([\frac{10}{14.14}, \frac{10}{14.14}, \frac{10}{14.14}) = 0.71$$</span></p> <p><span class="math-container">$$med([\frac{20}{14.14}, \frac{20}{14.14}, \frac{20}{14.14}]) = 1.41$$</span></p> <p>So where do we end up if we divide by the size factors?</p> <p><span class="math-container">$$\begin{matrix} Gene &amp; E1 &amp; S1 &amp; E2 &amp; S2 \\ G1 &amp; 100 &amp; 141 &amp; 100 &amp; 142 \\ G2 &amp; 100 &amp; 141 &amp; 100 &amp; 142 \\ G3 &amp; 100 &amp; 141 &amp; 100 &amp; 142 \\ G4 &amp; 100 &amp; 141 &amp; 0 &amp; 0 \\ G5 &amp; 100 &amp; 141 &amp; 0 &amp; 0 \\ G6 &amp; 100 &amp; 141 &amp; 0 &amp; 0 \\ \end{matrix}$$</span></p> <p>So in this simple example, size factors produce a better estimate than FPKM or TPM to compare values <em>across experiments</em>, hence the &quot;robustness&quot;. Please note that this is still not great for any statistical testing, and in general should be used with caution anywhere.</p> <p>Finally, I'll leave some more reading material concerning FPKMs and cross-sample comparisons here:</p> <ul> <li> Dillies M.A., Briefings in Bioinf. 2012</li> <li> Soneson &amp; Delorenzi, BMC Bioinf. 2013</li> <li> Lior Pachter’s lecture at CSHL (Cold Spring Harbour Laboratory) from minutes 32 on: <a href="https://www.youtube.com/watch?v=5NiFibnbE8o&amp;t=32m" rel="nofollow noreferrer">https://www.youtube.com/watch?v=5NiFibnbE8o&amp;t=32m</a></li> <li> From Answer: &quot;Over-correction&quot; in the size-factors of the DESeq2 package: <a href="https://support.bioconductor.org/p/80733/#80736" rel="nofollow noreferrer">https://support.bioconductor.org/p/80733/#80736</a></li> <li> <a href="http://www.biomedcentral.com/1471-2105/14/370" rel="nofollow noreferrer">http://www.biomedcentral.com/1471-2105/14/370</a></li> <li> <a href="https://liorpachter.wordpress.com/2014/04/30/estimating-number-of-transcripts-from-rna-seq-measurements-and-why-i-believe-in-paywall/" rel="nofollow noreferrer">https://liorpachter.wordpress.com/2014/04/30/estimating-number-of-transcripts-from-rna-seq-measurements-and-why-i-believe-in-paywall/</a></li> <li> <a href="http://rnajournal.cshlp.org/content/22/6/839" rel="nofollow noreferrer">http://rnajournal.cshlp.org/content/22/6/839</a></li> </ul>