Hi all,
Sorry I know that this question has been asked several times, but unfortunately I haven't been able to find the right answer, or didn't understand.
I'm trying to get TMM normalized counts thanks to edgeR.
I understand that I have to compute normalization factors :
dgList <- calcNormFactors(dgList, method="TMM")
which gives me a normalization factor for all samples :
head(dgList$samples)
group lib.size norm.factors
S1 1 21087314 0.9654794
S2 1 16542810 1.1589117
S3 1 18875473 0.8763291
S4 1 15865414 1.0864038
S5 1 19179795 1.0488230
S6 1 15063992 1.0707007
But at this step I don't know what to do to get a matrix of normalized TMM counts.
I know that I can get CPM normalized counts thanks to :
cpm(dgList)
But CPM and TMM are not the same, right ?
Thanks in advance for any of your input on this topic.
It depends on the step in which you are analyzing your data. In this case, you can retrieve the TMM by running the next sequence of commands:
The
cpm
function is aware whether data have been normalized using TMM. The answer from James Ashmore, in this post, contains a snippet of the source code ofcpm
function.No I think pesudo.counts is the TMM normalized read counts, if you check with cpm function in edgeR, using pseudo.counts you will get the very similar cpm value by formula. Otherwise, you could use CPM formula to infer the TMM normalized read counts.