<p>Remove the <code>--quiet</code> option, and capture STDERR as well as STDOUT:</p>
<pre><code>bowtie2 -x human_mirs -U 1.lane.clean.gz -N 1 --norc --no-unal --no-head --ignore-quals 1&gt;sr1prueba.sam 2&gt;sr1prueba.summary.log
</code></pre>
<p><strong>See also:</strong></p>
<p><a href="https://bowtie-bio.sourceforge.net/bowtie2/manual.shtml#alignment-summary" rel="noreferrer"><code>bowtie2</code> manual: alignment summary</a></p>

CC BY-SA 4.0
2023-10-18T21:09:21.823Z
2023-10-18T21:09:21.823Z
Timur Shtatland
<p>Get <a href="http://www.htslib.org/" rel="nofollow noreferrer">samtools</a>.</p>
<p>Then run:</p>
<pre><code>samtools stats file.bam
</code></pre>
<p>and/or</p>
<pre><code>samtools flagstat file.bam
</code></pre>
<p>For example outputs see <a href="https://www.biostars.org/p/412621/" rel="nofollow noreferrer">here</a>.</p>

CC BY-SA 4.0
2023-10-18T17:56:40.377Z
2023-10-18T17:56:40.377Z
Maximilian Press
<p>I am aligning my Small RNA Seq data with Bowtie 2. Although the alignment performs well, the only information I obtain after finishing running the alignment is the following:</p>
<pre><code>## Time loading reference: 00:00:00
## Time loading forward index: 00:00:00
## Time loading mirror index: 00:00:00
## Multiseed full-index search: 00:00:00
## Time searching: 00:00:00
## Overall time: 00:00:00
## Time loading reference: 00:00:00
## Time loading forward index: 00:00:00
## Time loading mirror index: 00:00:00
## Multiseed full-index search: 00:00:01
## Time searching: 00:00:01
## Overall time: 00:00:01
## Time loading reference: 00:00:00
## Time loading forward index: 00:00:00
## Time loading mirror index: 00:00:00
## Multiseed full-index search: 00:00:00
## Time searching: 00:00:00
## Overall time: 00:00:00
## Time loading reference: 00:00:00
## Time loading forward index: 00:00:00
## Time loading mirror index: 00:00:00
## Multiseed full-index search: 00:00:00
## Time searching: 00:00:00
## Overall time: 00:00:00
## Time loading reference: 00:00:00
## Time loading forward index: 00:00:00
## Time loading mirror index: 00:00:00
## Multiseed full-index search: 00:00:00
## Time searching: 00:00:00
## Overall time: 00:00:00
## Time loading reference: 00:00:00
## Time loading forward index: 00:00:00
## Time loading mirror index: 00:00:00
## Multiseed full-index search: 00:00:00
## Time searching: 00:00:00
## Overall time: 00:00:00
</code></pre>
<p>This is my command line to build the index:
bowtie2-build -o 3 -t 5 Nuevofastaorina human_mirs</p>
<p>And this is my command line to do the alignment:</p>
<pre><code>bowtie2 -x human_mirs -U 1.lane.clean.gz -N 1 --norc --no-unal --no-head --ignore-quals –-quiet &gt; sr1prueba.sam
</code></pre>
<p>Does anyone know how to obtain an alignment summary instead of the above information? What I mean by alignment summary is the following:</p>
<pre><code>20000 reads; of these:
  20000 (100.00%) were unpaired; of these:
    1247 (6.24%) aligned 0 times
    18739 (93.69%) aligned exactly 1 time
    14 (0.07%) aligned &gt;1 times
93.77% overall alignment rate
</code></pre>

CC BY-SA 4.0
2023-10-19T03:21:15.310Z
Please show the first few lines of your fastq input data (i.e. lane.clean.gz). This should help to diagnose the problem.
gringer
<rna-seq><phylogenetics><bowtie2>
Cannot obtain alignment summary after running Bowtie2
# Cannot obtain alignment summary after running Bowtie2

(Asked by: username_0 on 2023-10-18)

I am aligning my Small RNA Seq data with Bowtie 2. Although the alignment performs well, the only information I obtain after finishing running the alignment is the following:
## Time loading reference: 00:00:00
## Time loading forward index: 00:00:00
## Time loading mirror index: 00:00:00
## Multiseed full-index search: 00:00:00
## Time searching: 00:00:00
## Overall time: 00:00:00
## Time loading reference: 00:00:00
## Time loading forward index: 00:00:00
## Time loading mirror index: 00:00:00
## Multiseed full-index search: 00:00:01
## Time searching: 00:00:01
## Overall time: 00:00:01
## Time loading reference: 00:00:00
## Time loading forward index: 00:00:00
## Time loading mirror index: 00:00:00
## Multiseed full-index search: 00:00:00
## Time searching: 00:00:00
## Overall time: 00:00:00
## Time loading reference: 00:00:00
## Time loading forward index: 00:00:00
## Time loading mirror index: 00:00:00
## Multiseed full-index search: 00:00:00
## Time searching: 00:00:00
## Overall time: 00:00:00
## Time loading reference: 00:00:00
## Time loading forward index: 00:00:00
## Time loading mirror index: 00:00:00
## Multiseed full-index search: 00:00:00
## Time searching: 00:00:00
## Overall time: 00:00:00
## Time loading reference: 00:00:00
## Time loading forward index: 00:00:00
## Time loading mirror index: 00:00:00
## Multiseed full-index search: 00:00:00
## Time searching: 00:00:00
## Overall time: 00:00:00

This is my command line to build the index:
bowtie2-build -o 3 -t 5 Nuevofastaorina human_mirs
And this is my command line to do the alignment:
bowtie2 -x human_mirs -U 1.lane.clean.gz -N 1 --norc --no-unal --no-head --ignore-quals –-quiet > sr1prueba.sam

Does anyone know how to obtain an alignment summary instead of the above information? What I mean by alignment summary is the following:
20000 reads; of these:
  20000 (100.00%) were unpaired; of these:
    1247 (6.24%) aligned 0 times
    18739 (93.69%) aligned exactly 1 time
    14 (0.07%) aligned >1 times
93.77% overall alignment rate

**Tags:** rna-seq, phylogenetics, bowtie2
> **Comments:**
> **username_1**: Please show the first few lines of your fastq input data (i.e. lane.clean.gz). This should help to diagnose the problem.  

---

## 2 answers

### Answer by username_2 on 2023-10-18. Score: 5

Remove the --quiet option, and capture STDERR as well as STDOUT:
bowtie2 -x human_mirs -U 1.lane.clean.gz -N 1 --norc --no-unal --no-head --ignore-quals 1>sr1prueba.sam 2>sr1prueba.summary.log

See also:
bowtie2 manual: alignment summary


---

### Answer by username_3 on 2023-10-18. Score: 2

Get samtools.
Then run:
samtools stats file.bam

and/or
samtools flagstat file.bam

For example outputs see here.


---

