<h1 id="diversity-kraken-tools">Diversity Kraken Tools</h1>
<p>For news and updates, refer to the github page:
https://github.com/jenniferlu717/KrakenTools/</p>
<p>KrakenToolsDiversity is a suite of scripts to be used for
post-analysis of Kraken/KrakenUniq/Kraken2/Bracken results. Please cite
the relevant paper if using KrakenTools with any of the listed
programs.</p>
<h2 id="links-to-kraken-github-pages">Links to Kraken github pages</h2>
<ol type="1">
<li><a href="https://github.com/DerrickWood/kraken">Kraken 1</a></li>
<li><a href="https://github.com/DerrickWood/kraken2">Kraken 2</a></li>
<li><a
href="https://github.com/fbreitwieser/krakenuniq">KrakenUniq</a></li>
<li><a href="https://github.com/jenniferlu717/Bracken">Bracken</a></li>
</ol>
<p>For issues with any of the above programs, please open a github issue
on their respective github pages. This github repository is dedicated to
only the scripts provided here.</p>
<table style="width:81%;">
<colgroup>
<col style="width: 80%" />
</colgroup>
<thead>
<tr class="header">
<th style="text-align: left;">## Scripts included in Diversity
KrakenTools 1. <a href="#alpha_diversitypy">alpha_diversity.py</a> 1. <a
href="#beta_diversitypy">beta_diversity.py</a></th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td style="text-align: left;"># alpha_diversity.py</td>
</tr>
<tr class="even">
<td style="text-align: left;">This program calculates alpha diversity,
from the Bracken abundance estimation file. User must specify Bracken
output file, and type of alpha diversity to be calculated. Specific
options are specified below.</td>
</tr>
<tr class="odd">
<td style="text-align: left;">## 1. alpha_diversity.py
usage/options</td>
</tr>
<tr class="even">
<td style="text-align: left;"><code>python alpha_diversity.py</code> *
<code>-f, --filename MYFILE.BRACKEN..........</code>Bracken output file
* <code>-a, --alpha TYPE.......................</code>Single letter
alpha diversity type (Sh, BP, Si, ISi, F)</td>
</tr>
<tr class="odd">
<td style="text-align: left;">## 2. alpha_diversity.py input file</td>
</tr>
<tr class="even">
<td style="text-align: left;">Input Bracken file must be in standard
Bracken output file format and must be run specifically for Abundance
Estimation. Example format:</td>
</tr>
<tr class="odd">
<td style="text-align: left;">name tax_id tax_lvl kraken…. added… new….
fraction… Homo sapiens 9606 S … …. 999000 0.999000 Streptococcus
pyogenes 1314 S … …. 10 0.000001 Streptococcus agalactiae 1311 S … …. 5
0.000000 Streptococcus pneumoniae 1313 S … …. 3 0.000000 Bordetella
pertussis 520 S … …. 20 0.000002</td>
</tr>
<tr class="even">
<td style="text-align: left;">Link to Bracken github for reference: <a
href="https://github.com/jenniferlu717/Bracken">Bracken</a></td>
</tr>
<tr class="odd">
<td style="text-align: left;">Note: This example shows the file format
from Bracken at the species level, but users can specify a different
level for abundance estimation with Bracken.</td>
</tr>
<tr class="even">
<td style="text-align: left;">## 4. alpha_diversity.py alpha type
input</td>
</tr>
<tr class="odd">
<td style="text-align: left;">By default, the program will calculate
Shannon’s alpha:</td>
</tr>
<tr class="even">
<td style="text-align: left;">python alpha_diversity.py -f
myfile.bracken</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Users can specify which type of alpha
diversity from this set:</td>
</tr>
<tr class="even">
<td style="text-align: left;">* Sh……Shannon’s alpha diversity *
BP…..Berger-Parker’s alpha * Si…..Simpson’s diversity * ISi…..Inverse
Simpson’s diversity * F…….Fisher’s index</td>
</tr>
<tr class="odd">
<td style="text-align: left;">To calculate berger-parker’s alpha:</td>
</tr>
<tr class="even">
<td style="text-align: left;">python alpha_diversity.py -f
myfile.bracken -a BP</td>
</tr>
</tbody>
</table>
<h1 id="beta_diversity.py">beta_diversity.py</h1>
<p>This program calculates the beta diversity (Bray-Curtis
dissimilarity) from kraken, krona and bracken files.</p>
<p>To calculate the pairwise dissimilarity score, you can call the
script with two or more files as follows:</p>
<pre><code>python beta_diversity.py -i file1.bracken file2.bracken [...] --type bracken</code></pre>
<p>The script supports bracken files, kraken and kracken2 report files
and krona files. Additionally, you can pass any tab-separated file and
specify the columns with the taxonomical information and read counts
(<code>--cols</code>).</p>
<p>To only compute the dissimilarity score on a certain taxonomical
level (only supported for kraken and krona files), you can pass
<code>--level S</code> (S, G, F or O for species, genus, family and
order level).</p>
<p>For more information, please take a look at the help page.</p>
<pre><code>python beta_diversity.py --help</code></pre>
