SKILL.md
Version Compatibility
Reference examples tested with: Bracken 2.9+, Kraken2 2.1+, MetaPhlAn 4.1+, pandas 2.2+
Before using code patterns, verify installed versions match. If versions differ:
- Python:
pip show <package>thenhelp(module.function)to check signatures - CLI:
<tool> --versionthen<tool> --helpto confirm flags
If code throws ImportError, AttributeError, or TypeError, introspect the installed package and adapt the example to match the actual API rather than retrying.
Abundance Estimation with Bracken
"Get species-level abundances from my Kraken2 results" → Redistribute reads assigned to higher taxonomic levels down to species using Bracken's Bayesian re-estimation for more accurate abundance profiles.
- CLI:
bracken -d db -i kraken2.report -o bracken.output -r 150 -l S
Basic Abundance Estimation
# Run Bracken on Kraken2 report
bracken -d /path/to/kraken2_db \
-i kraken_report.txt \
-o bracken_output.txt \
-r 150 \ # Read length (100, 150, 200, 250, 300)
-l S # Taxonomic level
Full Workflow with Kraken2
# Step 1: Classify with Kraken2
kraken2 --db /path/to/kraken2_db \
--threads 8 \
--paired \
--report sample_kraken_report.txt \
reads_R1.fastq.gz reads_R2.fastq.gz
# Step 2: Estimate abundances with Bracken
bracken -d /path/to/kraken2_db \
-i sample_kraken_report.txt \
-o sample_bracken_species.txt \
-w sample_bracken_report.txt \
-r 150 \
-l S
Different Taxonomic Levels
# Species level (default)
bracken -d db -i report.txt -o species.txt -r 150 -l S
# Genus level
bracken -d db -i report.txt -o genus.txt -r 150 -l G
# Family level
bracken -d db -i report.txt -o family.txt -r 150 -l F
# Phylum level
bracken -d db -i report.txt -o phylum.txt -r 150 -l P
