countsToTPM | R Documentation |
This function is from https://gist.github.com/slowkow/c6ab0348747f86e2748b#file-counts_to_tpm-r Convert counts to transcripts per million (TPM).
countsToTPM(counts, featureLength, meanFragmentLength)
counts |
A numeric matrix of raw feature counts i.e. fragments assigned to each gene. |
featureLength |
A numeric vector with feature lengths. This should be the same length as the number of features |
meanFragmentLength |
A numeric vector with mean fragment lengths. This should be the same length as the number of samples |
Lior Pachter. Models for transcript quantification from RNA-Seq. arXiv:1104.3889v2
Wagner, et al. Measurement of mRNA abundance using RNA-seq data: RPKM measure is inconsistent among samples. Theory Biosci. 24 July 2012. doi:10.1007/s12064-012-0162-3
tpm A numeric matrix normalized by library size and feature length
set.seed(1785)
counts <- matrix(sample(20:200, size = 100), ncol = 5)
featureLength <- sample(200:1000, size = 20)
meanFragmentLength <- sample(200:300, size = 5)
countsToTPM(counts, featureLength, meanFragmentLength)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.