TPM to log2(TPM+1)
1
2
Entering edit mode
2.8 years ago
David ▴ 30

Hi there! I´m using KIRC database from TCGA and downloaded FPKM values, then converted to TPM with this formulas:

FPKMtoTPM <- function(x) { return(exp(log(x) - log(sum(x)) + log(1e6))) }

df <- data %>% mutate_if(is.numeric, FPKMtoTPM)

Now i want to convert TPM to log2(TPM+1). How can i do this?

Thanks! David

log TCGA KIRC RNA-seq TPM • 5.9k views
ADD COMMENT
3
Entering edit mode
2.8 years ago
lily ▴ 80

Just as you defined the first function FPKMtoTPM you can define another one for the log transformation of the TPM values

logTPM <- function(x) {return(log2(x+1))}

df %>% mutate_if(is.numeric, logTPM)
ADD COMMENT
0
Entering edit mode

Perfect!! Thank you!

ADD REPLY

Login before adding your answer.

Traffic: 2699 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