tximport output should be integer values, IS NOT.
1
0
Entering edit mode
4.4 years ago
c_u ▴ 520

Hi, I am analyzing RNA-seq data and I used Stringtie to assemble transcripts and quantify them. Now to perfom DE analysis on them (using DESeq2), I used tximport which is recommended by the authors of DESeq2 to convert the count values generated from Stringtie to integer values that DESeq2 can use.

This is my R code -

quantdata <- c('path/to/18T3L/t_data.ctab', '/path to/18T6L/t_data.ctab', ....)

tmp <-readr::read_tsv(quantdata[2])

tx2gene <- tmp[, c("t_name", "gene_id")]

txi_output <- tximport(quantdata, type = "stringtie", tx2gene = tx2gene)

sampleTable <- data.frame(condition = factor(c("P", "P", "NP", "P", "P", "P", "P", "NP", "NP", "P", "P", "P", "P", "P", "P", "P", "P", "P", "P", "P", "NP", "P", "P", "P", "NP", "P", "P", "P", "P", "P", "NP", "NP", "NP", "NP", "P", "P", "P", "P", "P")))

coldata <- sampleTable

coldata$condition <- relevel(coldata$condition, ref = "NP")

library(DESeq2)

dds <- DESeqDataSetFromMatrix(
     countData = txi_output$counts,
     colData = coldata,
     design= ~ condition)

However, running this gives the error -

Error in DESeqDataSet(se, design = design, ignoreRank) :   some values in assay are not integers

And when I check the values using head(txi_output$counts), the corresponding values are not integers, but decimal.

So basically, tximport is not converting the count values to integer, which is one of its functions. Any pointers to what I may be doing wrong here?

EDIT : The problem was, as Ram points out below, that I was using DESeqDataSetFromMatrix(), whereas I should use DESeqDataSetFromTximport(). Changing the last line to the following solved the issue -

dds <- DESeqDataSetFromTximport(
     txi = txi_output,
     colData = coldata,
     design= ~ condition)
dds <- DESeq(dds)
RNA-Seq stringtie • 3.1k views
ADD COMMENT
3
Entering edit mode
4.4 years ago
Ram 43k

tximport is not converting the count values to integer, which is what its supposed to do.

Can you show us where this is mentioned in the documentation? Also, why are you using DESeqDataSetFromMatrix() instead of DESeqDataSetFromTximport(), the function that does the rounding (which I got not from the documentation but from here)?

ADD COMMENT
0
Entering edit mode

Hi Ram, I understood that this is one of the main functions of tximport from here - A: Transcript to gene level count for DEseq(2) use- Salmon/Sailfish/Kallisto etc.

ADD REPLY
0
Entering edit mode

I might be missing something but nothing in there speaks about integer/decimal counts or rounding.

ADD REPLY
0
Entering edit mode

Thanks a lot Ram. I think I may have misunderstood. I think it is true that the job of tximport is to provide count values to DESeq2 (which need to be integer) but I guess it doesn't do it on its own (using the tximport function). Rather I think that conversion to integer happens using DESeqDataSetFromTximport(). Thanks for the clarification!

ADD REPLY
0
Entering edit mode

Ram, I changed my code to have DESeqDataSetFromTximport() instead of DESeqDataSetFromMatrix(), and it worked fine. Thanks a lot!

ADD REPLY

Login before adding your answer.

Traffic: 2592 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