Install any skill in seconds. Free to start, no credit card required.
Get Started Free →End-to-end metagenomics workflow from FASTQ to taxonomic and functional profiles. Covers Kraken2 classification, Bracken abundance estimation, and HUMAnN functional profiling. Use when profiling metagenomic samples.
.claude/skills/bio-workflows-metagenomics-pipeline/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 65% | 0% |
| case-19 | ✗→✓ | ▲ Improved | 78% | 0% |
| case-24 | ✓→✓ | = Same ✓ | 89% | 0% |
| case-10 | ✓→✓ | = Same ✓ | 44% | 0% |
| case-02 | ✓→✓ | = Same ✓ | 115% | 0% |
<!--
#
#
-->
Complete workflow from metagenomic FASTQ to taxonomic and functional profiles.
FASTQ files
|
v
[1. QC & Host Removal] --> fastp + Bowtie2
|
v
[2. Taxonomic Classification]
|
+---> Kraken2 + Bracken (fast, database-dependent)
|
+---> MetaPhlAn (marker-based, standardized)
|
v
[3. Functional Profiling] --> HUMAnN
|
v
Taxonomic profiles + Pathway abundancesbash# QC with fastp for sample in sample1 sample2 sample3; do fastp -i ${sample}_R1.fastq.gz -I ${sample}_R2.fastq.gz \ -o trimmed/${sample}_R1.fq.gz -O trimmed/${sample}_R2.fq.gz \ --detect_adapter_for_pe \ --qualified_quality_phred 20 \ --length_required 50 \ --html qc/${sample}_fastp.html done # Remove host reads (human example) for sample in sample1 sample2 sample3; do bowtie2 -p 8 -x human_index \ -1 trimmed/${sample}_R1.fq.gz \ -2 trimmed/${sample}_R2.fq.gz \ --un-conc-gz host_removed/${sample}_R%.fq.gz \ > /dev/null 2> qc/${sample}_host_removal.log done
bash# Classify reads for sample in sample1 sample2 sample3; do kraken2 --db kraken2_db \ --threads 8 \ --paired \ --report kraken/${sample}.report \ --output kraken/${sample}.output \ host_removed/${sample}_R1.fq.gz \ host_removed/${sample}_R2.fq.gz done
bash# Estimate species abundance for sample in sample1 sample2 sample3; do bracken -d kraken2_db \ -i kraken/${sample}.report \ -o bracken/${sample}.species.txt \ -r 150 \ -l S \ -t 10 done # Combine samples into abundance matrix combine_bracken_outputs.py \ --files bracken/*.species.txt \ -o bracken/combined_species.txt
bash# Profile with MetaPhlAn 4 for sample in sample1 sample2 sample3; do metaphlan host_removed/${sample}_R1.fq.gz,host_removed/${sample}_R2.fq.gz \ --bowtie2out metaphlan/${sample}.bowtie2.bz2 \ --input_type fastq \ --nproc 8 \ -o metaphlan/${sample}_profile.txt done # Merge profiles merge_metaphlan_tables.py metaphlan/*_profile.txt > metaphlan/merged_abundance.txt
bash# Run HUMAnN for sample in sample1 sample2 sample3; do # Concatenate paired reads cat host_removed/${sample}_R1.fq.gz host_removed/${sample}_R2.fq.gz > \ host_removed/${sample}_concat.fq.gz humann --input host_removed/${sample}_concat.fq.gz \ --output humann/${sample} \ --threads 8 \ --metaphlan-options "--bowtie2db metaphlan_db" done # Normalize and join tables humann_renorm_table --input humann/sample1/sample1_pathabundance.tsv \ --output humann/sample1/sample1_pathabundance_cpm.tsv \ --units cpm humann_join_tables --input humann \ --output humann/merged_pathabundance.tsv \ --file_name pathabundance
pythonimport pandas as pd import matplotlib.pyplot as plt import seaborn as sns # Load Bracken species table species = pd.read_csv('bracken/combined_species.txt', sep='\t', index_col=0) # Top 20 species heatmap top20 = species.sum(axis=1).nlargest(20).index plt.figure(figsize=(12, 8)) sns.heatmap(species.loc[top20], cmap='viridis', annot=False) plt.title('Top 20 Species Abundance') plt.tight_layout() plt.savefig('top20_species_heatmap.pdf') # Stacked bar plot species_norm = species.div(species.sum()) * 100 top10 = species_norm.sum(axis=1).nlargest(10).index other = species_norm.loc[~species_norm.index.isin(top10)].sum() plot_data = species_norm.loc[top10].T plot_data['Other'] = other plot_data.plot(kind='bar', stacked=True, figsize=(10, 6)) plt.ylabel('Relative Abundance (%)') plt.legend(bbox_to_anchor=(1.05, 1)) plt.tight_layout() plt.savefig('species_barplot.pdf')
| Step | Parameter | Value | |------|-----------|-------| | fastp | --length_required | 50 (metagenomic reads) | | Kraken2 | --confidence | 0.0 (default) or 0.1 | | Bracken | -r | Read length (e.g., 150) | | Bracken | -l | S (species) or G (genus) | | Bracken | -t | 10 (min reads threshold) | | MetaPhlAn | --min_cu_len | 2000 (default) | | HUMAnN | --threads | 8+ |
| Issue | Likely Cause | Solution | |-------|--------------|----------| | Low classification rate | Database mismatch, novel organisms | Try different database, check sample type | | High unclassified | Novel microbes, host contamination | Remove host, use larger database | | High host reads | Incomplete host removal | Use multiple host reference genomes | | HUMAnN slow | Large files | Increase threads, pre-filter reads |
bash#!/bin/bash set -e THREADS=8 KRAKEN_DB="kraken2_standard_db" HOST_INDEX="human_bt2_index" SAMPLES="sample1 sample2 sample3" OUTDIR="metagenomics_results" mkdir -p ${OUTDIR}/{trimmed,host_removed,kraken,bracken,metaphlan,humann,qc} # Step 1: QC echo "=== QC ===" for sample in $SAMPLES; do fastp -i ${sample}_R1.fastq.gz -I ${sample}_R2.fastq.gz \ -o ${OUTDIR}/trimmed/${sample}_R1.fq.gz \ -O ${OUTDIR}/trimmed/${sample}_R2.fq.gz \ --length_required 50 \ --html ${OUTDIR}/qc/${sample}_fastp.html -w ${THREADS} done # Host removal echo "=== Host Removal ===" for sample in $SAMPLES; do bowtie2 -p ${THREADS} -x ${HOST_INDEX} \ -1 ${OUTDIR}/trimmed/${sample}_R1.fq.gz \ -2 ${OUTDIR}/trimmed/${sample}_R2.fq.gz \ --un-conc-gz ${OUTDIR}/host_removed/${sample}_R%.fq.gz \ > /dev/null 2> ${OUTDIR}/qc/${sample}_host.log done # Step 2: Kraken2 echo "=== Kraken2 ===" for sample in $SAMPLES; do kraken2 --db ${KRAKEN_DB} --threads ${THREADS} --paired \ --report ${OUTDIR}/kraken/${sample}.report \ --output ${OUTDIR}/kraken/${sample}.output \ ${OUTDIR}/host_removed/${sample}_R1.fq.gz \ ${OUTDIR}/host_removed/${sample}_R2.fq.gz done # Bracken echo "=== Bracken ===" for sample in $SAMPLES; do bracken -d ${KRAKEN_DB} \ -i ${OUTDIR}/kraken/${sample}.report \ -o ${OUTDIR}/bracken/${sample}.species.txt \ -r 150 -l S -t 10 done echo "=== Pipeline Complete ===" echo "Kraken reports: ${OUTDIR}/kraken/" echo "Bracken abundances: ${OUTDIR}/bracken/"
<!-- AUTHOR_SIGNATURE: 9a7f3c2e-MD-BABU-MIA-2026-MSSM-SECURE -->
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→pass | 13,506 | 13,820 | +2% | 1 | 1 | 0% | 2,836 | 4,689 | +65% | 0 | 0 | — |
case-24 | pass→pass | 14,623 | 14,861 | +2% | 1 | 1 | 0% | 2,607 | 4,927 | +89% | 0 | 0 | — |
case-10 | pass→pass | 14,292 | 8,850 | -38% | 1 | 1 | 0% | 2,797 | 4,015 | +44% | 0 | 0 | — |
case-02 | pass→pass | 9,202 | 6,193 | -33% | 1 | 1 | 0% | 1,678 | 3,607 | +115% | 0 | 0 | — |
case-03 | pass→pass | 10,960 | 6,900 | -37% | 1 | 1 | 0% | 1,954 | 3,717 | +90% | 0 | 0 | — |
case-04 | pass→pass | 4,331 | 2,397 | -45% | 1 | 1 | 0% | 808 | 2,696 | +234% | 0 | 0 | — |
case-05 | pass→pass | 4,969 | 2,175 | -56% | 1 | 1 | 0% | 841 | 2,685 | +219% | 0 | 0 | — |
case-06 | fail→fail | 3,730 | 3,932 | +5% | 1 | 1 | 0% | 700 | 3,068 | +338% | 0 | 0 | — |
case-07 | pass→pass | 6,917 | 2,815 | -59% | 1 | 1 | 0% | 1,005 | 2,877 | +186% | 0 | 0 | — |
case-08 | pass→pass | 2,425 | 2,475 | +2% | 1 | 1 | 0% | 360 | 2,708 | +652% | 0 | 0 | — |
case-09 | pass→pass | 2,615 | 3,214 | +23% | 1 | 1 | 0% | 439 | 2,667 | +508% | 0 | 0 | — |
case-11 | pass→pass | 8,501 | 8,435 | -1% | 1 | 1 | 0% | 1,936 | 4,111 | +112% | 0 | 0 | — |
case-12 | pass→pass | 8,539 | 2,907 | -66% | 1 | 1 | 0% | 1,555 | 2,924 | +88% | 0 | 0 | — |
case-13 | pass→pass | 9,572 | 2,805 | -71% | 1 | 1 | 0% | 1,631 | 2,890 | +77% | 0 | 0 | — |
case-14 | pass→pass | 6,749 | 4,353 | -36% | 1 | 1 | 0% | 1,173 | 3,050 | +160% | 0 | 0 | — |
case-15 | pass→pass | 9,086 | 5,029 | -45% | 1 | 1 | 0% | 1,634 | 3,312 | +103% | 0 | 0 | — |
case-16 | pass→pass | 3,454 | 2,651 | -23% | 1 | 1 | 0% | 533 | 2,864 | +437% | 0 | 0 | — |
case-17 | pass→pass | 4,904 | 2,769 | -44% | 1 | 1 | 0% | 716 | 2,810 | +292% | 0 | 0 | — |
case-18 | pass→pass | 4,302 | 3,450 | -20% | 1 | 1 | 0% | 803 | 3,024 | +277% | 0 | 0 | — |
case-19 | fail→pass | 11,517 | 7,993 | -31% | 1 | 1 | 0% | 2,126 | 3,792 | +78% | 0 | 0 | — |
case-20 | pass→pass | 7,863 | 1,663 | -79% | 1 | 1 | 0% | 1,404 | 2,582 | +84% | 0 | 0 | — |
case-21 | pass→pass | 12,183 | 2,373 | -81% | 1 | 1 | 0% | 1,725 | 2,714 | +57% | 0 | 0 | — |
case-22 | pass→pass | 12,673 | 11,791 | -7% | 1 | 1 | 0% | 2,335 | 4,612 | +98% | 0 | 0 | — |
case-23 | pass→pass | 11,714 | 16,252 | +39% | 1 | 1 | 0% | 2,460 | 5,631 | +129% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 24 cases were attempted. The headline lift of +8 percentage points is the difference between those two pass rates over the 24 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
| Model | Method | Date | Lift |
|---|---|---|---|
| gemini-3.6-flash | verified | 7/26/2026 | — |
Other measured skills in the registry, with their headline benchmark lift.