New to Claude Skills? Learn how to install them →

mims-harvard on GitHub

FASTQ Quality Control

Free

Perform quality control on NGS FASTQ files efficiently.

Get this skill

Free · Opens the source repo

What FASTQ Quality Control does

The FASTQ Quality Control skill is designed for bioinformaticians and researchers who need to ensure the quality of their raw sequencing data. Utilizing established command-line tools such as FastQC, MultiQC, fastp, Cutadapt, and seqkit, this skill allows users to run comprehensive quality control checks on FASTQ files, interpret the results, and make informed decisions about trimming. The skill emphasizes a structured approach to quality assessment, ensuring that users can diagnose issues with their sequencing data effectively.

When you run this skill, it first checks for the necessary tools on your system. If any required tool is missing, it provides an installation plan and halts execution to prevent fabricating results. This preflight check is crucial for maintaining data integrity. Users can choose to conduct a quality check only or proceed to trimming based on the quality assessment results. The skill ensures that raw FASTQ files remain untouched, writing trimmed reads to a separate output directory.

The skill also includes a detailed interpretation guide for FastQC reports, helping users understand the implications of PASS, WARN, and FAIL results. This feature is particularly useful for those who may be new to quality control in NGS workflows. By summarizing multiple FastQC reports into a MultiQC report, users can quickly assess the overall quality of their samples, making this tool invaluable for projects involving large datasets.

In summary, this skill is a robust solution for anyone involved in next-generation sequencing who needs to ensure their data is of high quality before proceeding with downstream analyses. It is particularly suited for users who prefer a command-line interface and require reliable quality control processes.

When to use it

Use this skill when you need to run quality control on FASTQ files, interpret FastQC reports, or decide on trimming strategies based on quality metrics.

When not to use it

This skill is not suitable for differential expression analysis, read alignment, or variant calling; for those tasks, other specialized tools should be used.

What you can build with it

Quality Control on Raw FASTQs

Run FastQC on your raw FASTQ files to assess their quality before any downstream analysis.

MultiQC Summary Generation

Aggregate multiple FastQC reports into a single MultiQC summary for an overview of sample quality.

Trimming Low-Quality Reads

Decide whether to trim adapters or low-quality bases from your FASTQ files based on quality assessment results.

How to install FASTQ Quality Control

View source

1. Install with the skills CLI

npx skills add mims-harvard/tooluniverse/tooluniverse-fastq-qc --agent claude-code

2. Or install it manually

Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.

Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs

Inside SKILL.md

Written by mims-harvard

FASTQ Quality Control & Trimming Decisions

Run quality control on raw sequencing reads, interpret the report, and make an evidence-based decision about whether to trim — using real local command-line tools (FastQC, MultiQC, fastp, Cutadapt, seqkit).

Honesty contract (read first)

This skill drives real binaries. It must never fabricate QC numbers.

  1. Preflight before anything. Check whether the required tools are on PATH. If a required tool is missing, emit the install plan and STOP. Do not estimate, guess, or describe hypothetical QC results.
  2. Never auto-trim. Trimming is a decision. QC-only is the default. Only trim after inspecting adapter content / per-base quality, and only when the user has confirmed --mode trim.
  3. Never overwrite raw FASTQs. All outputs go to a separate --workdir. The input directory is read-only. Trimmed reads are written as NEW files.
  4. If you cannot run, say so. "FastQC is not installed; here is the install plan" is the correct answer — not a made-up PASS/FAIL table.

When to use vs. not

Use this skill when the user wants to:

  • Run FastQC / fastp QC on one or more FASTQ (.fastq, .fq, .gz) files
  • Interpret a FastQC report (per-base quality, adapter content, etc.)
  • Decide whether adapter or quality trimming is needed before downstream work
  • Summarize many samples into one MultiQC report
  • Count reads, get length/GC stats, or subsample with seqkit
  • Trim adapters/low-quality bases with fastp or Cutadapt (explicitly)

Do NOT use this skill for (route elsewhere):

  • Differential expression / DEG / fold-change analysis -> tooluniverse-rnaseq-deseq2
  • Read alignment, coverage depth, samtools, BWA -> tooluniverse-sequence-analysis
  • Variant calling, VCF, VAF, mutation analysis -> tooluniverse-variant-analysis
  • Single-cell / scRNA QC (per-cell metrics, scanpy) -> tooluniverse-single-cell

Essential inputs to confirm

Before running, confirm with the user (ask if unstated):

  1. FASTQ paths — exact path(s). One file = single-end; an R1+R2 pair = paired-end (e.g. *_R1.fastq.gz / *_R2.fastq.gz).
  2. QC-only or trim? Default is QC-only. Only trim on explicit request.
  3. Known adapters / primers? Standard Illumina adapters are auto-detected by fastp; amplicon/primer sequences usually need explicit Cutadapt removal.
  4. Organism — only needed if a contamination / over-representation screen is requested (needs a reference; see Limitations).
  5. Output directory — a --workdir SEPARATE from the input folder.
  6. Read provenance — are these raw, already-trimmed, or UMI-tagged reads? Already-trimmed reads should NOT be trimmed again; UMIs must be handled before trimming or you corrupt the UMI.

Preflight (do this first, every time)

The bundled script preflights for you, but the decision logic is:

import shutil
for tool in ("fastqc", "fastp", "seqkit"):
    print(tool, shutil.which(tool) or "MISSING")

command -v fastqc / shutil.which("fastqc") returning nothing means the tool is absent. If a required tool (FastQC for QC; FastQC+fastp for trim) is missing, emit:

mamba install -c bioconda -c conda-forge fastqc fastp seqkit multiqc
#   or
conda install -c bioconda -c conda-forge fastqc fastp seqkit multiqc

and stop. Do not proceed to fabricate output.

Tool roles

ToolRoleInstall (bioconda)
FastQCPer-file raw read QC; produces the module PASS/WARN/FAIL reportfastqc
MultiQCAggregates many FastQC (and fastp) reports into one summarymultiqc
fastpAll-in-one QC + adapter + quality trimming (fast, auto-detect)fastp
CutadaptExplicit, precise adapter/primer removal (amplicons, custom)cutadapt
seqkitRead counts, length/GC stats, subsamplingseqkit

Rule of thumb: FastQC to diagnose, fastp to fix general adapter/quality, Cutadapt to fix a known primer/adapter precisely, seqkit to count/stat.

Bundled orchestration script

scripts/run_fastq_qc.py does the preflight + run-if-available + plan-if-missing flow, with workspace isolation built in.

# QC only (default) — never modifies reads
python scripts/run_fastq_qc.py \
    --fastq reads/sample_R1.fastq.gz reads/sample_R2.fastq.gz \
    --workdir /tmp/fastq_qc_run

# QC + trim (explicit) — fastp writes NEW trimmed files into --workdir
python scripts/run_fastq_qc.py \
    --fastq reads/sample_R1.fastq.gz reads/sample_R2.fastq.gz \
    --workdir /tmp/fastq_qc_run \
    --mode trim

Behavior:

  • Preflights FastQC (+ fastp in trim mode) and seqkit. If a required tool is missing it prints the install plan and exits 0 — no fabricated QC.
  • Runs FastQC (always) + seqkit stats (if present) into --workdir.
  • In --mode trim, runs fastp writing *.trimmed.fastq.gz into --workdir/trimmed/ — raw inputs are never touched.
  • Refuses to run if --workdir equals an input directory (overwrite guard).

For a project-level summary after FastQC, run MultiQC over the workdir:

multiqc /tmp/fastq_qc_run -o /tmp/fastq_qc_run/multiqc

INTERPRETATION — FastQC module -> meaning -> action

This table is the core value-add. Map each FastQC module to what PASS/WARN/FAIL means and what to actually do. (See references/fastqc_interpretation.md for the long form with thresholds and worked cases.)

FastQC moduleTypical PASSWARN / FAIL meansSuggested action
Per base sequence qualityAll positions Q>=283' tail drops below Q20-Q28 (common, esp. R2)Quality-trim 3' (fastp -q/sliding window). Proceed if only the last few bases dip.
Per base N contentNear 0% NSpike of N at a position = sequencer/base-call problemInvestigate: cycle-specific issue; consider hard-trim that position or re-sequence.
Adapter contentFlat, no adapter rampRising adapter % toward 3' end = read-through into adapterTrim adapters (fastp auto-detect, or Cutadapt with the known adapter).
Overrepresented sequencesNone / <0.1%A sequence is a large fraction: adapter, primer-dimer, rRNA, or low-complexityInvestigate the hit (BLAST it). If adapter/primer -> trim. If biology (rRNA/highly-expressed) -> proceed.
Sequence Duplication LevelsLow (diverse library)High duplication = PCR over-amplification OR expected (amplicon/RNA-seq)Investigate, usually proceed. Do NOT dedup blindly — expected high in amplicon/targeted/RNA-seq. Mark-duplicates belongs post-alignment, not here.
Per sequence GC contentSingle peak at expected GCBimodal / shifted peak = contamination or mixed speciesInvestigate contamination (needs a reference screen; see Limitations). Not fixed by trimming.
Per base sequence contentFlat after first ~10 bpBias in first bases (random-hexamer priming) or adapterRandom-priming bias: usually proceed (expected in RNA-seq). Persistent bias at 3' -> adapter -> trim.
Sequence Length DistributionSingle length (raw)Multiple lengths AFTER trimming is normal; before trimming may indicate mixed inputUsually proceed; only a concern on supposedly-raw uniform-length data.

Decision summary for "do I need to trim?"

  • Adapter content FAIL/WARN with a 3' adapter ramp -> yes, adapter-trim.
  • Per-base quality FAIL at the 3' tail -> yes, quality-trim that tail.
  • Overrepresented = adapter/primer-dimer -> yes, trim; overrepresented = biology (rRNA, abundant transcript) -> no, proceed.
  • High duplication / GC anomaly / N-spike -> investigate, not a trimming fix.
  • Everything PASS -> proceed without trimming.

Workflow

  1. Confirm inputs (paths, pairing, mode, adapters, provenance).
  2. Preflight tools. If missing -> install plan, STOP.
  3. Run QC (--mode qc): FastQC + seqkit -> read the report.
  4. Interpret each flagged module with the table above.
  5. Decide trim vs investigate vs proceed. State the decision and why.
  6. (If trimming chosen) run --mode trim (fastp) or Cutadapt for precise primer removal; re-run FastQC on the trimmed output to confirm the fix.
  7. (Optional) MultiQC for a multi-sample summary.
  8. Report: per-module status, the trim decision + rationale, and the exact commands run. Never report numbers a tool did not actually produce.

Limitations (honest)

  • Requires local binaries. FastQC/fastp/seqkit/Cutadapt/MultiQC must be installed (bioconda). This is not a cloud service; with no tools installed the skill can only emit an install plan, not QC results.
  • Large files. Whole-lane FASTQs can be many GB; FastQC/fastp are single-pass and memory-light but still I/O-bound. Use seqkit sample to subsample for a quick look on huge files.
  • Contamination / cross-species screening is NOT included by default. GC anomalies and "is this the right organism" need a reference index (e.g. FastQ Screen + bowtie2 indexes, or Kraken2) — extra setup beyond this skill's bundled tools.
  • No deduplication of raw reads. PCR-duplicate removal is an alignment-stage decision (Picard/samtools markdup); FastQC duplication is diagnostic only.
  • UMI-aware trimming needs UMI extraction first (umi_tools); naive trimming corrupts UMIs.

Completeness checklist

  • Inputs confirmed (paths, single/paired, raw vs trimmed, adapters)
  • Tools preflighted; install plan emitted if any required tool missing
  • QC run with outputs in a workdir separate from inputs (raw preserved)
  • Each flagged FastQC module interpreted (meaning + action)
  • Explicit trim/investigate/proceed decision with rationale
  • Trimming (if done) was opt-in, wrote new files, raw FASTQs untouched
  • Post-trim FastQC re-run to confirm the fix (if trimmed)
  • No QC numbers reported that a tool did not actually produce

References

  • references/fastqc_interpretation.md — full module-by-module thresholds + cases
  • references/tools_and_install.md — install commands, tool flags, command recipes
  • references/trimming_decisions.md — when/how to trim (fastp vs Cutadapt), pitfalls

Frequently asked questions about FASTQ Quality Control

Similar skills