convert raw counts to TPM
0
0
Entering edit mode
23 days ago

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 • 472 views
ADD COMMENT
2
Entering edit mode

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.

ADD REPLY
0
Entering edit mode

Good catch. Edited my comment.

ADD REPLY
0
Entering edit mode

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.

ADD REPLY

Login before adding your answer.

Traffic: 2145 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6