Cool! I get the same result.
# michael's version
# https://support.bioconductor.org/p/91218/
tpm3 <- function(counts,len) {
x <- counts/len
return(t(t(x)*1e6/colSums(x)))
}
Michael's version is much faster despite all the transposes.

• 1 views
•
link

Do you have a reason for suspecting it's not? Have you tested it? What do your tests reveal?