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.gzvariants - FASTQ structure: valid first record
- Directory layouts (any):
fastq-collection
Outputs
tables/fastq_per_base_quality.csvtables/fastq_per_file_summary.csvtables/fastq_per_sample_summary.csvfigures/fastq_file_quality.pngfigures/fastq_q30_summary.pngfigures/fastq_read_structure.pngfigures/per_base_quality.pngfigures/manifest.json,figure_data/manifest.json, plot-data CSV filesreproducibility/commands.sh,reproducibility/requirements.txt- Optional external reports under
artifacts/fastqc/andartifacts/multiqc/ report.mdresult.json
Flow
- Discover FASTQ files and choose one sample (
--sampledisambiguates a directory). - Summarize the first
--max-readsrecords per file in Python. - Run FastQC when present, then MultiQC when both tools are present.
- Render four figures from the Python summaries; external HTML is separate.
- Write three tables,
report.mdandresult.json.
Gotchas
--max-reads 20000caps Python summaries only.tables/fastq_per_file_summary.csvrecords sampled depth. FastQC processes the full files. This is a prefix sample, not random sampling.--r-enhancedis accepted but produces no R plots. This skill emits Python figures only. Pass freely, expect no R Enhanced output.figures/manifest.jsonrecords per-figure status;result.jsonlists external tool availability and commands underdata.external_tools._lib/upstream.py:choose_fastq_samplerejects 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 hintreferences/methodology.md— FastQC integration + Python fallback rationalereferences/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