Chapter 9 Normalization of counts

Let’s start by loading the necessary packages:

library(edgeR)
library(SummarizedExperiment)

Next, let’s set the working directory and separate the raw counts:

setwd("~/PreProcSEQ-main/7-normalizationCounts/tmm/")
load("../../6-annotationTranscripts/matrix_gse_salmon_tximeta_noted.RData")

gexp.counts.brut <- assay(gse)

Finally, let’s normalize the counts in TMM:

dge <- DGEList(counts=gexp.counts.brut)
dge <- calcNormFactors(dge)
gexp.TMM <- cpm(dge)

gse.TMM <- gse
gse.TMM@assays@data$abundance <- gexp.TMM
save(gse.TMM, file = "gse_tmm.RData")