Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Profile functional potential of metagenomes using HUMAnN3 and similar tools. Use when obtaining pathway abundances, gene family counts, or functional annotations from metagenomic data.
.claude/skills/bio-metagenomics-functional-profiling/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-03 | ✗→✓ | ▲ Improved | — | — |
| case-09 | ✗→✓ | ▲ Improved | — | — |
| case-14 | ✗→✓ | ▲ Improved | — | — |
| case-11 | ✗→✓ | ▲ Improved | — | — |
| case-02 | ✗→✓ | ▲ Improved | — | — |
Reference examples tested with: HUMAnN 3.8+, MetaPhlAn 4.1+, matplotlib 3.8+, pandas 2.2+, scanpy 1.10+, scipy 1.12+, seaborn 0.13+
Before using code patterns, verify installed versions match. If versions differ:
pip show <package> then help(module.function) to check signatures<tool> --version then <tool> --help to confirm flagsIf code throws ImportError, AttributeError, or TypeError, introspect the installed package and adapt the example to match the actual API rather than retrying.
"What metabolic pathways are present in my metagenome?" → Profile functional potential of metagenomic samples to obtain pathway abundances and gene family counts using translated search against UniRef and MetaCyc.
humann --input reads.fastq --output results/ (HUMAnN3)Profile the functional potential of metagenomic samples using HUMAnN3 to get pathway and gene family abundances.
bash# Install via conda (recommended) conda create -n humann -c bioconda humann conda activate humann # Download databases humann_databases --download chocophlan full /path/to/databases humann_databases --download uniref uniref90_diamond /path/to/databases # Update config with database paths humann_config --update database_folders nucleotide /path/to/databases/chocophlan humann_config --update database_folders protein /path/to/databases/uniref
bash# Run HUMAnN3 on a single sample humann --input sample.fastq.gz --output sample_humann # With MetaPhlAn taxonomic profile (faster) humann --input sample.fastq.gz \ --taxonomic-profile sample_metaphlan.txt \ --output sample_humann # Paired-end reads (concatenate first) cat sample_R1.fq.gz sample_R2.fq.gz > sample_concat.fq.gz humann --input sample_concat.fq.gz --output sample_humann
sample_humann/
├── sample_genefamilies.tsv # Gene family abundances (UniRef90)
├── sample_pathabundance.tsv # MetaCyc pathway abundances
├── sample_pathcoverage.tsv # Pathway coverage (0-1)
└── sample_humann_temp/ # Intermediate files# Gene Family sample_Abundance-RPKs
UniRef90_A0A000|g__Bacteroides.s__Bacteroides_vulgatus 123.45
UniRef90_A0A001|unclassified 67.89
UNMAPPED 1000.0# Pathway sample_Abundance
PWY-5100: pyruvate fermentation 456.78
PWY-5100|g__Bacteroides.s__Bacteroides_vulgatus 234.56
PWY-5100|unclassified 222.22bash# Process multiple samples for fq in *.fastq.gz; do sample=$(basename $fq .fastq.gz) humann --input $fq --output ${sample}_humann --threads 8 done # Join tables across samples humann_join_tables -i . -o merged_genefamilies.tsv --file_name genefamilies humann_join_tables -i . -o merged_pathabundance.tsv --file_name pathabundance
bash# Normalize to relative abundance humann_renorm_table -i merged_genefamilies.tsv \ -o genefamilies_relab.tsv \ -u relab # Normalize to copies per million (CPM) humann_renorm_table -i merged_pathabundance.tsv \ -o pathabundance_cpm.tsv \ -u cpm
bash# Regroup to different functional categories # EC numbers humann_regroup_table -i genefamilies.tsv \ -g uniref90_level4ec \ -o genefamilies_ec.tsv # KEGG Orthologs humann_regroup_table -i genefamilies.tsv \ -g uniref90_ko \ -o genefamilies_ko.tsv # GO terms humann_regroup_table -i genefamilies.tsv \ -g uniref90_go \ -o genefamilies_go.tsv # Pfam domains humann_regroup_table -i genefamilies.tsv \ -g uniref90_pfam \ -o genefamilies_pfam.tsv
bash# Unstratify (remove organism info, sum across species) humann_split_stratified_table -i merged_pathabundance.tsv \ -o . # Creates: merged_pathabundance_unstratified.tsv # merged_pathabundance_stratified.tsv
pythonimport pandas as pd df = pd.read_csv('merged_pathabundance.tsv', sep='\t', index_col=0) unstratified = df[~df.index.str.contains('\\|')] stratified = df[df.index.str.contains('\\|')] def get_species_contrib(pathway, df): '''Get species contributions to a pathway''' mask = df.index.str.startswith(pathway + '|') return df[mask] contrib = get_species_contrib('PWY-5100', stratified)
bash# Check unmapped and unintegrated humann_barplot -i merged_pathabundance.tsv \ -o pathabundance_barplot.png \ --focal-feature UNMAPPED
| Metric | Good | Concerning | |--------|------|------------| | UNMAPPED (gene families) | <30% | >50% | | UNINTEGRATED (pathways) | <40% | >60% | | Pathway coverage | >0.5 | <0.3 |
bash# Format for LEfSe humann_join_tables -i . -o merged.tsv --file_name pathabundance humann_renorm_table -i merged.tsv -o merged_relab.tsv -u relab
Goal: Identify differentially abundant metabolic pathways between conditions from HUMAnN3 output.
Approach: Load unstratified pathway abundances, split samples by condition using metadata, run Mann-Whitney U tests per pathway, and apply FDR correction.
pythonimport pandas as pd from scipy import stats df = pd.read_csv('pathabundance_cpm.tsv', sep='\t', index_col=0) metadata = pd.read_csv('metadata.tsv', sep='\t', index_col=0) group1 = metadata[metadata['condition'] == 'healthy'].index group2 = metadata[metadata['condition'] == 'disease'].index results = [] for pathway in df.index: if '|' not in pathway and pathway != 'UNMAPPED': vals1 = df.loc[pathway, group1] vals2 = df.loc[pathway, group2] stat, pval = stats.mannwhitneyu(vals1, vals2) fc = vals2.mean() / (vals1.mean() + 1e-10) results.append({'pathway': pathway, 'pvalue': pval, 'fold_change': fc}) results_df = pd.DataFrame(results) results_df['padj'] = stats.false_discovery_control(results_df['pvalue'])
pythonimport matplotlib.pyplot as plt import seaborn as sns df = pd.read_csv('pathabundance_relab.tsv', sep='\t', index_col=0) df = df[~df.index.str.contains('\\|')] df = df.drop(['UNMAPPED', 'UNINTEGRATED'], errors='ignore') top = df.mean(axis=1).nlargest(20).index plt.figure(figsize=(12, 8)) sns.heatmap(df.loc[top].T, cmap='viridis', xticklabels=True) plt.tight_layout() plt.savefig('pathway_heatmap.png')
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-03 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-05 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-09 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-12 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-13 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-17 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-21 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-18 | pass→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-16 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-08 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-14 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-10 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-22 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-07 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-11 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-19 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-02 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-06 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-01 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-15 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-04 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-20 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
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. 22 cases were attempted, and 17 counted toward the lift figure. The other 5 produced results that are not comparable between the two arms, so they are excluded from the headline rather than averaged into it. The headline lift of +41 percentage points is the difference between those two pass rates over the 17 comparable cases.
The per-case answers from this run were removed by the retention sweep, so the case table below shows the verdicts without the text either arm produced. The counts above were recorded at the time and are unaffected. Answers are now kept for 180 days.
Other measured skills in the registry, with their headline benchmark lift.