Question: tximport output should be integer values, IS NOT.
0
gravatar for c_u
9 months ago by
c_u260
United States
c_u260 wrote:

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 • 615 views
ADD COMMENTlink modified 9 months ago • written 9 months ago by c_u260
3
gravatar for RamRS
9 months ago by
RamRS30k
Baylor College of Medicine, Houston, TX
RamRS30k wrote:

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 COMMENTlink modified 9 months ago • written 9 months ago by RamRS30k

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 REPLYlink written 9 months ago by c_u260

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

ADD REPLYlink written 9 months ago by RamRS30k

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 REPLYlink written 9 months ago by c_u260

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

ADD REPLYlink written 9 months ago by c_u260
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 904 users visited in the last hour