🛠️ Claw Metagenomics
環境中の微生物が持つ遺伝子情報をまとめて解析
📺 まず動画で見る(YouTube)
▶ 【衝撃】最強のAIエージェント「Claude Code」の最新機能・使い方・プログラミングをAIで効率化する超実践術を解説! ↗
※ jpskill.com 編集部が参考用に選んだ動画です。動画の内容と Skill の挙動は厳密には一致しないことがあります。
📜 元の英語説明(参考)
Shotgun metagenomics profiling — taxonomy, resistome, and functional pathways
🇯🇵 日本人クリエイター向け解説
環境中の微生物が持つ遺伝子情報をまとめて解析
※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。
下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o claw-metagenomics.zip https://jpskill.com/download/4069.zip && unzip -o claw-metagenomics.zip && rm claw-metagenomics.zip
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/4069.zip -OutFile "$d\claw-metagenomics.zip"; Expand-Archive "$d\claw-metagenomics.zip" -DestinationPath $d -Force; ri "$d\claw-metagenomics.zip"
完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。
💾 手動でダウンロードしたい(コマンドが難しい人向け)
- 1. 下の青いボタンを押して
claw-metagenomics.zipをダウンロード - 2. ZIPファイルをダブルクリックで解凍 →
claw-metagenomicsフォルダができる - 3. そのフォルダを
C:\Users\あなたの名前\.claude\skills\(Win)または~/.claude/skills/(Mac)へ移動 - 4. Claude Code を再起動
⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。
🎯 このSkillでできること
下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。
📦 インストール方法 (3ステップ)
- 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
- 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
- 3. 展開してできたフォルダを、ホームフォルダの
.claude/skills/に置く- · macOS / Linux:
~/.claude/skills/ - · Windows:
%USERPROFILE%\.claude\skills\
- · macOS / Linux:
Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。
詳しい使い方ガイドを見る →- 最終更新
- 2026-05-17
- 取得日時
- 2026-05-18
- 同梱ファイル
- 1
💬 こう話しかけるだけ — サンプルプロンプト
- › Claw Metagenomics を使って、最小構成のサンプルコードを示して
- › Claw Metagenomics の主な使い方と注意点を教えて
- › Claw Metagenomics を既存プロジェクトに組み込む方法を教えて
これをClaude Code に貼るだけで、このSkillが自動発動します。
📖 Skill本文(日本語訳)
※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。
[Skill 名] claw-metagenomics
ショットガンメタゲノミクスプロファイラー
ペアエンドFASTQファイルから、分類学的分類、抗菌薬耐性遺伝子検出、機能経路プロファイリングを組み合わせた包括的なショットガンメタゲノミクス解析を行います。
機能
- ペアエンドFASTQファイル(R1、R2)または単一の連結FASTQを入力として受け取ります。
- 標準データベース(例:Standard-8、PlusPF)に対してKraken2による分類学的分類を実行します。
- 種レベルでBrackenを用いて存在量を精緻化します(リードの再推定)。
- CARDデータベースに対してRGIを用いて抗菌薬耐性遺伝子を検出します。
- 検出されたARGをWHOクリティカル優先病原体との関連性によって分類します。
- オプションで、機能経路プロファイリングのためにHUMAnN3を実行します(MetaCyc + UniRef)。
- Brackenで調整された種存在量からアルファ多様性指標を計算します。
- シャノン多様性指数: H = -sum(p_i * ln(p_i))。ここでp_iは種iに割り当てられた分類済みリードの割合です。
- シンプソン多様性指数: D = 1 - sum(p_i^2)
- ピエロウの均等度: J = H / ln(S)。ここでSは検出された種の数です。
- 種多様度: S = 少なくとも1つのリードが割り当てられた異なる種の数
- 4つの出版品質の図を生成します。
- 図1: 分類群棒グラフ、相対存在量上位20種
- 図2: レジストームヒートマップ、薬剤クラス別のARGファミリーと存在量
- 図3: WHOクリティカルARGサマリー、検出された耐性遺伝子の優先度ティア内訳
- 図4: アルファ多様性サマリー(シャノン、シンプソン、ピエロウをパネル表示)
- 完全な再現性バンドル(commands.sh、environment.yml、checksums.sha256)を生成します。
開発の背景
一般的なAIに「メタゲノムを解析して」と尋ねると、以下のようになります。
- どのKraken2データベースを使用すべきか、信頼度閾値をどのように設定すべきかを知りません。
- リード長と分類学的レベルに関するBrackenパラメータを幻覚します。
- 検出されたARGとWHO優先病原体リストとの関連性を見落とします。
- HUMAnN3を完全にスキップします(またはそのデータベースパスを誤って設定します)。
- 耐性コンテキストのない単一の棒グラフを生成します。
- 多様性指標の計算(シャノン、シンプソン、ピエロウ)をスキップします。
- 再現性バンドルを提供しません。
このスキルは、正しい方法論的決定をエンコードしています。
- Kraken2の信頼度閾値は0.2(環境サンプルにおける偽陽性を低減します)
- Brackenによる種レベルでの再推定、最小10リード
- RGI MAINは「Perfect」および「Strict」ヒット基準のみ(「Loose」ヒットはなし)
- WHOクリティカル優先病原体リストを検出されたARGファミリーにマッピング
- 経路レベルの機能コンテキストのためのMetaCyc層別化を伴うHUMAnN3
- 利用可能なCPUから自動検出されるスレッド数
- すべての実行に対する完全な再現性バンドル
検証済み環境
このスキルはあらゆるショットガンメタゲノムで動作しますが、以下の環境で検証されています。
- ペルー下水メタゲノミクス研究(6サンプル、3採集サイト:リマ、クスコ、イキトス)
- 混合微生物群集を含む環境下水サンプル
- サンプルあたり2Mから15Mのペアエンドリードのリード深度
WHOクリティカルARG検出
主要な機能は、検出された耐性遺伝子をWHO優先度ティアによって分類することです。
| 優先度 | 病原体 | 耐性 |
|---|---|---|
| Critical | Acinetobacter baumannii | カルバペネム耐性 |
| Critical | Pseudomonas aeruginosa | カルバペネム耐性 |
| Critical | Enterobacteriaceae | カルバペネム耐性、第3世代セファロスポリン耐性 |
| High | Enterococcus faecium | バンコマイシン耐性 |
| High | Staphylococcus aureus | メチシリン耐性、バンコマイシン耐性 |
| High | Helicobacter pylori | クラリスロマイシン耐性 |
| High | Campylobacter | フルオロキノロン耐性 |
| High | Salmonella spp. | フルオロキノロン耐性 |
| High | Neisseria gonorrhoeae | 第3世代セファロスポリン耐性、フルオロキノロン耐性 |
| Medium | Streptococcus pneumoniae | ペニシリン非感受性 |
| Medium | Haemophilus influenzae | アンピシリン耐性 |
| Medium | Shigella spp. | フルオロキノロン耐性 |
使用方法
# フルパイプライン(分類群 + レジストーム + 機能)
python metagenomics_profiler.py \
--r1 sample_R1.fastq.gz \
--r2 sample_R2.fastq.gz \
--output metagenomics_report
# HUMAnN3をスキップ(高速化 — 分類群 + レジストームのみ)
python metagenomics_profiler.py \
--r1 sample_R1.fastq.gz \
--r2 sample_R2.fastq.gz \
--output metagenomics_report \
--skip-functional
# 単一の連結FASTQ
python metagenomics_profiler.py \
--input combined.fastq.gz \
--output metagenomics_report
# Kraken2データベースパスを指定
python metagenomics_profiler.py \
--r1 sample_R1.fastq.gz \
--r2 sample_R2.fastq.gz \
--output metagenomics_report \
--kraken2-db /path/to/kraken2_db \
--read-length 150
デモ(すぐに動作します)
python metagenomics_profiler.py --demo --output demo_report
デモでは、ペルー下水メタゲノミクス研究(6サンプル、3サイト)の事前計算済み結果を使用し、外部ツールを必要とせずにすべての図とレポートを即座に生成します。
出力例
Metagenomics Profiler — ClawBio
================================
Mode: demo (pre-computed Peru sewage data)
Samples: 6 (3 sites: Lima, Cusco, Iquitos)
Taxonomy (Kraken2 + Bracken):
Total classified: 94.2%
Top species: Escherichia coli (12.3%), Klebsiella pneumoniae (8.7%),
Pseudomonas aeruginosa (5.1%), Acinetobacter baumannii (3.9%)
Alpha Diversity:
Shannon index: 2.847
Simpson index: 0.912
Pielou evenness: 0.734
Species richness: 48
Resistome (RGI/CARD):
Total ARG hits: 247 (Perfect: 89, Strict: 158)
Drug classes: 14
WHO-Critical ARGs detected: 23
- Carbapenem resistance: NDM-1, OXA-48, KPC-3
- 3rd-gen cephalosporin resistance: CTX-M-15, CTX-M-27
Functional Pathways (HUMAnN3):
Total pathways: 312
Top: PWY-7219 (adenosine ribonucleotides de novo biosynthesis)
Figures saved to: demo_report/figures/
taxonomy_barplot.png (300 dpi)
resistome_heatmap.png (300 dpi 📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開
Shotgun Metagenomics Profiler
Comprehensive shotgun metagenomics analysis combining taxonomic classification, antimicrobial resistance gene detection, and functional pathway profiling from paired-end FASTQ files.
What it does
- Takes paired-end FASTQ files (R1, R2) or a single concatenated FASTQ as input
- Runs Kraken2 taxonomic classification against a standard database (e.g., Standard-8, PlusPF)
- Refines abundances with Bracken at species level (read re-estimation)
- Detects antimicrobial resistance genes with RGI against the CARD database
- Classifies detected ARGs by WHO critical priority pathogen association
- Optionally runs HUMAnN3 for functional pathway profiling (MetaCyc + UniRef)
- Calculates alpha diversity metrics from Bracken-adjusted species abundances:
- Shannon diversity index: H = -sum(p_i * ln(p_i)), where p_i is the proportion of classified reads assigned to species i
- Simpson diversity index: D = 1 - sum(p_i^2)
- Pielou evenness: J = H / ln(S), where S is the number of species detected
- Species richness: S = number of distinct species with at least 1 assigned read
- Generates four publication-quality figures:
- Figure 1: Taxonomy bar chart, top 20 species by relative abundance
- Figure 2: Resistome heatmap, ARG families by drug class with abundance
- Figure 3: WHO-critical ARG summary, priority-tier breakdown of detected resistance genes
- Figure 4: Alpha diversity summary (Shannon, Simpson, Pielou in a panel)
- Produces a full reproducibility bundle (commands.sh, environment.yml, checksums.sha256)
Why this exists
If you ask a general AI to "analyse a metagenome," it will:
- Not know which Kraken2 database to use or how to set confidence thresholds
- Hallucinate Bracken parameters for read-length and taxonomic level
- Miss the connection between detected ARGs and WHO priority pathogen lists
- Skip HUMAnN3 entirely (or misconfigure its database paths)
- Produce a single bar chart with no resistance context
- Skip diversity metric calculations (Shannon, Simpson, Pielou)
- Not provide a reproducibility bundle
This skill encodes the correct methodological decisions:
- Kraken2 confidence threshold of 0.2 (reduces false positives in environmental samples)
- Bracken re-estimation at species level with minimum 10 reads
- RGI MAIN with "Perfect" and "Strict" hit criteria only (no "Loose" hits)
- WHO Critical Priority Pathogen list mapped to detected ARG families
- HUMAnN3 with MetaCyc stratification for pathway-level functional context
- Thread count auto-detected from available CPUs
- Full reproducibility bundle for every run
Validated On
The skill works with any shotgun metagenome but has been validated on:
- Peru sewage metagenomics study (6 samples, 3 collection sites: Lima, Cusco, Iquitos)
- Environmental sewage samples with mixed microbial communities
- Read depths ranging from 2M to 15M paired-end reads per sample
WHO-Critical ARG Detection
A key feature is the classification of detected resistance genes by WHO priority tier:
| Priority | Pathogen | Resistance |
|---|---|---|
| Critical | Acinetobacter baumannii | Carbapenem-resistant |
| Critical | Pseudomonas aeruginosa | Carbapenem-resistant |
| Critical | Enterobacteriaceae | Carbapenem-resistant, 3rd-gen cephalosporin-resistant |
| High | Enterococcus faecium | Vancomycin-resistant |
| High | Staphylococcus aureus | Methicillin-resistant, vancomycin-resistant |
| High | Helicobacter pylori | Clarithromycin-resistant |
| High | Campylobacter | Fluoroquinolone-resistant |
| High | Salmonella spp. | Fluoroquinolone-resistant |
| High | Neisseria gonorrhoeae | 3rd-gen cephalosporin-resistant, fluoroquinolone-resistant |
| Medium | Streptococcus pneumoniae | Penicillin-non-susceptible |
| Medium | Haemophilus influenzae | Ampicillin-resistant |
| Medium | Shigella spp. | Fluoroquinolone-resistant |
Usage
# Full pipeline (taxonomy + resistome + functional)
python metagenomics_profiler.py \
--r1 sample_R1.fastq.gz \
--r2 sample_R2.fastq.gz \
--output metagenomics_report
# Skip HUMAnN3 (faster — taxonomy + resistome only)
python metagenomics_profiler.py \
--r1 sample_R1.fastq.gz \
--r2 sample_R2.fastq.gz \
--output metagenomics_report \
--skip-functional
# Single concatenated FASTQ
python metagenomics_profiler.py \
--input combined.fastq.gz \
--output metagenomics_report
# Specify Kraken2 database path
python metagenomics_profiler.py \
--r1 sample_R1.fastq.gz \
--r2 sample_R2.fastq.gz \
--output metagenomics_report \
--kraken2-db /path/to/kraken2_db \
--read-length 150
Demo (works out of the box)
python metagenomics_profiler.py --demo --output demo_report
The demo uses pre-computed results from the Peru sewage metagenomics study (6 samples, 3 sites) and generates all figures and reports instantly without requiring external tools.
Example Output
Metagenomics Profiler — ClawBio
================================
Mode: demo (pre-computed Peru sewage data)
Samples: 6 (3 sites: Lima, Cusco, Iquitos)
Taxonomy (Kraken2 + Bracken):
Total classified: 94.2%
Top species: Escherichia coli (12.3%), Klebsiella pneumoniae (8.7%),
Pseudomonas aeruginosa (5.1%), Acinetobacter baumannii (3.9%)
Alpha Diversity:
Shannon index: 2.847
Simpson index: 0.912
Pielou evenness: 0.734
Species richness: 48
Resistome (RGI/CARD):
Total ARG hits: 247 (Perfect: 89, Strict: 158)
Drug classes: 14
WHO-Critical ARGs detected: 23
- Carbapenem resistance: NDM-1, OXA-48, KPC-3
- 3rd-gen cephalosporin resistance: CTX-M-15, CTX-M-27
Functional Pathways (HUMAnN3):
Total pathways: 312
Top: PWY-7219 (adenosine ribonucleotides de novo biosynthesis)
Figures saved to: demo_report/figures/
taxonomy_barplot.png (300 dpi)
resistome_heatmap.png (300 dpi)
who_critical_args.png (300 dpi)
Reproducibility:
commands.sh | environment.yml | checksums.sha256
Pipeline Architecture
FASTQ R1 + R2
|
v
[Kraken2] --> kraken2_report.txt
|
v
[Bracken] --> bracken_species.tsv --> Figure 1: Taxonomy bar chart
|
v
[RGI MAIN] --> rgi_results.txt --> Figure 2: Resistome heatmap
| --> Figure 3: WHO-critical ARG summary
v
[HUMAnN3] --> pathabundance.tsv (optional, --skip-functional to omit)
|
v
[Report] --> report.md + figures/ + reproducibility/
Database Requirements
| Tool | Database | Size | Notes |
|---|---|---|---|
| Kraken2 | Standard-8 or PlusPF | 8-70 GB | Set via --kraken2-db or $KRAKEN2_DB |
| Bracken | (built from Kraken2 DB) | included | Read-length specific (default: 150 bp) |
| RGI | CARD | ~500 MB | Auto-downloaded via rgi auto_load |
| HUMAnN3 | ChocoPhlAn + UniRef90 | ~15 GB | Set via --humann-db or $HUMANN_DB |
Citations
If you use this skill in a publication, please cite:
- Wood, D.E., Lu, J. & Langmead, B. (2019). Improved metagenomic analysis with Kraken 2. Genome Biology, 20, 257.
- Lu, J. et al. (2017). Bracken: estimating species abundance in metagenomics data. PeerJ Computer Science, 3, e104.
- Alcock, B.P. et al. (2023). CARD 2023: expanded curation, support for machine learning, and resistome prediction at the Comprehensive Antibiotic Resistance Database. Nucleic Acids Research, 51(D1), D419-D430.
- Beghini, F. et al. (2021). Integrating taxonomic, functional, and strain-level profiling of diverse microbial communities with bioBakery 3. eLife, 10, e65088.
- Corpas, M. (2026). ClawBio. https://github.com/ClawBio/ClawBio