count/rpkm/tpm之间转换代码

作者: 一只烟酒僧 | 来源:发表于2021-09-12 23:58 被阅读0次

    标准化方法原理:https://hbctraining.github.io/DGE_workshop/lessons/02_DGE_count_normalization.html
    参考链接:https://zhuanlan.zhihu.com/p/150300801

    countToTpm <- function(counts, effLen)
    {
        rate <- log(counts) - log(effLen)
        denom <- log(sum(exp(rate)))
        exp(rate - denom + log(1e6))
    }
     
    countToFpkm <- function(counts, effLen)
    {
        N <- sum(counts)
        exp( log(counts) + log(1e9) - log(effLen) - log(N) )
    }
     
    fpkmToTpm <- function(fpkm)
    {
        exp(log(fpkm) - log(sum(fpkm)) + log(1e6))
    }
    

    相关文章

      网友评论

        本文标题:count/rpkm/tpm之间转换代码

        本文链接:https://www.haomeiwen.com/subject/xnsxgltx.html