I ran bulk RNA-seq experiment and got quant.sf file. Now, I am struggling with understanding what tximport package does and how to use it correctly. My ultimate goal is to feed the data into DESeq2 for differential expression analysis. In the documentation:


We have:

samples <- read.table(file.path(dir,"samples.txt"), header=TRUE)
files <- file.path(dir,"salmon", samples$run, "quant.sf")

I do not understand what are these samples.txt. It is not generated by salmon, so I suppose that I need to write it myself. How then? What is the correct format for the file? And what if I want to feed just one sample in? That is actually what I want initially: process each sample separately. Could anyone explain step by step how we could utilize tximport when we have just one quant.sf file to get to raw count matrix to feed it into DeSeq2?

  • 1
    $\begingroup$ I suppose you could write a samples.txt file with a single sample, but there's not much point in processing the samples separately because the first step of DESeq2 is to calculate size factors, which requires comparisons across samples. $\endgroup$ Apr 9, 2018 at 9:34

1 Answer 1


You are right, samples.txt is not generated by Salmon (or any other transcript abundance quantifiers). From documentation, you can find a link to an example of how samples.txt should look like.

Note: At the moment, the server is unavailable (I got an Error 503: Service Temporarily Unavailable) - I'd suggest you get directly in contact with the owners / authors.

Luckily, there is a call of the function importing samples.txt file in the doc itself (variable samples), so you can get an idea of ow you have to structure it:

> samples

##   pop center                assay    sample experiment       run
## 1 TSI  UNIGE NA20503.1.M_111124_5 ERS185497  ERX163094 ERR188297
## 2 TSI  UNIGE NA20504.1.M_111124_7 ERS185242  ERX162972 ERR188088
## 3 TSI  UNIGE NA20505.1.M_111124_6 ERS185048  ERX163009 ERR188329
## 4 TSI  UNIGE NA20507.1.M_111124_7 ERS185412  ERX163158 ERR188288
## 5 TSI  UNIGE NA20508.1.M_111124_2 ERS185362  ERX163159 ERR188021
## 6 TSI  UNIGE NA20514.1.M_111124_4 ERS185217  ERX163062 ERR188356

As an alternate workaround, find the samples.txt format directly from tximportData Bioconductor page:

  1. download source code
  2. extract
  3. navigate to: [...]/tximportData 2/inst/extdata
  4. read content of samples.txt.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.