Forum:Quick code question in TPM conversion from raw counts RNAseq

1

I am using the below code to calculate TPM which I found on GitHub. Can anyone just confirm please what the '2' in the tpms code equates to please? I am new to RNAseq and normalisation analysis and what to understand the code fully.

Thank you kindly

`tpm <- function(counts, lengths) {
rate <- counts / lengths
rate / sum(rate) * 1e6
}

tpms <- apply(counts, 2, function(x) tpm(x, genes$Length))`


RNAseq


tpm


R

• 18 views



Source link