TMM normalization with DESeq2
1
2
Entering edit mode
18 days ago
marco.barr ▴ 60

Hello everyone,

I wanted to know how to computationally use TMM normalization (typically used with edgeR) with DESeq2. I've read that it's possible to do so. In my analyses, I've always used tximport initially, DESeq (ddTxi), and then worked on the results of DEG. To use TMM normalization, what do I need to convert? Would an approach similar to this work:

N <- colSums(geneCount) (vector of library sizes)
tmm.counts <- Ntmm/exp(mean(log(Ntmm))).


But in my case, since I don't use edgeR, what would geneCount be? Perhaps txi$counts? Thank you very much for any advice and help. RNA-seq DESeq2 • 208 views ADD COMMENT 0 Entering edit mode 18 days ago ATpoint 81k Why so complicated? The normalizations of edgeR and DESeq2, while different in how they tackle the problem, perform almost identically for the end user. Just use DESeq2 and go along. DESeq2 does not calculate the Trimmed Mean of the M-values (TMM). If you already have what in edgeR is called "norm.factor" and you want to convert it into a DESeq2 size factor then you can use this code, assuming your norm.factor is nf: # libsize is the column sum of the raw counts ls <- colSums(raw_counts) # size factor combines libsize with normalization factor into a single value sf <- nf * ls / 1000000 # stabilize size factors to have geometric mean of 1 sf <- sf / exp(mean(log(sf))) sizeFactors(dds) <- sf  But again, why bother? ADD COMMENT 0 Entering edit mode Thanks for your response, but What I'm missing is precisely the norm.factor. Do I need to execute this to obtain the norm.factor? TMM <- calcNormFactors(txi$counts, method="TMM")


and then proceed with what you confirmed with what I was thinking?

1
Entering edit mode

Yes, or the newer version of the function called normLibSizes().