counts转fpkm,fpkm转tpm

不知道为什么counts转fpkm的结果和tcga的结果对不上,可能里面的colSums用的是reads mapped to all protein-coding regions?没有进行进一步的尝试。fpkm转tpm的结果和tcga的结果是一致的。

1
2
3
4
5
6
7
8
f_counts2fpkm <- function(counts, gene_lengths){ # 确保记录已经对齐
lc_rpk <- (counts/gene_lengths) * 10^3
lc_fpkm <- (lc_rpk/colSums(counts)) * 10^6
lc_fpkm
}
f_fpkmToTpm <- function(l_e){
apply(l_e,2,function(fpkm){exp(log(fpkm) - log(sum(fpkm)) + log(1e6))})
}

counts转fpkm,fpkm转tpm
https://occdn.limour.top/2120.html
Author
Limour
Posted on
July 19, 2022
Licensed under