AGENT SKILL

sc-fastq-qc

Load when checking raw single-cell FASTQ read quality (Phred / GC / adapter / length) before counting. Skip when reads are already counted (use sc-qc); bulk FASTQ (use bulkrna-read-qc).

License 许可
Apache-2.0
最近更新
2026-10-08
Stars
★ 161
Forks
27

01 前言 Front Matter

name
sc-fastq-qc
tags
[ "singlecell", "scrna", "fastq", "qc", "read-quality" ]
trigger
scRNA FASTQ QC, FastQC single-cell, MultiQC single-cell, raw read quality, read-level QC
description
Load when checking raw single-cell FASTQ read quality (Phred / GC / adapter / length) before counting. Skip when reads are already counted (use sc-qc); bulk FASTQ (use bulkrna-read-qc).

02 资源文件 7

03 SKILL.md 正文

sc-fastq-qc

Use from a step

This is CLI_ONLY: it reads FASTQ files and optionally starts FastQC/MultiQC.

from skills._sdk.notebook import run_cli

run_cli("sc-fastq-qc", "--input", "data/sample_R1.fastq.gz",
        "--read2", "data/sample_R2.fastq.gz",
        inputs=["data/sample_R1.fastq.gz", "data/sample_R2.fastq.gz"])

The demo renders synthetic summary tables; it does not read FASTQ or test the external tools. There is no _api.py for this skill.

When to use

The user has raw scRNA-seq FASTQ files (one or more, or a directory of samples) and wants per-file / per-sample / per-base quality summaries before running sc-count or cellranger. Python summaries always run. FastQC and MultiQC add reports when installed; a tool that is present but fails is a hard error, not a fallback to a successful Python-only run.

Inputs & Outputs

Inputs

  • Input kinds: file, directory
  • Modalities: scrna
  • File types: .fastq, .fq, and their .gz variants
  • FASTQ structure: valid first record
  • Directory layouts (any): fastq-collection

Outputs

  • tables/fastq_per_base_quality.csv
  • tables/fastq_per_file_summary.csv
  • tables/fastq_per_sample_summary.csv
  • figures/fastq_file_quality.png
  • figures/fastq_q30_summary.png
  • figures/fastq_read_structure.png
  • figures/per_base_quality.png
  • figures/manifest.json, figure_data/manifest.json, plot-data CSV files
  • reproducibility/commands.sh, reproducibility/requirements.txt
  • Optional external reports under artifacts/fastqc/ and artifacts/multiqc/
  • report.md
  • result.json

Flow

  1. Discover FASTQ files and choose one sample (--sample disambiguates a directory).
  2. Summarize the first --max-reads records per file in Python.
  3. Run FastQC when present, then MultiQC when both tools are present.
  4. Render four figures from the Python summaries; external HTML is separate.
  5. Write three tables, report.md and result.json.

Gotchas

  • --max-reads 20000 caps Python summaries only. tables/fastq_per_file_summary.csv records sampled depth. FastQC processes the full files. This is a prefix sample, not random sampling.
  • --r-enhanced is accepted but produces no R plots. This skill emits Python figures only. Pass freely, expect no R Enhanced output.
  • figures/manifest.json records per-figure status; result.json lists external tool availability and commands under data.external_tools.
  • _lib/upstream.py:choose_fastq_sample rejects ambiguous multi-sample directories. Run once per sample with --sample; one invocation does not batch every sample.

Key CLI

# Demo (synthetic summary tables, no FASTQ or external tools)
python skills/singlecell/scrna/sc-fastq-qc/sc_fastq_qc.py --demo --output /tmp/sc_fastq_qc_demo

# Single-file with paired-end
python skills/singlecell/scrna/sc-fastq-qc/sc_fastq_qc.py \
  --input sample_R1.fastq.gz --read2 sample_R2.fastq.gz --output results/

# Choose a sample and increase Python sampling depth
python skills/singlecell/scrna/sc-fastq-qc/sc_fastq_qc.py \
  --input fastq_dir/ --sample sample_A --output results/ --max-reads 100000 --threads 8

See also

  • references/parameters.md — every CLI flag and tuning hint
  • references/methodology.md — FastQC integration + Python fallback rationale
  • references/output_contract.md — table column schemas + figure roles
  • Adjacent skills: sc-count (next step — FASTQ → AnnData), bulkrna-read-qc (bulk RNA-seq variant), sc-qc (downstream count-matrix QC)

Dependencies

Python packages this skill's script needs. They are not installed for you — check before a long run.

anndata, matplotlib, numpy, pandas, scanpy, scipy, seaborn

04 同仓库更多 Skills

TianGzlab
TianGzlab/OmicsClaw

demo-skill

A fixture skill for the skill environment tests. Use it for nothing else.

★ 161
TianGzlab
TianGzlab/OmicsClaw

fake-domains

Test fixture for the golden deployment in tests/entry. Load never; it has no script.

★ 161
TianGzlab
TianGzlab/OmicsClaw

replace-me-skill

Load when copying this directory to bootstrap a new OmicsClaw skill. Skip when an existing skill already covers the request.

★ 161
TianGzlab
TianGzlab/OmicsClaw

spatial-velocity

Load when estimating RNA velocity on a spatial AnnData with `layers["spliced"]` + `layers["unspliced"]` via scVelo (stochastic / deterministic / dynamical) or veloVI (deep generative). Skip when input lacks the spliced/unspliced layers (must be quantified upstream by velocyto / kb-python / STARsolo); non-spatial scRNA velocity (use sc-velocity).

★ 161
TianGzlab
TianGzlab/OmicsClaw

spatial-trajectory

Load when inferring pseudotime / lineage trajectories on a preprocessed spatial AnnData via DPT (default — diffusion pseudotime), CellRank (terminal-state + fate-probability), or Palantir (waypoint branch probabilities). Skip when the data has spliced/unspliced layers and you want velocity-driven dynamics (use spatial-velocity); non-spatial scRNA pseudotime (use sc-pseudotime).

★ 161
TianGzlab
TianGzlab/OmicsClaw

spatial-statistics

Load when running spatial autocorrelation / hotspot / co-occurrence / neighbourhood-enrichment / Ripley K stats on a clustered spatial AnnData via squidpy. Skip when ranking spatially variable genes (use spatial-genes); tissue domain detection (use spatial-domains).

★ 161