This is a test version of Biostars. For the public version, visit https://www.biostars.org.
convert raw counts to TPM

Hi,

I need to convert raw counts to TPMs, but I don't know how to get the gene lengths.

I'm using the following package, can you help me out?

install.packages("DGEobj.utils")

library(DGEobj.utils)

TPMs <- convertCounts(raw_counts, unit = "tpm", geneLength, log = FALSE,
        normalize = "none", prior.count = NULL)
r

Have you read the documentation for this function? You need a vector of transcript lengths where geneLength is - it's unclear here if that's a placeholder using the functions variable names or an object. You can find this information in the same place you found the reference transcriptome, or you can generate it yourself with something like samtools faidx.

Regardless, please take a tour of how to ask a good question. There is plenty of information you could have provided that would help us identify where you're stuck.

Note that, if I'm not mistaken, the name geneLength is misleading since you probably want to the transcript length. Possibly use the length of the longest transcript within each gene or maybe something more elaborate than that as long as you exclude introns.

Good catch. Edited my comment.

0 answers

No answers yet.

Log in to answer this question.