text: user6948: I have 10 .sam files after my bowtie2 alignment on ten single-pair sequences. I would like to build a graph based on that output data, however I don't see any other solution but just writing the alignment percentage manually after each iteration.
  Is there a tool that can help me to build a .csv file so I can manipulate the output data more easily?
  
  user6251: Use samtools flagstat with option -O tsv:
  
  Using -O tsv selects a tab-separated values format that can easily be imported into spreadsheet software. In this format the first column contains the values for QC-passed reads, the second column has the values for QC-failed reads and the third contains the category names.
  
  SEE ALSO:
  What Does Samtools Flagstat Results Mean?
  INSTALLATION:
  Some old versions of samtools do not have option -O tsv. To install a recent versions of samtools, use either:
  conda (macOS, Linux) (but see also: Tutorial: installing samtools with conda - overcoming two common errors):
  conda create --name samtools samtools
  
  or brew (macOS):
  brew install samtools
  
  
original_text: 6948: <p>I have 10 <code>.sam</code> files after my <code>bowtie2</code> alignment on ten single-pair sequences. I would like to build a graph based on that output data, however I don't see any other solution but just writing the alignment percentage manually after each iteration.</p>
  <p>Is there a tool that can help me to build a <code>.csv</code> file so I can manipulate the output data more easily?</p>
   6251: <p>Use <a href="http://www.htslib.org/doc/samtools-flagstat.html" rel="nofollow noreferrer"><code>samtools flagstat</code></a> with option <code>-O tsv</code>:</p>
  <blockquote>
  <p>Using <strong>-O tsv</strong> selects a tab-separated values format that can easily be imported into spreadsheet software. In this format the first column contains the values for QC-passed reads, the second column has the values for QC-failed reads and the third contains the category names.</p>
  </blockquote>
  <p><strong>SEE ALSO:</strong><br />
  <a href="https://www.biostars.org/p/12475/" rel="nofollow noreferrer">What Does Samtools Flagstat Results Mean?</a></p>
  <p><strong>INSTALLATION:</strong><br />
  Some old versions of <code>samtools</code> do not have option <code>-O tsv</code>. To install a recent versions of <code>samtools</code>, use either:</p>
  <p><a href="https://anaconda.org/bioconda/samtools" rel="nofollow noreferrer"><code>conda</code></a> (macOS, Linux) (but see also: <a href="https://www.biostars.org/p/455593/" rel="nofollow noreferrer">Tutorial: installing samtools with conda - overcoming two common errors</a>):</p>
  <pre><code>conda create --name samtools samtools
  </code></pre>
  <p>or <a href="https://formulae.brew.sh/formula/samtools" rel="nofollow noreferrer"><code>brew</code></a> (macOS):</p>
  <pre><code>brew install samtools
  </code></pre>
  