<p>You are right, <code>samples.txt</code> is not generated by Salmon (or any other transcript abundance quantifiers). From <a href="https://bioconductor.org/packages/devel/data/experiment/vignettes/tximportData/inst/doc/tximportData.html" rel="noreferrer">documentation</a>, you can find a <a href="http://www.geuvadis.org/web/geuvadis" rel="noreferrer">link</a> to an example of how <code>samples.txt</code> should look like. </p>

<p>Note: At the moment, the server is unavailable (I got an <code>Error 503: Service Temporarily Unavailable</code>) - I'd suggest you get directly in contact with the owners / <a href="https://bioconductor.org/packages/devel/data/experiment/vignettes/tximportData/inst/doc/tximportData.html" rel="noreferrer">authors</a>.</p>

<p>Luckily, there is a call of the function importing <code>samples.txt</code> file in the <a href="https://bioconductor.org/packages/devel/data/experiment/vignettes/tximportData/inst/doc/tximportData.html" rel="noreferrer">doc</a> itself (variable <code>samples</code>), so you can get an idea of ow you have to structure it: </p>

<pre><code>&gt; 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
</code></pre>

<p>As an alternate workaround, find the <code>samples.txt</code> format directly from <a href="https://bioconductor.org/packages/release/data/experiment/html/tximportData.html" rel="noreferrer">tximportData Bioconductor page</a>:</p>

<ol>
<li>download <a href="https://bioconductor.org/packages/release/data/experiment/src/contrib/tximportData_1.6.0.tar.gz" rel="noreferrer">source code</a></li>
<li>extract</li>
<li>navigate to: <code>[...]/tximportData 2/inst/extdata</code></li>
<li>read content of <code>samples.txt</code>.</li>
</ol>

CC BY-SA 3.0
2018-04-09T09:29:20.213Z
2018-04-09T09:29:20.213Z
aechchiki
<p>I ran bulk <code>RNA-seq</code> experiment and got <code>quant.sf</code> file. Now, I am struggling with understanding what <code>tximport</code> package does and how to use it correctly. My ultimate goal is to feed the data into <code>DESeq2</code> for differential expression analysis. In the documentation:</p>

<p><a href="http://bioconductor.org/packages/release/bioc/manuals/tximport/man/tximport.pdf" rel="nofollow noreferrer">http://bioconductor.org/packages/release/bioc/manuals/tximport/man/tximport.pdf</a></p>

<p>We have:</p>

<pre><code>samples &lt;- read.table(file.path(dir,"samples.txt"), header=TRUE)
files &lt;- file.path(dir,"salmon", samples$run, "quant.sf")
</code></pre>

<p>I do not understand what are these <code>samples.txt</code>. It is not generated by <code>salmon</code>, 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 <code>tximport</code> when we have just one <code>quant.sf</code> file to get to raw count matrix to feed it into <code>DeSeq2</code>?</p>

CC BY-SA 3.0
2018-04-09T09:34:01.447Z
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.
heathobrien
<rna-seq><deseq2><tximport>
Salmon tximport
# Salmon tximport

(Asked by: username_0 on 2018-04-09)

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:
http://bioconductor.org/packages/release/bioc/manuals/tximport/man/tximport.pdf
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?

**Tags:** rna-seq, deseq2, tximport
> **Comments:**
> **username_1**: 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.  

---

## 1 answers

### Answer by username_2 on 2018-04-09. Score: 5 | Accepted answer

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:

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


---

