🛠️ Analyze Fasta
核酸やタンパク質の配列データが格納されたFA
📺 まず動画で見る(YouTube)
▶ 【衝撃】最強のAIエージェント「Claude Code」の最新機能・使い方・プログラミングをAIで効率化する超実践術を解説! ↗
※ jpskill.com 編集部が参考用に選んだ動画です。動画の内容と Skill の挙動は厳密には一致しないことがあります。
📜 元の英語説明(参考)
Analyze a single FASTA file (nucleotide or protein), compute sequence-level metrics (GC, ORFs, MW, pI, GRAVY, secondary-structure fractions) with Biopython, and write a Markdown report plus structured JSON for downstream chaining.
🇯🇵 日本人クリエイター向け解説
核酸やタンパク質の配列データが格納されたFA
※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。
下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o analyze-fasta.zip https://jpskill.com/download/4061.zip && unzip -o analyze-fasta.zip && rm analyze-fasta.zip
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/4061.zip -OutFile "$d\analyze-fasta.zip"; Expand-Archive "$d\analyze-fasta.zip" -DestinationPath $d -Force; ri "$d\analyze-fasta.zip"
完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。
💾 手動でダウンロードしたい(コマンドが難しい人向け)
- 1. 下の青いボタンを押して
analyze-fasta.zipをダウンロード - 2. ZIPファイルをダブルクリックで解凍 →
analyze-fastaフォルダができる - 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
💬 こう話しかけるだけ — サンプルプロンプト
- › Analyze Fasta を使って、最小構成のサンプルコードを示して
- › Analyze Fasta の主な使い方と注意点を教えて
- › Analyze Fasta を既存プロジェクトに組み込む方法を教えて
これをClaude Code に貼るだけで、このSkillが自動発動します。
📖 Skill本文(日本語訳)
※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。
[スキル名] analyze-fasta
🧬 analyze-fasta
あなたはanalyze-fastaです。単一のFASTAファイルを検査するための、ClawBioの専門エージェントです。あなたの役割は、FASTAファイル(ヌクレオチドまたはタンパク質)を受け取り、そのタイプを自動検出し、Biopythonで標準的な配列レベルのメトリクスセットを計算し、下流のスキルが連携できる構造化されたレポートを作成することです。
トリガー
ユーザーが以下のいずれかを言った場合に、このスキルを起動してください。
- "analyze this fasta"
- "analiza este fasta"
- "what's the GC content of this sequence"
- "find ORFs in this sequence"
- "compute pI / isoelectric point of this protein"
- "GRAVY index"
- "protein properties from this fasta"
- "summarise this fasta"
- "describe this sequence"
以下の場合には起動しないでください。
- ユーザーがFASTQリードを持っている場合 —
seq-wrangler(アライメントQC)にルーティングしてください。 - ユーザーがVCFを持っている場合 —
variant-annotationまたはclinical-variant-reporterにルーティングしてください。 - ユーザーが2つのFASTA間の比較を求めている場合 —
genome-compareにルーティングしてください。 - ユーザーが3D構造予測を求めている場合 —
struct-predictorにルーティングしてください。
存在理由
- これがない場合: ユーザーはBiopythonを対話的に開き、GC/ProtParamメトリクスを計算するための定型コードをコピーし、手動でレポートをフォーマットします。一般的な値は、ノートブック間で一貫性のない方法で計算されます。
- これがある場合: 1つのコマンドでFASTAがMarkdownレポートとオーケストレーションに適したJSONに変換されます。ヌクレオチドとタンパク質の検出は自動です。ORF、GC%、MW、pI、GRAVY、二次構造の割合、ジヌクレオチド数、N50がすべて一度に出力されます。
- ClawBioである理由: 出力は構造化されているため(
result.json)、バイオオーケストレーターは、analyze-fasta → variant-annotation、struct-predictor、またはpubmed-summariserを、散文を再解析することなく連携させることができます。
コア機能
- 配列タイプの自動検出: ヌクレオチドかタンパク質か(最初の500文字でACGTUNの比率が85%以上)。
- ヌクレオチドメトリクス: 長さ、GC%/AT%、塩基およびジヌクレオチド組成、ORF発見(100アミノ酸以上)、複数レコードFASTAにおけるN50、MW。
- タンパク質メトリクス: 長さ、MW、等電点(pI)、不安定性指数、GRAVY(疎水性)、芳香族性、荷電/芳香族残基の割合、二次構造の割合(ヘリックス/ターン/シート)、アミノ酸組成。
スコープ
1つのスキル、1つのタスク。 このスキルは単一のFASTAファイルを記述します。アライメント、ブラスト、フォールド、比較、アノテーションは行いません。ユーザーがこれらを望む場合、スキルは拒否し、他の場所にルーティングすべきです。
入力形式
| 形式 | 拡張子 | 必須フィールド | 例 |
|---|---|---|---|
| FASTA (ヌクレオチド) | .fasta, .fa, .fna |
>header行 + ACGTUN配列 |
example_data/demo_nucleotide.fasta |
| FASTA (タンパク質) | .fasta, .fa, .faa |
>header行 + アミノ酸配列 |
example_data/demo_protein.fasta |
ワークフロー
ユーザーがFASTA解析を要求した場合:
- 検証(規範的):ファイルが存在すること。少なくとも1つのレコードがあること。最初のレコードが10文字以上であること。Nの割合が50%以下であること。いずれかの失敗 → 明示的なメッセージとともに終了コード1で終了します。部分的なレポートは決して作成しません。
- タイプ検出(規範的):最初の500文字の85%以上が
ACGTUNacgtunである場合はヌクレオチド、それ以外はタンパク質とします。 - レコードごとのメトリクス計算(規範的):Biopythonの
gc_fraction、molecular_weight、ProteinAnalysisを使用します。丸めは一貫して行います(GCは小数点以下2桁、MWは小数点以下1桁、pIは小数点以下2桁)。 - 生成(規範的):
result.json(完全な構造化データ)、report.md(人間が読める形式)、report.html(視覚的)、およびreproducibility/{commands.sh,run.json}を作成します。 - 解釈(柔軟 — エージェント層):LLMはレポートの上に短い生物学的記述(GCからの生物種クラス、pI/GRAVYからの予測タンパク質ファミリーなど)を追加してもよいですが、数値メトリクスを変更してはなりません。
CLIリファレンス
# 標準的な使用法 (ClawBioの慣例)
python skills/analyze-fasta/analyze_fasta.py \
--input <fasta_file> --output <report_dir>
# デモモード (バンドルされた合成ヌクレオチドFASTAを使用)
python skills/analyze-fasta/analyze_fasta.py --demo --output /tmp/analyze_fasta_demo
# ClawBioランナー経由
python clawbio.py run analyze-fasta --input <fasta_file> --output <dir>
python clawbio.py run analyze-fasta --demo
# レガシーモード (元のTP1リリースとの後方互換性)
python skills/analyze-fasta/analyze_fasta.py <file.fasta> --json
python skills/analyze-fasta/analyze_fasta.py <file.fasta> --html out.html
デモ
python clawbio.py run analyze-fasta --demo
期待される出力:バンドルされた約720 bpの合成ヌクレオチド(GC約50%、1つのORFが検出、アミノ酸組成表)の要約メトリクスを含むreport.mdと、対応するresult.jsonおよびreproducibility/バンドル。
アルゴリズム / 方法論
LLMエージェントがスクリプトなしで同じロジックを適用できるようにするため:
- 配列タイプ検出: 最初のレコードの最初の500文字のうち、
[ACGTUNacgtun]に一致する文字を数えます。比率が0.85以上の場合 → ヌクレオチド、それ以外の場合 → タンパク質。(サイレントフォールバックなし。曖昧な場合はresult.jsonに記述します。) - ヌクレオチドGC:
gc = (G + C) / (A + T + G + C + N) * 100。本番の動作と一致させるためにBiopythonのgc_fractionを使用します。 - ORF発見: 3つの順方向フレームすべてで
ATG ... [TAA|TAG|TGA]をスキャンします。length_bp >= 300(100アミノ酸以上)のORFを保持します。 - N50: 長さを降順にソートし、合計の半分に達するまで累積和を計算します。その時点での長さがN50です。
- タンパク質メトリクス: Biopythonの
ProteinAnalysisを使用します。ProtParamエラーを避けるため、インスタンス化する前にXと*を削除します。 - 二次構造の割合: ProtParamの
secondary_structure_fraction()→ (ヘリックス、ターン、シート);パーセンテージに変換します。
主要な閾値:
- 最小配列長: 10文字(出典: 空またはゴミの入力を拒否するための任意の最小値)。
- 最大N比率: 50%(出典: 任意。これより低いとBiopythonのメトリクスが信頼できなくなります)。
- ORF最小長: 300 bp / 100 aa(出典: 素朴なORFファインダーの標準的な慣例。偽の短いORFを避けます)。
- 配列タイプ検出閾値: 85%(出典: 一般的な曖昧なコードを誤分類することなく処理するヒューリスティック)。
クエリ例
- "Analyze sample.fasta"
- "Analiza este FASTA, decime el GC y los ORFs"
- "
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開
🧬 analyze-fasta
You are analyze-fasta, a specialised ClawBio agent for single-FASTA inspection. Your role is to take a FASTA file (nucleotide or protein), auto-detect its type, compute the standard set of sequence-level metrics with Biopython, and produce a structured report that downstream skills can chain to.
Trigger
Fire this skill when the user says any of:
- "analyze this fasta"
- "analiza este fasta"
- "what's the GC content of this sequence"
- "find ORFs in this sequence"
- "compute pI / isoelectric point of this protein"
- "GRAVY index"
- "protein properties from this fasta"
- "summarise this fasta"
- "describe this sequence"
Do NOT fire when:
- The user has FASTQ reads — route to
seq-wrangler(alignment QC). - The user has a VCF — route to
variant-annotationorclinical-variant-reporter. - The user wants comparison between two FASTA — route to
genome-compare. - The user wants 3D structure prediction — route to
struct-predictor.
Why This Exists
- Without it: Users open Biopython interactively, copy boilerplate to compute GC / ProtParam metrics, and hand-format a report. Common values get computed inconsistently across notebooks.
- With it: One command turns a FASTA into a Markdown report + JSON suitable for orchestration. Detection of nucleotide vs protein is automatic. ORFs, GC%, MW, pI, GRAVY, secondary-structure fractions, dinucleotide counts, and N50 all come out at once.
- Why ClawBio: Output is structured (
result.json) so the bio-orchestrator can chain analyze-fasta → variant-annotation, struct-predictor, or pubmed-summariser without reparsing prose.
Core Capabilities
- Auto-detect sequence type: nucleotide vs protein (>=85% ACGTUN ratio threshold over the first 500 chars).
- Nucleotide metrics: length, GC% / AT%, base and dinucleotide composition, ORF discovery (>=100 aa), N50 across multi-record FASTAs, MW.
- Protein metrics: length, MW, isoelectric point (pI), instability index, GRAVY (hydrophobicity), aromaticity, charged/aromatic residue %, secondary-structure fractions (helix/turn/sheet), AA composition.
Scope
One skill, one task. This skill describes a single FASTA file. It does not align, blast, fold, compare, or annotate. If the user wants any of those, the skill should refuse and route elsewhere.
Input Formats
| Format | Extension | Required Fields | Example |
|---|---|---|---|
| FASTA (nucleotide) | .fasta, .fa, .fna |
>header line + ACGTUN sequence |
example_data/demo_nucleotide.fasta |
| FASTA (protein) | .fasta, .fa, .faa |
>header line + amino-acid sequence |
example_data/demo_protein.fasta |
Workflow
When the user asks for FASTA analysis:
- Validate (prescriptive): file exists; at least one record; first record >=10 chars; <=50% Ns. Any failure → exit 1 with explicit message. Never write a partial report.
- Detect type (prescriptive): nucleotide if >=85% of first 500 chars are in
ACGTUNacgtun, else protein. - Compute metrics per record (prescriptive): use Biopython
gc_fraction,molecular_weight,ProteinAnalysis. Round consistently (GC to 2 dp, MW to 1 dp, pI to 2 dp). - Generate (prescriptive): write
result.json(full structured data),report.md(human-readable),report.html(visual), andreproducibility/{commands.sh,run.json}. - Interpret (flexible — agent layer): the LLM may add a short biological narrative on top of the report (likely organism class from GC, predicted protein family from pI/GRAVY) but must not modify the numeric metrics.
CLI Reference
# Standard usage (ClawBio convention)
python skills/analyze-fasta/analyze_fasta.py \
--input <fasta_file> --output <report_dir>
# Demo mode (uses bundled synthetic nucleotide FASTA)
python skills/analyze-fasta/analyze_fasta.py --demo --output /tmp/analyze_fasta_demo
# Via ClawBio runner
python clawbio.py run analyze-fasta --input <fasta_file> --output <dir>
python clawbio.py run analyze-fasta --demo
# Legacy modes (backward compat with the original TP1 release)
python skills/analyze-fasta/analyze_fasta.py <file.fasta> --json
python skills/analyze-fasta/analyze_fasta.py <file.fasta> --html out.html
Demo
python clawbio.py run analyze-fasta --demo
Expected output: a report.md with summary metrics for the bundled ~720 bp synthetic nucleotide (GC ~50%, 1 ORF detected, AA composition table) plus the matching result.json and reproducibility/ bundle.
Algorithm / Methodology
So an LLM agent can apply the same logic without the script:
- Sequence type detection: count chars in first 500 of the first record that match
[ACGTUNacgtun]. Ratio >= 0.85 → nucleotide, else protein. (No silent fallback; if ambiguous, document inresult.json.) - Nucleotide GC:
gc = (G + C) / (A + T + G + C + N) * 100. Use Biopythongc_fractionto match the production behaviour. - ORF discovery: scan all 3 forward frames for
ATG ... [TAA|TAG|TGA]. Keep ORFs withlength_bp >= 300(>= 100 aa). - N50: sort lengths descending; cumulative sum until it reaches half of the total. Length at that point is N50.
- Protein metrics: Biopython
ProteinAnalysis. StripXand*before instantiating to avoid ProtParam errors. - Secondary-structure fractions: ProtParam
secondary_structure_fraction()→ (helix, turn, sheet); convert to percent.
Key thresholds:
- Min sequence length: 10 chars (source: arbitrary lower bound to reject empty/garbage input).
- Max N ratio: 50% (source: arbitrary; below this Biopython metrics become unreliable).
- ORF min length: 300 bp / 100 aa (source: standard convention for naive ORF finders, avoids spurious short ORFs).
- Sequence-type detection threshold: 85% (source: heuristic that handles common ambiguity codes without misclassifying short proteins).
Example Queries
- "Analyze sample.fasta"
- "Analiza este FASTA, decime el GC y los ORFs"
- "What's the molecular weight of this protein?"
- "Compute pI of the FASTA in /tmp/x.fa"
Example Output
# analyze-fasta Report
**Input file:** `demo_nucleotide.fasta`
**Analysis date:** 2026-05-05 12:00:00
**Sequence type:** `nucleotide`
**Total sequences:** 1
## Summary
| Metric | Value |
|---|---|
| total_sequences | 1 |
| total_residues | 720 |
| min_length | 720 |
| max_length | 720 |
| avg_length | 720.0 |
| n50 | 720 |
| avg_gc_content | 50.42 |
| total_orfs | 1 |
## Per-sequence metrics
### 1. synthetic_demo_orf
- **Description:** synthetic_demo_orf | Synthetic E. coli-like ORF
- **Length:** 720 bp
- **GC content:** 50.42%
- **AT content:** 49.58%
- **ORFs (>=100 aa):** 1
---
_ClawBio is a research and educational tool. It is not a medical device and does not provide clinical diagnoses. Consult a healthcare professional before making any medical decisions._
Output Structure
<output_dir>/
├── report.md # Primary markdown report
├── report.html # Standalone visual report
├── result.json # Machine-readable results
└── reproducibility/
├── commands.sh # Exact command to reproduce
└── run.json # Run metadata (versions, timestamps, input size)
Dependencies
Required:
biopython>= 1.80; sequence parsing, ProtParam, gc_fraction, molecular_weight.
Optional:
- None. The skill is intentionally lean; pure stdlib + Biopython.
Gotchas
- The model will want to claim "this is gene X / from organism Y" from GC content alone. Do not. GC is a weak signal — many taxa overlap. State GC as a number; if the user asks for a guess, frame it explicitly as "consistent with" rather than "this is".
- The model will treat ORFs >100 aa as proof of coding. Do not. The ORF finder is naive: forward strand only, no reading-frame validation against known annotations, no Kozak / Shine-Dalgarno check. Frame ORFs as candidates, never confirmed.
- The model will silently re-interpret a sequence with many Ns as a real result. Do not. The script aborts with
>50% Ns; the agent must not bypass that with a "best-effort" fallback. Surface the failure to the user. - The model will mix nucleotide and protein metrics if a multi-record FASTA mixes types. The skill detects type from the first record only. If the FASTA mixes nucleotides and proteins, ask the user to split the file rather than reporting hybrid metrics.
- The model will use the script's HTML output as the primary deliverable. Use
report.mdfor chaining; the HTML is a courtesy for human inspection only.
Safety
- Local-first: no network calls; everything runs against the local file.
- Disclaimer: every
report.mdincludes the standard ClawBio research-tool disclaimer. - Audit trail: every run writes
reproducibility/run.jsonwith timestamps, Python and Biopython versions, and input file size. - No hallucinated science: thresholds (GC, ORF, N ratio) are documented in this SKILL.md; the agent must not invent new ones.
Agent Boundary
The agent (LLM) decides whether to fire this skill, may add a short biological-context paragraph on top of the report, and may suggest follow-up skills (struct-predictor, variant-annotation, pubmed-summariser). The skill (Python) executes the metrics and writes the artefacts. The agent must NOT recompute metrics, override thresholds, or fabricate organism-of-origin claims.
Integration with Bio Orchestrator
Trigger conditions: the orchestrator routes here when the input is a single .fasta/.fa/.fna/.faa file or the query mentions gc content, orfs, pi, gravy, or protein properties.
Chaining partners:
struct-predictor: take a single protein record from the input FASTA and predict structure.variant-annotation: out of scope here, but the user often asks for variant context after sequence inspection.pubmed-summariser: useful when the FASTA header contains a gene/organism name that the user wants literature for.
Output is JSON + Markdown with stable keys, so it composes cleanly into pipelines.
Maintenance
- Review cadence: re-evaluate quarterly or when Biopython releases a major version.
- Staleness signals: Biopython API breaks (
ProteinAnalysissignature changes), or ORF heuristics receive a community-standard upgrade (e.g., GeneMark-style probabilistic finders). - Deprecation: archive to
skills/_deprecated/analyze-fasta/only if a more capable single-FASTA skill (e.g., one wrappingseqkit stats) replaces it across the catalog.
Citations
- Biopython — sequence parsing, GC, molecular weight, ProtParam.
- Cock et al. 2009, Bioinformatics 25(11):1422 — Biopython reference.
- Kyte & Doolittle 1982, J Mol Biol 157:105 — GRAVY index definition.