Entering edit mode
4 weeks ago
pinheirofabiano
▴
130
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)
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.
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 likesamtools 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.