Entering edit mode
5.5 years ago
firestar
★
1.6k
I use raw counts for DGE in DESeq2, edgeR etc. And I use VST for PCA and clustering.
Now, I am curious about TPM. What are the applications of a TPM normalised count table? What can it be used for? What are the drawbacks of TPM normalised counts?
I hope my TPM calculation is correct. Here is what I use.
#' @title Compute TPM from a read count matrix
#' @param counts A numeric data.frame of read counts with samples (columns) and genes (rows).
#' @param len A vector of gene cds length equal to number of rows of dfr.
#'
#' https://support.bioconductor.org/p/91218/
#'
tpm <- function(counts,len) {
x <- counts/len
return(t(t(x)*1e6/colSums(x)))
}