rm(list = ls())
library(openxlsx)
library(tidyverse)
count_raw <- read.xlsx("../all.counts.length.deg.xlsx")
names(count_raw)
rownames(count_raw) <- count_raw$Geneid
count <- count_raw %>% filter(sum > 0) %>% select(Length,7:16)
names(count)
counts <- count_raw[,5:14]
lengths = count_raw$Length
rpkm <- function(counts, lengths) {
rate <- counts / lengths
rate / sum(counts) * 1e9
}
exprSet_rpkm=rpkm(counts,lengths)
exprSet_tpm=1e6*exprSet_rpkm/colSums(exprSet_rpkm)
my.TPM=data.frame(Gene_ID=rownames(exprSet_tpm),exprSet_tpm)
write.xlsx(my.TPM,"../TPM.xlsx")
上一篇
Workfollow for RNAseq
这是一篇付费文章
2021-09-30
下一篇
R语言之-转录组数据3维PCA图及相关性热图
2021-08-17