Question: Using 'tximport' library for downstream DGE after quantifying with Kallisto
gravatar for Sinji
4.3 years ago by
UT Southwestern Medical Center
Sinji3.0k wrote:

I'm quite new to RNA-sequencing and am playing around with data to get a handle on it. I have quantified with Kallisto and am using tximport to summarize transcript counts for differential gene expression analysis.

I am running into a problem associating gene ID's with my transcripts for the summarization portion. I believe that the likely cause is the actual TxDb library I am using and that it may be different from the transcriptome file I used, but I am not sure and my attempts at solving this haven't been successful.

I am working with human samples. I quantified my transcripts using this transcriptome file for homo sapiens. I have 6 samples, 3 WT replicates, and 3 KO replicates.

  1. I created a vector pointing to my kallisto files as detailed in the tximport manual.

    files <- file.path(dir, "kallisto", samples$run, "abundance.tsv")

  2. I created a data.frame from a TxDb object to construct the tx2gene table.


    txdb <- TxDb.Hsapiens.UCSC.hg38.knownGene

    k <- keys(txdb, keytype = "GENEID")

    df <- select(txdb, keys = k, keytype = "GENEID", columns = "TXNAME")

    tx2gene <- df[, 2:1] # tx ID, then gene ID

But head(tx2gene) produces:

1 uc002qsd.4      1
2 uc002qsf.2      1
3 uc003wyw.1     10
4 uc002xmj.3    100
5 uc010xbn.1   1000
6 uc002kwg.2   1000

This obviously isn't right.

  1. Using tximport's tximport function.



    txi <- tximport(files, type = "kallisto", tx2gene = tx2gene, reader = read_tsv)


Does the following:

txi $abundance

sample 1 sample 2 sample 3 sample 4 sample 5 sample 6


sample 1 sample 2 sample 3 sample 4 sample 5 sample 6


sample 1 sample 2 sample 3 sample 4 sample 5 sample 6


[1] "no"

and head(txi$counts):


sample 1 sample 2 sample 3 sample 4 sample 5 sample 6

I'm not completely sure what i'm doing incorrectly. I'll give it another shot after lunch, it might just be the frustration at this point but any help is appreciated.

rna-seq kallisto R tximport • 3.8k views
ADD COMMENTlink modified 4.3 years ago by Michael Love2.0k • written 4.3 years ago by Sinji3.0k
gravatar for Michael Love
4.3 years ago by
Michael Love2.0k
United States
Michael Love2.0k wrote:


I'm the tximport maintainer. If you have software problems, could you post them to

Biostars is a great forum, but it would take extra time for me to go around and check many sites for potential software issues, so I generally only check the Bioc support site now. It is actually a fork of the Biostars software, dedicated to getting responses from Bioconductor software maintainers. Feel free to ignore this though if you only want to use Biostars.

Then, regarding cross-posting on both forums, I'm ok with this as long as the poster makes it clear that they have done so and adds links to both posts so other users can see answers on the other forum.

ADD COMMENTlink written 4.3 years ago by Michael Love2.0k

Link to Bioc post:

ADD REPLYlink written 4.3 years ago by Michael Love2.0k
Please log in to add an answer.


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