Answers.Body: <ol>
  <li><code>rlog(normalized counts)</code> is going to be more robust than <code>log2(TPM)</code>, so use it instead.</li>
  <li>Do it afterward, keeping the low counts can be helpful for library-size normalization.</li>
  <li>This is very much more of an art than a science, though have a look at the <code>kOverA()</code> function from the <code>genefilter</code> package. That will give you a bit more fine-grained control on filtering.</li>
  <li>You'd be better off using something like zFPKMs if you want to filter by "expressed or not", since there's no really great definition of that.</li>
  </ol>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-08-16T10:06:24.433Z
Answers.Text: Thanks Devon! Your answers clear things up for me.  May I also ask at what point is transformed TPM/FPKM/other metrics of same sort be useful? I think this is also something bothering some wet lab biologists who just start doing bioinformatics.
Answers.UserDisplayName: Kent
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-08-16T10:15:52.253Z
Answers.Text: FPKM/RPKM should essentially never be used. TPMs would work fine here as well, but more so if you make them from normalized counts. The general thing with these transformed metrics is that they try to take gene/transcript length into account. That's fine for some things but it'll change how you might interpret clustering results (at least if you don't scale things).
Answers.UserDisplayName: Devon Ryan
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-08-15T20:24:38.423Z
Answers.LastActivityDate: 2018-08-15T20:24:38.423Z
Answers.UserDisplayName: Devon Ryan
Body: <p>I have some RNA-Seq data from leukaemia patients. I want to do unsupervised clustering on them with some other published leukaemia RNA-Seq data and see how they cluster. There are a few problems I encountered while doing this.</p>
  
  <ol>
  <li><p>I read mix messages of whether using log2(TPM) or rlog(counts) (e.g. Deseq2 rlog or limma voom transformation) for clustering. Which one should I choose?</p></li>
  <li><p>If I am filtering out genes with low counts, should I do it prior normalisation to library size or after?</p></li>
  <li><p>I tried using filterByExpr from edgeR for filtering but it removed many of the genes that are only expressed by subtypes with small sample number. If I am to filter the counts "manually", is there a recommendation of how the threshold should be set?</p></li>
  <li><p>If I should use log2(TPM) for unsupervised clustering, can I treat low TPM (e.g. &lt;2) as 0? As this <a href="https://link.springer.com/article/10.1007%2Fs12064-013-0178-3" rel="nofollow noreferrer">paper</a> suggested TPM &lt; 2 basically means no expression, is it alright to treat them as 0?</p></li>
  </ol>
  
Tags: <rna-seq><clustering>
Title: RNA-Seq: clustering/treatment of genes with low expression
ThreadText: # RNA-Seq: clustering/treatment of genes with low expression
  
  (Asked by: username_0 on 2018-08-15)
  
  I have some RNA-Seq data from leukaemia patients. I want to do unsupervised clustering on them with some other published leukaemia RNA-Seq data and see how they cluster. There are a few problems I encountered while doing this.
  
  1. I read mix messages of whether using log2(TPM) or rlog(counts) (e.g. Deseq2 rlog or limma voom transformation) for clustering. Which one should I choose?
  2. If I am filtering out genes with low counts, should I do it prior normalisation to library size or after?
  3. I tried using filterByExpr from edgeR for filtering but it removed many of the genes that are only expressed by subtypes with small sample number. If I am to filter the counts "manually", is there a recommendation of how the threshold should be set?
  4. If I should use log2(TPM) for unsupervised clustering, can I treat low TPM (e.g. <2) as 0? As this [paper](https://link.springer.com/article/10.1007%2Fs12064-013-0178-3) suggested TPM < 2 basically means no expression, is it alright to treat them as 0?
  
  **Tags:** rna-seq, clustering
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2018-08-15. Score: 3 | Accepted answer
  
  1. `rlog(normalized counts)` is going to be more robust than `log2(TPM)`, so use it instead.
  2. Do it afterward, keeping the low counts can be helpful for library-size normalization.
  3. This is very much more of an art than a science, though have a look at the `kOverA()` function from the `genefilter` package. That will give you a bit more fine-grained control on filtering.
  4. You'd be better off using something like zFPKMs if you want to filter by "expressed or not", since there's no really great definition of that.
  
  > **Comments:**
  > **username_0**: Thanks username_1! Your answers clear things up for me.  May I also ask at what point is transformed TPM/FPKM/other metrics of same sort be useful? I think this is also something bothering some wet lab biologists who just start doing bioinformatics.  
  > **username_1**: FPKM/RPKM should essentially never be used. TPMs would work fine here as well, but more so if you make them from normalized counts. The general thing with these transformed metrics is that they try to take gene/transcript length into account. That's fine for some things but it'll change how you might interpret clustering results (at least if you don't scale things).  
  
  ---
  
  