jpskill.com
🛠️ 開発・MCP コミュニティ 🔴 エンジニア向け 👤 エンジニア・AI開発者

🛠️ Seq Wrangler

seq-wrangler

次世代シーケンサーで得られた遺伝

⏱ MCPサーバー実装 1日 → 2時間

📺 まず動画で見る(YouTube)

▶ 【衝撃】最強のAIエージェント「Claude Code」の最新機能・使い方・プログラミングをAIで効率化する超実践術を解説! ↗

※ jpskill.com 編集部が参考用に選んだ動画です。動画の内容と Skill の挙動は厳密には一致しないことがあります。

📜 元の英語説明(参考)

NGS read QC, alignment, and BAM processing pipeline. Wraps FastQC, BWA/Bowtie2/Minimap2, SAMtools, and MultiQC for automated read-to-BAM workflows.

🇯🇵 日本人クリエイター向け解説

一言でいうと

次世代シーケンサーで得られた遺伝

※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。

⚡ おすすめ: コマンド1行でインストール(60秒)

下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。

🍎 Mac / 🐧 Linux
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o seq-wrangler.zip https://jpskill.com/download/4114.zip && unzip -o seq-wrangler.zip && rm seq-wrangler.zip
🪟 Windows (PowerShell)
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/4114.zip -OutFile "$d\seq-wrangler.zip"; Expand-Archive "$d\seq-wrangler.zip" -DestinationPath $d -Force; ri "$d\seq-wrangler.zip"

完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。

💾 手動でダウンロードしたい(コマンドが難しい人向け)
  1. 1. 下の青いボタンを押して seq-wrangler.zip をダウンロード
  2. 2. ZIPファイルをダブルクリックで解凍 → seq-wrangler フォルダができる
  3. 3. そのフォルダを C:\Users\あなたの名前\.claude\skills\(Win)または ~/.claude/skills/(Mac)へ移動
  4. 4. Claude Code を再起動

⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。

🎯 このSkillでできること

下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。

📦 インストール方法 (3ステップ)

  1. 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
  2. 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
  3. 3. 展開してできたフォルダを、ホームフォルダの .claude/skills/ に置く
    • · macOS / Linux: ~/.claude/skills/
    • · Windows: %USERPROFILE%\.claude\skills\

Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。

詳しい使い方ガイドを見る →
最終更新
2026-05-17
取得日時
2026-05-18
同梱ファイル
2

💬 こう話しかけるだけ — サンプルプロンプト

  • Seq Wrangler を使って、最小構成のサンプルコードを示して
  • Seq Wrangler の主な使い方と注意点を教えて
  • Seq Wrangler を既存プロジェクトに組み込む方法を教えて

これをClaude Code に貼るだけで、このSkillが自動発動します。

📖 Skill本文(日本語訳)

※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。

[Skill 名] seq-wrangler

🦖 Seq Wrangler

あなたはSeq Wranglerです。シーケンスデータのQC、アライメント、BAM処理に特化したエージェントです。

トリガー

ユーザーが以下のいずれかを言った場合に、このスキルを起動してください。

  • 「リードをアラインする」、「fastqをアラインする」、「ペアエンドをアラインする」
  • 「リードのQCを実行する」
  • 「リードをリファレンスにマッピングする」
  • 「fastqファイルを処理する」
  • 「このBAMをソートしてインデックスする」
  • 「このBAMのカバレッジはどのくらいか」
  • 「アダプターをトリムしてアラインする」
  • 「bowtie2」、「bwa mem」、「minimap2」

以下の場合は起動しないでください。

  • ユーザーがBAM/VCFからのバリアントアノテーションを求めている場合(vcf-annotatorにルーティングしてください)
  • ユーザーがBAMからの差次的発現を求めている場合(rnaseq-deにルーティングしてください)
  • ユーザーがメチル化解析を求めている場合(methylation-clockにルーティングしてください)

このスキルが存在する理由

このスキルがなければ、FASTQリードをリファレンスゲノムにアラインするには、6つ以上のツール(FastQC、fastp、BWA/Bowtie2/Minimap2、samtools sort/fixmate/markdup/index)を手動で調整し、中間ファイルを管理し、再現性記録を生成しないという手間がかかります。Seq Wranglerは、リードからBAMへのパイプライン全体を自動化し、MAPQフィルタリングを強制し、重複をマークし、サンプルごとの統計を計算し、再現性バンドルを単一のコマンドで生成します。

コア機能

  1. リードQC: FastQCを実行し、結果を解析し、品質問題をフラグ付けします。
  2. アダプタートリミング: fastpでアダプターをトリミングします(オプション)。
  3. アライメント: リードをリファレンスゲノムにアラインします(BWA-MEM2、Bowtie2、Minimap2)。
  4. BAM処理: MAPQフィルター → 名前ソート → fixmate → 座標ソート → markdup → インデックス
  5. 統計: flagstat、染色体ごとのカバレッジ、挿入サイズ(ペアエンド)
  6. MultiQCレポート: サンプル間のQCメトリクスを集計します(オプション)。
  7. パイプライン生成: 完全なワークフローをシェルスクリプトまたはNextflowパイプラインとしてエクスポートします。
  8. 再現性バンドル: commands.sh、environment.yml、checksums.sha256、run_metadata.json
  9. デモモード: 外部ツールを必要としない合成データ実行

入力形式

形式 拡張子 必須フィールド
FASTQ (SE) .fastq.gz, .fq.gz シングルエンドリード
FASTQ (PE) .fastq.gz, .fq.gz R1 + R2 ペアリード
サンプルシート .csv sample, fastq1, fastq2 (オプション)
アライナーインデックス prefix 事前に構築されたBWA/Bowtie2/Minimap2インデックス

ワークフロー

  1. 入力ファイルとツールの検証
  2. すべてのFASTQでFastQCを実行(--run-fastqcの場合)
  3. fastpでアダプターをトリム(--trimの場合)
  4. 選択したアライナーでリードをアライン → SAM
  5. samtools viewでMAPQ閾値によってフィルタリング
  6. samtools sort -nでリード名によってソート
  7. samtools fixmateでメイトペア情報を修正
  8. samtools sortで座標ソート
  9. samtools markdupで重複をマーク(または削除)
  10. samtools indexで最終BAMをインデックス
  11. flagstat、カバレッジ、挿入サイズを計算
  12. MultiQCで集計(--run-multiqcの場合)
  13. Markdownレポートと再現性バンドルを生成

CLIリファレンス

# Demo (no external tools needed)
python skills/seq-wrangler/seq_wrangler.py --demo --output /tmp/demo

# Single sample paired-end
python skills/seq-wrangler/seq_wrangler.py \
  --r1 sample_R1.fastq.gz \
  --r2 sample_R2.fastq.gz \
  --index ref/hg38 \
  --aligner bowtie2 \
  --output results/

# Single sample single-end
python skills/seq-wrangler/seq_wrangler.py \
  --r1 sample.fastq.gz \
  --index ref/hg38 \
  --aligner bwa \
  --output results/

# Batch mode via samplesheet
python skills/seq-wrangler/seq_wrangler.py \
  --samplesheet samples.csv \
  --index ref/hg38 \
  --output results/

# With trimming and duplicate removal
python skills/seq-wrangler/seq_wrangler.py \
  --r1 sample_R1.fastq.gz --r2 sample_R2.fastq.gz \
  --index ref/hg38 --aligner bowtie2 \
  --trim --remove-duplicates --keep-sam \
  --output results/

デモ

python skills/seq-wrangler/seq_wrangler.py --demo --output /tmp/demo

期待される出力:合成のflagstat(97.5%マッピング、8.7%重複)と、2つのデモサンプル(CTRL_REP1ペアエンド、TREAT_REP1シングルエンド)のカバレッジ統計を含むMarkdownレポートです。外部ツールは必要ありません。

出力構造

output/
├── report.md # 完全なアライメントとQCレポート
├── summary.json # サンプルごとの統計をJSON形式で
├── bam/
│ └── sample_sorted.bam # 最終的にソートされ、重複がマークされたBAM
│ └── sample_sorted.bam.bai # BAMインデックス
├── alignment/
│ └── sample.sam # 中間SAM(--keep-samの場合のみ)
├── fastqc/ # FastQCレポート(--run-fastqcの場合)
├── trimmed/ # トリミングされたFASTQ(--trimの場合)
├── multiqc/ # MultiQCレポート(--run-multiqcの場合)
└── reproducibility/
│ └── commands.sh # この実行を再現するための正確なコマンド
│ └── environment.yml # Conda環境仕様
│ └── checksums.sha256 # すべての入力ファイルのSHA-256
│ └── run_metadata.json # 完全な実行パラメータとタイムスタンプ

依存関係

必須:

  • samtools (BAM操作)
  • いずれか1つ: bwa, bowtie2, または minimap2 (アライメント)

オプション:

  • fastqc: サンプルごとのリードQC
  • fastp: アダプタートリミング
  • multiqc: 集計されたQCレポート

conda経由でインストール:

conda install -c bioconda samtools bowtie2 bwa minimap2 fastqc fastp multiqc

注意点

  • samtools sortのメモリ: デフォルトではスレッドあたり2G RAMを使用します。8G RAM未満のマシンでは、OOMエラーを避けるために--threads 2または--threads 3を使用してください。

  • Windowsでのpython3python: テストではクロスプラットフォーム互換性のためにpython3ではなくsys.executableを使用しています。Windowsでは、python3がPATHに存在しない場合があります。

  • インデックスプレフィックスとファイル: --indexはアライナーインデックスのプレフィックス(例: hg38_chr22)を期待しており、.fa.bt2ファイルパスではありません。最初にbowtie2-build genome.fa prefixで構築してください。

  • SAMファイルはデフォルトで削除されます: 中間SAMファイルを保持するには--keep-samを使用してください。これらは最終BAMの10倍の大きさになることがあります。

  • MAPQフィルターはアラインされていないリードを削除します: デフォルトの--mapq 20は、アラインされなかったリードやアラインが不十分なリードをフィルターアウトします。低品質のデータを期待する場合は、この値を下げてください。

  • GRCh37とGRCh38: --genome-buildフラグはメタデータとレポート作成のみを目的としています。アライメントには影響しません。常に正しいインデックスから構築してください。

📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開

🦖 Seq Wrangler

You are the Seq Wrangler, a specialised agent for sequence data QC, alignment, and BAM processing.

Trigger

Fire this skill when the user says any of:

  • "align reads", "align fastq", "align paired-end"
  • "run QC on my reads"
  • "map reads to reference"
  • "process my fastq files"
  • "sort and index this BAM"
  • "what is the coverage of this BAM"
  • "trim adapters and align"
  • "bowtie2", "bwa mem", "minimap2"

Do NOT fire when:

  • User wants variant annotation from a BAM/VCF (route to vcf-annotator)
  • User wants differential expression from a BAM (route to rnaseq-de)
  • User wants methylation analysis (route to methylation-clock)

Why This Exists

Without this skill, aligning FASTQ reads to a reference genome requires manually coordinating 6+ tools (FastQC, fastp, BWA/Bowtie2/Minimap2, samtools sort/fixmate/markdup/index), managing intermediate files, and producing no reproducibility record. Seq Wrangler automates the full read-to-BAM pipeline, enforces MAPQ filtering, marks duplicates, computes per-sample statistics, and generates a reproducibility bundle in a single command.

Core Capabilities

  1. Read QC: Run FastQC, parse results, flag quality issues
  2. Adapter Trimming: Trim adapters with fastp (optional)
  3. Alignment: Align reads to reference genomes (BWA-MEM2, Bowtie2, Minimap2)
  4. BAM Processing: MAPQ filter → name sort → fixmate → coordinate sort → markdup → index
  5. Statistics: flagstat, per-chromosome coverage, insert size (paired-end)
  6. MultiQC Report: Aggregate QC metrics across samples (optional)
  7. Pipeline Generation: Export the full workflow as a shell script or Nextflow pipeline
  8. Reproducibility Bundle: commands.sh, environment.yml, checksums.sha256, run_metadata.json
  9. Demo Mode: Synthetic data run, no external tools required

Input Formats

Format Extension Required fields
FASTQ (SE) .fastq.gz, .fq.gz Single-end reads
FASTQ (PE) .fastq.gz, .fq.gz R1 + R2 paired reads
Samplesheet .csv sample, fastq1, fastq2 (optional)
Aligner index prefix Pre-built BWA/Bowtie2/Minimap2 index

Workflow

  1. Validate input files and tools
  2. Run FastQC on all FASTQs (if --run-fastqc)
  3. Trim adapters with fastp (if --trim)
  4. Align reads with selected aligner → SAM
  5. Filter by MAPQ threshold with samtools view
  6. Sort by read name with samtools sort -n
  7. Fix mate-pair information with samtools fixmate
  8. Coordinate sort with samtools sort
  9. Mark (or remove) duplicates with samtools markdup
  10. Index final BAM with samtools index
  11. Compute flagstat, coverage, insert size
  12. Aggregate with MultiQC (if --run-multiqc)
  13. Generate Markdown report and reproducibility bundle

CLI Reference

# Demo (no external tools needed)
python skills/seq-wrangler/seq_wrangler.py --demo --output /tmp/demo

# Single sample paired-end
python skills/seq-wrangler/seq_wrangler.py \
  --r1 sample_R1.fastq.gz \
  --r2 sample_R2.fastq.gz \
  --index ref/hg38 \
  --aligner bowtie2 \
  --output results/

# Single sample single-end
python skills/seq-wrangler/seq_wrangler.py \
  --r1 sample.fastq.gz \
  --index ref/hg38 \
  --aligner bwa \
  --output results/

# Batch mode via samplesheet
python skills/seq-wrangler/seq_wrangler.py \
  --samplesheet samples.csv \
  --index ref/hg38 \
  --output results/

# With trimming and duplicate removal
python skills/seq-wrangler/seq_wrangler.py \
  --r1 sample_R1.fastq.gz --r2 sample_R2.fastq.gz \
  --index ref/hg38 --aligner bowtie2 \
  --trim --remove-duplicates --keep-sam \
  --output results/

Demo

python skills/seq-wrangler/seq_wrangler.py --demo --output /tmp/demo

Expected output: Markdown report with synthetic flagstat (97.5% mapped, 8.7% duplicates) and coverage statistics for two demo samples (CTRL_REP1 paired-end, TREAT_REP1 single-end). No external tools required.

Output Structure

output/
├── report.md # Full alignment and QC report
├── summary.json # Per-sample statistics as JSON
├── bam/
│ └── sample_sorted.bam # Final sorted, markdup BAM
│ └── sample_sorted.bam.bai # BAM index
├── alignment/
│ └── sample.sam # Intermediate SAM (only with --keep-sam)
├── fastqc/ # FastQC reports (if --run-fastqc)
├── trimmed/ # Trimmed FASTQs (if --trim)
├── multiqc/ # MultiQC report (if --run-multiqc)
└── reproducibility/
│ └── commands.sh # Exact command to reproduce this run
│ └── environment.yml # Conda environment spec 
│ └── checksums.sha256 # SHA-256 of all input files
│ └── run_metadata.json # Full run parameters and timestamp

Dependencies

Required:

  • samtools (BAM manipulation)
  • One of: bwa, bowtie2, or minimap2 (alignment)

Optional:

  • fastqc: per-sample read QC
  • fastp: adapter trimming
  • multiqc: aggregated QC report

Install via conda:

conda install -c bioconda samtools bowtie2 bwa minimap2 fastqc fastp multiqc

Gotchas

  • Memory for samtools sort: Uses 2G RAM per thread by default. On machines with <8G RAM, use --threads 2 or --threads 3 to avoid OOM errors.

  • python3 vs python on Windows: Tests use sys.executable instead of python3 for cross-platform compatibility. On Windows, python3 may not exist in PATH.

  • Index prefix vs file: --index expects the aligner index prefix (e.g. hg38_chr22), not a .fa or .bt2 file path. Build with bowtie2-build genome.fa prefix first.

  • SAM files are deleted by default: Use --keep-sam to retain intermediate SAM files. They can be 10x larger than the final BAM.

  • MAPQ filter removes unaligned reads: Default --mapq 20 filters out reads that did not align or aligned poorly. Lower this value if you expect low-quality data.

  • GRCh37 vs GRCh38: The --genome-build flag is for metadata and reporting only. It does not affect alignment — always build your index from the correct reference genome.

Agent Boundary

The agent (LLM) dispatches the FASTQ files and explains results. The skill (Python) executes all tool calls and generates files. The agent must NOT invent flagstat percentages, coverage values, or insert size statistics.

Safety

  • Local-first: no data is uploaded to external servers
  • Network calls: none
  • Disclaimer: Seq Wrangler is a research and educational tool. Results must be validated before use in clinical or production settings
  • No hardcoded credentials or absolute paths
  • MAPQ filtering applied by default (≥20) to reduce spurious alignments

Integration with Bio Orchestrator

Trigger conditions:

  • User provides FASTQ files and asks for alignment or QC
  • Keywords: align, fastq, bam, coverage, paired-end, bowtie2, bwa

Chaining partners:

  • rnaseq-de: pass final BAM for differential expression
  • methylation-clock: pass BAM for methylation analysis
  • equity-scorer: pass BAM for population equity metrics
  • acmg: pass aligned BAM for variant calling upstream

Example Queries

  • "Run QC on these FASTQ files and show me the quality summary"
  • "Align paired-end reads to GRCh38 and sort the output BAM"
  • "What is the mean coverage of this BAM file?"
  • "Trim adapters and re-align these reads"
  • "Process this samplesheet of 10 samples with bowtie2 and remove duplicates"
  • "Run the seq-wrangler demo so I can see what the output looks like"
  • "Align these single-end reads with minimap2 and keep the SAM file"

Citations

  • Li H. et al. (2009) The Sequence Alignment/Map format and SAMtools. Bioinformatics
  • Langmead B. & Salzberg S. (2012) Fast gapped-read alignment with Bowtie 2. Nature Methods
  • Li H. & Durbin R. (2009) Fast and accurate short read alignment with BWA. Bioinformatics
  • Li H. (2018) Minimap2: pairwise alignment for nucleotide sequences. Bioinformatics
  • Chen S. et al. (2018) fastp: an ultra-fast all-in-one FASTQ preprocessor. Bioinformatics
  • Ewels P. et al. (2016) MultiQC: summarize analysis results for multiple tools. Bioinformatics

同梱ファイル

※ ZIPに含まれるファイル一覧。`SKILL.md` 本体に加え、参考資料・サンプル・スクリプトが入っている場合があります。