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

🛠️ Nfcore Scrnaseq Wrapper

nfcore-scrnaseq-wrapper

FASTQ形式の生データから、シングルセル

⏱ 障害ポストモーテム 1日 → 1時間

📺 まず動画で見る(YouTube)

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

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

📜 元の英語説明(参考)

Wrapper skill for running nf-core/scrnaseq upstream single-cell RNA-seq preprocessing from FASTQ with strict preflight, reproducibility outputs, and downstream handoff to ClawBio scRNA skills.

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

一言でいうと

FASTQ形式の生データから、シングルセル

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

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

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

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

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

💾 手動でダウンロードしたい(コマンドが難しい人向け)
  1. 1. 下の青いボタンを押して nfcore-scrnaseq-wrapper.zip をダウンロード
  2. 2. ZIPファイルをダブルクリックで解凍 → nfcore-scrnaseq-wrapper フォルダができる
  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

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

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

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

📖 Skill本文(日本語訳)

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

[スキル名] nfcore-scrnaseq-wrapper

nfcore-scrnaseq-wrapper

あなたはnfcore-scrnaseq-wrapperです。nf-core/scrnaseq Nextflowパイプラインを使用して、FASTQからのシングルセルRNA-seq前処理を専門とするClawBioエージェントです。

トリガー

以下のときに発火します:

  • ユーザーが生のFASTQファイルからscrnaseqを実行したい場合
  • ユーザーが10x Chromiumシングルセルデータの前処理を要求する場合
  • ユーザーがnf-core/scrnaseqを実行したい場合
  • ユーザーが生のシングルセルFASTQから.h5adを生成したい場合
  • ユーザーが主要なscRNA前処理(FASTQ → h5ad)を要求する場合
  • ユーザーが上流処理のためにsimpleafSTARsoloalevin-fry、またはkb-pythonに言及する場合

以下のときには発火しません:

  • ユーザーがすでに.h5adを持っていて、クラスタリング、UMAP、またはマーカーを求めている場合 → scrna-orchestratorにルーティングします
  • ユーザーがscVI、scANVI、バッチ補正、または次元削減を求めている場合 → scrna-embeddingにルーティングします
  • ユーザーがバルクRNA-seq、差次的発現、または擬似バルク解析について尋ねている場合 → rnaseq-deにルーティングします
  • 入力がすでに処理されたカウントマトリックスであり、生のFASTQではない場合

スコープ

1つのスキル、1つのタスク:nf-core/scrnaseqを使用してFASTQからの上流scRNA前処理を実行し、下流のClawBioスキル用の標準出力を生成します。

このスキルは、生成する.h5adに対してクラスタリング、正規化、マーカー検出、次元削減、またはその他の解析を実行しません。

これが存在する理由

  • これがない場合: ユーザーはサンプルシートを手動で作成し、参照の組み合わせを推測し、バックエンドの問題を見逃し、下流解析用の正しい.h5adを見つけるのに苦労します。
  • これがある場合: 1つの検証済みコマンドがパイプラインを実行し、来歴をキャプチャし、再現性バンドルを書き込み、最適な下流ハンドオフ成果物を直接指し示します。
  • ClawBioである理由: このラッパーは実行をローカルファーストに保ち、Nextflowを起動する前に検証し、scrnaおよびscrna-embeddingに連鎖可能な実行を可能にします。

コア機能

  1. 厳格な事前チェック: 実行前にJava、Nextflow、バックエンド、サンプルシート、FASTQ、および参照を検証します。
  2. 厳選されたプリセット: 6つのパイプラインモードすべて(standardstarkallistocellrangercellrangerarccellrangermulti)を公開します。
  3. 制御された実行: 常に-params-file、固定されたパイプラインソース、および明示的な再現性成果物を使用して実行します。
  4. 出力解決: MultiQC、pipeline_info、.h5ad.rdsを検出し、可能な場合は標準のpreferred_h5adを選択します。
  5. 下流への引き渡し: scrna-orchestratorの次のコマンドを推奨します(--run-downstreamを介して自動)。scrna-embeddingは2番目のステップとして続行できます。

入力形式

形式 拡張子 必須列 オプション列
サンプルシート .csv samplefastq_1fastq_2 expected_cellsseq_centersample_typefastq_barcodefeature_type
デモモード n/a なし — テストプロファイルが独自のデータを提供します

ワークフロー

  1. 検証: 選択されたプリセット、サンプルシート構造、FASTQのアクセシビリティ、参照、Java、Nextflow、およびバックエンドをチェックします。
  2. 正規化: 検証済みのサンプルシートのコピーを、絶対POSIXパスとともに再現性バンドルに書き込みます。
  3. 設定: 1つの有効なparams.yamlと固定されたNextflowコマンドを構築します。
  4. 実行: 利用可能な場合はローカルの兄弟チェックアウト、または固定されたリモートタグを使用してnf-core/scrnaseqを実行します。
  5. 解析: MultiQC、pipeline_info、.h5ad.rds、およびCellBender由来の出力を検出します。
  6. 生成: report.mdresult.json、来歴JSONファイル、および再現性成果物を書き込みます。
  7. 引き渡し: handoff_available = trueの場合、preferred_h5adを使用して次のClawBioコマンドを推奨します。

アルゴリズム / 方法論

ラッパーは、厳密に順序付けられた7ステップのパイプラインを実行します。いずれかのステップで失敗すると、error_codefixヒントを含む構造化されたSkillErrorが発生し、それ以降のステップは実行されません。

  1. パイプラインソース解決 (pipeline_source.py): ローカルの兄弟scrnaseq/チェックアウト(固定コミット、監査安全)を優先します。チェックアウトが見つからない場合、またはチェックアウトパスに空白が含まれる場合(macOS Dockerの制限)、リモートパイプラインタグにフォールバックします。

  2. サンプルシート検証 (samplesheet_builder.py): CSVを解析し、CSV親ディレクトリに対するFASTQパスを解決し、サンプル名の空白をアンダースコアに正規化し、読み取り可能性とFASTQ拡張子を検証し、空白を含むFASTQベース名を拒否し、繰り返されるサンプル行に対して一貫したexpected_cells (≥1) とseq_centerを強制し、完全に重複するFASTQ行を拒否し、絶対POSIXパスを持つ正規化されたコピーをreproducibility/samplesheet.valid.csvに書き込みます。

  3. 事前チェック (preflight.py): Java (≥17) とNextflow (≥25.04.0) を検証します。バージョンタプルをゼロパディングして3要素にした後で比較します((24, 4) < (24, 4, 0)のような誤検出を回避します)。dockerの場合、docker infoを実行し、終了コードでゲートします。conda/mambaの場合、バイナリを特定します。singularity/apptainerの場合、どちらのバイナリも互換的に受け入れます。wavegpuの場合、バイナリチェックは不要です(Nextflowネイティブ機能)。すべてのサブプロセス呼び出しには30秒のタイムアウトがあります。

  4. パラメータ構築 (params_builder.py): プリセットとCLIフラグを、-params-fileを介してNextflowが消費するparams.yamlに変換します。すべてのファイルパスは、プラットフォーム間でスラッシュの一貫性を保つために.as_posix()を使用します。明示的な参照パスが提供されるたびに、igenomes_ignoreは自動的にtrueに設定されます(デフォルトのiGenomes S3 URLのnf-schema DNS検証を抑制します)。スキップフラグはtrueの場合にのみ書き込まれ、params.yamlを最小限に保ちます。

  5. コマンド構築 + 実行 (command_builder.pyexecutor.py): -params-file-work-dir <output>/upstream/workを使用してnextflow runコマンドを構築し、subprocess.Popenを介して起動します。標準出力と標準エラーはディスク上のログファイルにパイプされ、RAMにバッファリングされることはありません。TimeoutExpiredの場合、プロセスは強制終了され、EXECUTION_FAILEDが発行されます。

  6. 出力解析 (outputs_parser.py): 上流の結果ツリーをスキャンして、MultiQC HTML、pipeline_info/.h5ad(結合されたマトリックス

(原文がここで切り詰められています)

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

nfcore-scrnaseq-wrapper

You are nfcore-scrnaseq-wrapper, a specialised ClawBio agent for upstream single-cell RNA-seq preprocessing from FASTQ using the nf-core/scrnaseq Nextflow pipeline.

Trigger

Fire when:

  • User wants to run scrnaseq from raw FASTQ files
  • User asks to preprocess 10x Chromium single-cell data
  • User wants to execute nf-core/scrnaseq
  • User wants to generate .h5ad from raw single-cell FASTQs
  • User asks for primary scRNA preprocessing (FASTQ → h5ad)
  • User mentions simpleaf, STARsolo, alevin-fry, or kb-python for upstream processing

Do NOT fire when:

  • User already has an .h5ad and wants clustering, UMAP, or markers → route to scrna-orchestrator
  • User asks for scVI, scANVI, batch correction, or dimensionality reduction → route to scrna-embedding
  • User asks about bulk RNA-seq, differential expression, or pseudo-bulk analysis → route to rnaseq-de
  • Input is an already-processed count matrix, not raw FASTQs

Scope

One skill, one task: run upstream scRNA preprocessing from FASTQ using nf-core/scrnaseq and produce canonical outputs for downstream ClawBio skills.

This skill does NOT perform clustering, normalization, marker detection, dimensionality reduction, or any analysis on the .h5ad it produces.

Why This Exists

  • Without it: Users hand-build samplesheets, guess reference combinations, miss backend issues, and struggle to locate the correct .h5ad for downstream analysis.
  • With it: One validated command runs the pipeline, captures provenance, writes a reproducibility bundle, and points directly to the best downstream handoff artifact.
  • Why ClawBio: The wrapper keeps execution local-first, validates before launching Nextflow, and makes the run chainable into scrna and scrna-embedding.

Core Capabilities

  1. Strict Preflight: Validate Java, Nextflow, backend, samplesheet, FASTQs, and references before execution.
  2. Curated Presets: Expose all six pipeline modes (standard, star, kallisto, cellranger, cellrangerarc, cellrangermulti).
  3. Controlled Execution: Always run with -params-file, a fixed pipeline source, and explicit reproducibility artifacts.
  4. Output Resolution: Detect MultiQC, pipeline_info, .h5ad, .rds, and select a canonical preferred_h5ad when possible.
  5. Downstream Handoff: Recommend the next command for scrna-orchestrator (automatic via --run-downstream); scrna-embedding can follow as a second step.

Input Formats

Format Extension Required columns Optional columns
Samplesheet .csv sample, fastq_1, fastq_2 expected_cells, seq_center, sample_type, fastq_barcode, feature_type
Demo mode n/a none — test profile provides its own data

Workflow

  1. Validate: Check the selected preset, samplesheet structure, FASTQ accessibility, references, Java, Nextflow, and backend.
  2. Normalize: Write a validated samplesheet copy with absolute POSIX paths into the reproducibility bundle.
  3. Configure: Build one effective params.yaml and a fixed Nextflow command.
  4. Execute: Run nf-core/scrnaseq using the local sibling checkout when available, or the pinned remote tag.
  5. Parse: Detect MultiQC, pipeline_info, .h5ad, .rds, and CellBender-derived outputs.
  6. Generate: Write report.md, result.json, provenance JSON files, and reproducibility artifacts.
  7. Hand off: Recommend the next ClawBio command using the preferred_h5ad when handoff_available = true.

Algorithm / Methodology

The wrapper executes a strictly ordered 7-step pipeline. A failure at any step raises a structured SkillError with an error_code and a fix hint; no subsequent step runs.

  1. Pipeline source resolution (pipeline_source.py): Prefer a local sibling scrnaseq/ checkout (pinned commit, audit-safe). Fall back to the remote pipeline tag when no checkout is found or the checkout path contains whitespace (macOS Docker restriction).

  2. Samplesheet validation (samplesheet_builder.py): Parse the CSV, resolve FASTQ paths relative to the CSV parent directory, normalize sample-name whitespace to underscores, verify readability and FASTQ extensions, reject FASTQ basenames with whitespace, enforce consistent expected_cells (≥1) and seq_center for repeated sample rows, reject exact duplicate FASTQ rows, and write a normalized copy with absolute POSIX paths to reproducibility/samplesheet.valid.csv.

  3. Preflight (preflight.py): Verify Java (≥17) and Nextflow (≥25.04.0). Compare version tuples after zero-padding to 3 elements (avoids false negatives such as (24, 4) < (24, 4, 0)). For docker, run docker info and gate on exit code. For conda/mamba, locate the binary. For singularity/apptainer, accept either binary interchangeably. For wave and gpu, no binary check is needed (Nextflow-native features). All subprocess calls have a 30-second timeout.

  4. Params construction (params_builder.py): Translate the preset + CLI flags into a params.yaml consumed by Nextflow via -params-file. All file paths use .as_posix() for forward-slash consistency across platforms. igenomes_ignore is automatically set to true whenever any explicit reference path is provided (suppresses nf-schema DNS validation of the default iGenomes S3 URL). Skip flags are only written when true, keeping params.yaml minimal.

  5. Command build + execution (command_builder.py, executor.py): Construct the nextflow run command with -params-file and -work-dir <output>/upstream/work, then launch via subprocess.Popen with stdout and stderr piped to log files on disk — never buffered in RAM. On TimeoutExpired, the process is killed and EXECUTION_FAILED is raised.

  6. Output parsing (outputs_parser.py): Scan the upstream results tree for MultiQC HTML, pipeline_info/, .h5ad (combined matrix preferred over per-sample, filtered preferred over raw), .rds, and CellBender-derived files. handoff_available is set to true only when a preferred_h5ad is confirmed on disk.

  7. Provenance + reporting (provenance.py, reporting.py): Write JSON provenance bundles, a SHA-256 checksum manifest (files only — never directories), environment.yml, a portable commands.sh, report.md, and result.json.

Presets

Preset Aligner Use case
standard simpleaf (alevin-fry) Default for 10x GEX; fast, memory-efficient
star STARsolo Best FASTQ QC metrics; supports RNA velocity (--star-feature "Gene Velocyto")
kallisto kb-python / BUStools Pseudo-alignment; fastest; lamanno/nac RNA velocity via --kb-workflow
cellranger CellRanger CellRanger v2/v3 compatibility; requires CellRanger binary in PATH
cellrangerarc CellRanger ARC Multiome (GEX + ATAC); accepts prebuilt --cellranger-index or reference-build inputs
cellrangermulti CellRanger Multi GEX + VDJ + feature barcoding; --cellranger-multi-barcodes required for CMO/FFPE multiplexing

Each preset requires at least one reference option: --genome <iGenomes_shortcut> OR a pre-built index (--star-index, --simpleaf-index, etc.) OR --fasta + --gtf.

CLI Reference

# Standard usage
python skills/nfcore-scrnaseq-wrapper/nfcore_scrnaseq_wrapper.py \
  --input samplesheet.csv --output ./scrnaseq_run

# Preflight check only (no Nextflow execution)
python skills/nfcore-scrnaseq-wrapper/nfcore_scrnaseq_wrapper.py \
  --input samplesheet.csv --output ./scrnaseq_run --check

# Demo mode (runs the upstream nf-core test profile; forces star preset; Docker must be running)
python skills/nfcore-scrnaseq-wrapper/nfcore_scrnaseq_wrapper.py \
  --demo --output ./scrnaseq_demo

# Via ClawBio runner
python clawbio.py run scrnaseq-pipeline --input samplesheet.csv --output ./scrnaseq_run
python clawbio.py run scrnaseq-pipeline --demo --output ./scrnaseq_demo

# STARsolo with local FASTA+GTF (STAR index built by the pipeline)
python skills/nfcore-scrnaseq-wrapper/nfcore_scrnaseq_wrapper.py \
  --input samplesheet.csv --output ./run --preset star --protocol 10XV3 \
  --fasta /refs/hg38.fa --gtf /refs/hg38.gtf

# STARsolo with prebuilt STAR index
python skills/nfcore-scrnaseq-wrapper/nfcore_scrnaseq_wrapper.py \
  --input samplesheet.csv --output ./run --preset star --protocol 10XV3 \
  --star-index /refs/star_index

# STARsolo RNA velocity
python skills/nfcore-scrnaseq-wrapper/nfcore_scrnaseq_wrapper.py \
  --input samplesheet.csv --output ./run --preset star \
  --star-feature "Gene Velocyto" --star-ignore-sjdbgtf \
  --fasta /refs/hg38.fa --gtf /refs/hg38.gtf

# Simpleaf (standard) with UMI resolution override
python skills/nfcore-scrnaseq-wrapper/nfcore_scrnaseq_wrapper.py \
  --input samplesheet.csv --output ./run --preset standard --protocol 10XV3 \
  --simpleaf-umi-resolution cr-like-em --genome GRCh38

# Kallisto RNA velocity (NAC workflow)
python skills/nfcore-scrnaseq-wrapper/nfcore_scrnaseq_wrapper.py \
  --input samplesheet.csv --output ./run --preset kallisto \
  --kb-workflow nac --fasta /refs/hg38.fa --gtf /refs/hg38.gtf

# Air-gapped cluster: local iGenomes mirror
python skills/nfcore-scrnaseq-wrapper/nfcore_scrnaseq_wrapper.py \
  --input samplesheet.csv --output ./run --preset star --protocol 10XV3 \
  --genome GRCh38 --igenomes-base /mnt/local_igenomes

# CellRanger Multi (CMO multiplexing)
python skills/nfcore-scrnaseq-wrapper/nfcore_scrnaseq_wrapper.py \
  --input samplesheet.csv --output ./run --preset cellrangermulti \
  --cellranger-index /refs/refdata-gex-GRCh38 \
  --gex-cmo-set /refs/cmo_set.csv \
  --cellranger-multi-barcodes /refs/multi_barcodes.csv

Key flags

Flag Type Default Description
--preset string standard Aligner preset
--profile string docker Execution backend: docker, conda, mamba, singularity, apptainer, podman, shifter, charliecloud, wave, gpu
--pipeline-version string 4.1.0 Remote nf-core/scrnaseq tag or commit (used when no local sibling checkout is found)
--protocol string None Chemistry/protocol forwarded to the aligner. Required and non-auto for standard, star, and kallisto. standard/simpleaf additionally rejects smartseq. For cellranger, cellrangerarc, and cellrangermulti any value is accepted — auto is the typical upstream recommendation
--genome string iGenomes shortcut (GRCh38, mm10, etc.) — mutually exclusive with --fasta/--gtf and all index flags
--igenomes-base string Base URL or local path for iGenomes (default s3://ngi-igenomes/igenomes/). Use for local mirrors or air-gapped clusters
--fasta path Genome FASTA (.fa, .fna, .fasta, .gz variants; no whitespace in path)
--gtf path Gene annotation GTF
--star-index path Prebuilt STAR genome index directory
--simpleaf-index path Prebuilt simpleaf/alevin-fry index
--kallisto-index path Prebuilt kallisto index
--cellranger-index path Prebuilt CellRanger or CellRanger ARC reference
--transcript-fasta path Transcriptome FASTA for simpleaf
--txp2gene path Transcript-to-gene mapping for simpleaf
--barcode-whitelist path Custom barcode whitelist (per-aligner format)
--star-feature enum STARsolo feature type: Gene, GeneFull, Gene Velocyto
--star-ignore-sjdbgtf flag Do not use GTF for SJDB construction (required for Gene Velocyto)
--seq-center string Sequencing center name for BAM read group tag
--simpleaf-umi-resolution enum UMI resolution strategy for alevin-fry: cr-like, cr-like-em, parsimony, parsimony-em, parsimony-gene, parsimony-gene-em
--kb-workflow enum Kallisto workflow: standard, lamanno, nac
--kb-t1c path cDNA transcripts-to-capture file for RNA velocity (lamanno/nac)
--kb-t2c path Intron transcripts-to-capture file for RNA velocity (lamanno/nac)
--skip-cellbender flag Disable the CellBender ambient RNA removal subworkflow
--skip-emptydrops flag Skip emptyDrops cell calling (independent of --skip-cellbender)
--skip-fastqc flag Skip FastQC quality control
--skip-multiqc flag Skip MultiQC report generation
--skip-cellranger-renaming flag Skip automatic sample renaming in CellRanger modules
--skip-cellrangermulti-vdjref flag Skip mkvdjref in cellrangermulti (when VDJ data is absent or a prebuilt --cellranger-vdj-index is supplied)
--save-reference flag Save the built reference index for future reuse
--save-align-intermeds flag Save alignment intermediate BAM files (disabled by default)
--expected-cells int Override expected cell count (≥1) for all samples
--email string Email address for pipeline completion notification
--multiqc-title string Custom title for the MultiQC report
--resume flag Nextflow resume (checksum-verified against prior manifest)
--run-downstream flag Opt in to scrna_orchestrator handoff after pipeline completion
--cellrangerarc-config path Config JSON for CellRanger ARC index construction
--cellrangerarc-reference string Reference genome name used inside the CellRanger ARC config
--motifs path Motif file (e.g. JASPAR) for CellRanger ARC
--cellranger-vdj-index path Prebuilt CellRanger VDJ reference
--gex-frna-probe-set path Probe set CSV for FFPE fixed RNA profiling (cellrangermulti)
--gex-target-panel path Target panel CSV for targeted GEX (cellrangermulti)
--gex-cmo-set path CMO reference CSV for multiplexed samples (cellrangermulti)
--gex-barcode-sample-assignment path Barcode-to-sample assignment CSV for OCM multiplexing (cellrangermulti)
--fb-reference path Feature-barcode reference CSV for antibody capture (cellrangermulti)
--vdj-inner-enrichment-primers path V(D)J cDNA enrichment primer sequences (cellrangermulti)
--cellranger-multi-barcodes path Multiplexed sample samplesheet for CMO/FFPE demultiplexing (cellrangermulti)

Output Structure

output_directory/
├── report.md                         # Wrapper run summary
├── result.json                       # Structured result payload
├── logs/
│   ├── stdout.txt                    # Nextflow stdout
│   └── stderr.txt                    # Nextflow stderr
├── upstream/
│   └── results/                      # nf-core/scrnaseq output tree
│       ├── fastqc/                   # Per-read FastQC reports
│       ├── multiqc/                  # MultiQC HTML and data
│       │   └── multiqc_report.html
│       ├── pipeline_info/            # Execution report, timeline, trace, DAG
│       └── <aligner>/                # Aligner-specific outputs
│           ├── <sample>/             # Per-sample STAR/simpleaf/kallisto outputs
│           └── mtx_conversions/      # AnnData (.h5ad), SCE (.rds), Seurat (.rds)
│               ├── <sample>_filtered_matrix.h5ad
│               ├── <sample>_raw_matrix.h5ad
│               ├── combined_filtered_matrix.h5ad   ← preferred_h5ad (when present)
│               └── combined_raw_matrix.h5ad
├── reproducibility/
│   ├── samplesheet.valid.csv         # Normalized samplesheet (absolute POSIX paths)
│   ├── params.yaml                   # Effective Nextflow parameters
│   ├── commands.sh                   # Portable replay script
│   ├── environment.yml               # Conda environment spec (for reference)
│   ├── checksums.sha256              # SHA-256 for samplesheet, params, refs, h5ad, MultiQC
│   ├── manifest.json                 # Run metadata: preset, profile, versions, checksums
│   ├── macos_docker.config           # macOS+Docker workarounds (VirtioFS, ARM64, STAR FIFOs)
│   └── remap_paths.py                # Helper for replaying on a different machine
└── provenance/
    ├── inputs.json                   # Samplesheet and reference paths + checksums
    ├── invocation.json               # Timestamp, preset, profile, pipeline version
    ├── preflight.json                # Java/Nextflow/backend info
    ├── upstream.json                 # Pipeline source resolution details
    ├── outputs.json                  # Detected artifacts
    ├── runtime.json                  # Execution timing
    └── skill.json                    # Skill name and version

Example Output

result.json (abbreviated):

{
  "skill": "scrnaseq-pipeline",
  "version": "0.1.0",
  "summary": {
    "preset": "star",
    "aligner_effective": "star",
    "pipeline_source_kind": "remote_repo",
    "pipeline_version_or_commit": "4.1.0",
    "profile": "docker",
    "preferred_h5ad": "<output>/upstream/results/star/mtx_conversions/combined_filtered_matrix.h5ad",
    "handoff_available": true,
    "samples_detected": 2,
    "cellbender_used": false
  }
}

report.md closes with:

## Next Steps
- python clawbio.py run scrna --input <preferred_h5ad> --output <dir>
- python clawbio.py run scrna-embedding --input <preferred_h5ad> --output <dir>

Gotchas

  • Preflight runs before any Nextflow call. If Java, Nextflow, or the backend are missing or too old, the pipeline never starts and you get a structured JSON error with error_code and a fix hint. Nextflow ≥25.04.0 is required.
  • --genome conflicts with any explicit reference flag. Providing --genome alongside --fasta, --gtf, or any index flag raises CONFLICTING_REFERENCES in preflight. Use either --genome <shortcut> or explicit flags — never both.
  • igenomes_ignore is set automatically. Whenever any explicit reference path (fasta, gtf, any index) is provided, the wrapper writes igenomes_ignore: true to suppress nf-schema DNS validation of the default iGenomes S3 URL. You do not need to set this manually. Use --igenomes-base only for local iGenomes mirrors.
  • Protocol compatibility is enforced before Nextflow starts. standard, star, and kallisto presets require an explicit non-auto protocol (e.g., 10XV3, dropseq, or a supported custom chemistry string). standard/simpleaf additionally rejects smartseq — use star or kallisto for Smart-seq data. cellranger, cellrangerarc, and cellrangermulti accept any protocol value; auto is the typical upstream recommendation but is not enforced.
  • --skip-cellbender and --skip-emptydrops are independent flags. --skip-cellbender disables the CellBender ambient RNA removal subworkflow; --skip-emptydrops disables the emptyDrops cell calling step. Both are written as separate parameters in params.yaml and each replays as its own flag in commands.sh. Setting one does not imply the other.
  • --demo forces preset=star and skip_cellbender=true. The nf-core upstream test profile ships STAR-compatible data and explicitly disables CellBender (which does not work on small test datasets). If a different preset is requested with --demo, the wrapper warns and overrides it.
  • preferred_h5ad may be absent. If no combined matrix is produced and there are multiple per-sample files, handoff_available is false. Always check result.json before chaining to scrna-orchestrator or scrna-embedding.
  • No arbitrary Nextflow passthrough. All pipeline configuration flows through the preset system and params.yaml. Direct -c, --outdir, or custom Nextflow flags cannot be injected.
  • --resume enforces strict compatibility. The wrapper checks that the stored manifest matches the current preset, profile, and pipeline source. Mismatches raise INVALID_RESUME_STATE.
  • RNA velocity requires two coordinated flags. For STARsolo: --star-feature "Gene Velocyto" AND --star-ignore-sjdbgtf must be passed together. For Kallisto: --kb-workflow lamanno or nac with --kb-t1c and --kb-t2c.
  • cellrangerarc config and reference are paired. Providing --cellrangerarc-config without --cellrangerarc-reference (or vice versa) raises INVALID_PRESET_CONFIGURATION. --motifs is optional and independent.
  • cellrangermulti validates against the samplesheet. feature_type=ab requires --fb-reference; feature_type=cmo requires --cellranger-multi-barcodes; feature_type=vdj with --skip-cellrangermulti-vdjref requires --cellranger-vdj-index. CMO, FFPE probe-set, and OCM multiplexing modes are mutually exclusive.
  • FASTA schema validation. The FASTA path must match ^\S+\.fn?a(sta)?(\.gz)?$ (the nf-core/scrnaseq 4.1.0 schema). Paths with whitespace or non-standard extensions are rejected in preflight.
  • Local checkout must be a sibling directory. The wrapper looks for ../scrnaseq relative to the ClawBio repo root. If the checkout path contains whitespace (common on macOS), the wrapper warns and falls back to the remote pipeline. Ensure ClawBio/ and scrnaseq/ share the same parent folder.
  • macOS Docker workaround is applied automatically. On macOS with Docker, macos_docker.config is written to the reproducibility bundle and passed to Nextflow. It sets stageInMode = "copy" (avoids VirtioFS EDEADLK), --platform linux/amd64 (Rosetta emulation), and routes STAR _STARtmp to the container's /tmp (avoids VirtioFS FIFO limitation). Output directories under /tmp emit a WARNING — use a path under HOME.

Safety

  • Local-first: User FASTQs and outputs remain on the local filesystem.
  • Strict preflight: Nextflow is never invoked if validation fails.
  • No hallucinated outputs: Only artifacts confirmed on disk are reported.
  • Disclaimer: Every report includes the ClawBio medical disclaimer.

Agent Boundary

The agent dispatches and explains; this skill executes.

Agent: Interpret the user's preprocessing intent, choose the preset, and verify that handoff_available is true in result.json before routing to downstream skills.

Skill: Validate environment and inputs, run the pipeline with controlled parameters, write all provenance and reproducibility artifacts, and report the detected preferred_h5ad.

Chaining Partners

Skill When to chain
scrna-orchestrator After a successful run, pass preferred_h5ad for clustering, QC, and markers
scrna-embedding Pass preferred_h5ad for scVI/scANVI batch integration and latent embeddings
multiqc-reporter Re-aggregate QC across multiple wrapper runs

Maintenance

Review cadence: After each nf-core/scrnaseq major release. Check NEXTFLOW_MIN_VERSION (schemas.py), SUPPORTED_PRESETS, SUPPORTED_PROFILES, and this SKILL.md for accuracy.

Staleness signals:

  • Preflight rejects a Nextflow version that the current pipeline supports → update NEXTFLOW_MIN_VERSION in schemas.py and reproducibility/pinned_versions.json.
  • New aligners appear upstream but are absent from PRESET_ALIGNERS → add to schemas.py and update tests.
  • The VirtioFS macOS workaround (stageInMode = "copy") is only necessary while Apple Silicon runs Docker via QEMU. Remove _write_macos_docker_config when a native arm64 Docker runtime eliminates VirtioFS deadlocks.

Deprecation criteria: Deprecate if nf-core/scrnaseq releases a Python SDK with equivalent preflight, params, and provenance APIs.

Citations

同梱ファイル

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