From counts to TPM code verification
1
0
Entering edit mode
2.5 years ago
JACKY ▴ 160

Hey, I'm getting odd results in my analysis and wanted to verify my code is right (from raw counts to TPM). First I normalize to RPKM and only then I convert to TPM, by this code:

rpkm = apply(X = subset(counts),
               MARGIN = 2,
               FUN = function(x) {
                 10^9 * x / geneLengths / sum(as.numeric(x))
               })

TPM = apply(rpkm, 2, function(x) x / sum(as.numeric(x)) * 10^6) %>% as.data.frame()

What do you think? seems ok right ?

TPM normalization r • 597 views
ADD COMMENT
0
Entering edit mode
2.5 years ago
ATpoint 85k

Raw counts to TPM in R

I assume you know that these simple per-million scalings might underperform quite a bit, TMM-Normalization

ADD COMMENT

Login before adding your answer.

Traffic: 1850 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6