<p>Is it okay to use CPM normalization (with/without log transform) after using TMM normalization? Why do we <a href="https://2-bitbio.com/2017/10/clustering-rnaseq-data-using-k-means.html" rel="nofollow noreferrer">need both</a>?</p>
<pre><code> library(edgeR)
 library(SummarizedExperiment)
 load(url(&quot;http://duffel.rail.bio/recount/SRP049355/rse_gene.Rdata&quot;))
  counts &lt;- assays(rse_gene)$counts
  y &lt;- as.matrix((counts))
 y &lt;- DGEList(counts = y, group=c(1,2,3,4,5,6,7,8,9,10))
  y &lt;- calcNormFactors(y)
 z &lt;- cpm(y, normalized.lib.size=TRUE)
scaledata &lt;- t(scale(t(z))) # Centers and scales data.
hc &lt;- hclust(as.dist(1-cor(scaledata, method=&quot;spearman&quot;)), method=&quot;complete&quot;) # Clusters columns by Spearman correlation.
 TreeC = as.dendrogram(hc, method=&quot;average&quot;)
 plot(TreeC,
 main = &quot;Sample Clustering&quot;,
 ylab = &quot;Height&quot;)
</code></pre>

<r><rna>
about the cpm normalization after using normalization factor
# about the cpm normalization after using normalization factor

(Asked by: username_0 on 2020-06-03)

Is it okay to use CPM normalization (with/without log transform) after using TMM normalization? Why do we need both?
 library(edgeR)
 library(SummarizedExperiment)
 load(url("http://duffel.rail.bio/recount/SRP049355/rse_gene.Rdata"))
  counts <- assays(rse_gene)$counts
  y <- as.matrix((counts))
 y <- DGEList(counts = y, group=c(1,2,3,4,5,6,7,8,9,10))
  y <- calcNormFactors(y)
 z <- cpm(y, normalized.lib.size=TRUE)
scaledata <- t(scale(t(z))) # Centers and scales data.
hc <- hclust(as.dist(1-cor(scaledata, method="spearman")), method="complete") # Clusters columns by Spearman correlation.
 TreeC = as.dendrogram(hc, method="average")
 plot(TreeC,
 main = "Sample Clustering",
 ylab = "Height")

**Tags:** r, rna

---

## 0 answers

