bio-longread-qc
Quality control for long-read sequencing data using NanoPlot, NanoStat, and chopper. Generate QC reports, filter reads by length and quality, and visualize read characteristics. Use when assessing ONT or PacBio run quality or filtering reads before assembly or alignment.
Best use case
bio-longread-qc is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Quality control for long-read sequencing data using NanoPlot, NanoStat, and chopper. Generate QC reports, filter reads by length and quality, and visualize read characteristics. Use when assessing ONT or PacBio run quality or filtering reads before assembly or alignment.
Teams using bio-longread-qc should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/bio-longread-qc/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How bio-longread-qc Compares
| Feature / Agent | bio-longread-qc | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Quality control for long-read sequencing data using NanoPlot, NanoStat, and chopper. Generate QC reports, filter reads by length and quality, and visualize read characteristics. Use when assessing ONT or PacBio run quality or filtering reads before assembly or alignment.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
Related Guides
SKILL.md Source
## Version Compatibility
Reference examples tested with: BioPython 1.83+, numpy 1.26+
Before using code patterns, verify installed versions match. If versions differ:
- Python: `pip show <package>` then `help(module.function)` to check signatures
- CLI: `<tool> --version` then `<tool> --help` to confirm flags
If code throws ImportError, AttributeError, or TypeError, introspect the installed
package and adapt the example to match the actual API rather than retrying.
# Long-Read Quality Control
**"Check the quality of my Nanopore/PacBio run"** → Generate read length distributions, quality score plots, and summary statistics, then filter reads by length and quality thresholds.
- CLI: `NanoPlot --fastq reads.fq.gz -o nanoplot_output/`, `chopper -q 10 -l 1000 < reads.fq > filtered.fq`
## NanoPlot - Visualization
```bash
# From FASTQ
NanoPlot --fastq reads.fastq.gz -o nanoplot_output -t 4
# From BAM
NanoPlot --bam aligned.bam -o nanoplot_output -t 4
# From sequencing summary (fastest)
NanoPlot --summary sequencing_summary.txt -o nanoplot_output
```
## NanoPlot - Common Options
```bash
NanoPlot --fastq reads.fastq.gz \
-o nanoplot_output \
-t 8 \
--N50 \ # Show N50 in plots
--title "Sample QC" \
--plots hex dot \ # Plot types
--format png pdf \ # Output formats
--color darkblue \
--maxlength 50000 \ # Max length for plots
--minlength 500 # Min length for plots
```
## NanoStat - Statistics Only
```bash
# Quick statistics (no plots)
NanoStat --fastq reads.fastq.gz --threads 4
# From BAM
NanoStat --bam aligned.bam --threads 4
# Output to file
NanoStat --fastq reads.fastq.gz --threads 4 > qc_stats.txt
```
## chopper - Filter Reads
```bash
# Filter by length and quality
gunzip -c reads.fastq.gz | chopper -q 10 -l 1000 | gzip > filtered.fastq.gz
# Quality >= 10, length >= 1000bp
```
## chopper - Common Options
```bash
gunzip -c reads.fastq.gz | chopper \
--quality 10 \ # Min quality
--minlength 1000 \ # Min length
--maxlength 50000 \ # Max length
--headcrop 50 \ # Remove from start
--tailcrop 50 \ # Remove from end
--threads 4 \
| gzip > filtered.fastq.gz
```
## NanoFilt - Alternative Filter
```bash
# Filter with NanoFilt
gunzip -c reads.fastq.gz | NanoFilt -q 10 -l 1000 | gzip > filtered.fastq.gz
# With more options
gunzip -c reads.fastq.gz | NanoFilt \
--quality 10 \
--length 1000 \
--maxlength 50000 \
--headcrop 50 \
| gzip > filtered.fastq.gz
```
## Porechop - Adapter Trimming
```bash
# Trim adapters
porechop -i reads.fastq.gz -o trimmed.fastq.gz --threads 8
# With barcode splitting
porechop -i reads.fastq.gz -b output_dir/ --threads 8
```
## Generate Summary Statistics
```bash
# Quick summary with seqkit
seqkit stats reads.fastq.gz
# Detailed stats
seqkit stats -a reads.fastq.gz
# Watch stats during basecalling
seqkit watch --fields ReadLen,MeanQual reads.fastq.gz
```
## PycoQC - From Basecalling
```bash
# Generate QC report from sequencing_summary.txt
pycoQC -f sequencing_summary.txt -o pycoqc_report.html
# With BAM for alignment stats
pycoQC -f sequencing_summary.txt -a aligned.bam -o pycoqc_report.html
```
## Calculate N50
```bash
# With seqkit
seqkit stats -a reads.fastq.gz | grep N50
# Manual calculation
seqkit fx2tab -l reads.fastq.gz | cut -f 2 | sort -rn | \
awk '{sum+=$1; len[NR]=$1} END {
target=sum/2; cumsum=0;
for(i=1; i<=NR; i++) {
cumsum+=len[i];
if(cumsum>=target) {print "N50:", len[i]; break}
}
}'
```
## Parse FASTQ Quality in Python
**Goal:** Compute read length and quality distributions from long-read FASTQ for custom QC analysis.
**Approach:** Iterate records with BioPython, collecting per-read length and mean Phred quality for summary statistics.
```python
import numpy as np
from Bio import SeqIO
lengths = []
qualities = []
for record in SeqIO.parse('reads.fastq', 'fastq'):
lengths.append(len(record))
qualities.append(np.mean(record.letter_annotations['phred_quality']))
print(f'Total reads: {len(lengths)}')
print(f'Total bases: {sum(lengths):,}')
print(f'Mean length: {np.mean(lengths):.0f}')
print(f'Median length: {np.median(lengths):.0f}')
print(f'Mean quality: {np.mean(qualities):.1f}')
```
## NanoPlot Output Files
| File | Description |
|------|-------------|
| NanoStats.txt | Summary statistics |
| NanoPlot-report.html | Interactive report |
| LengthvsQualityScatterPlot | Length vs Q plot |
| WeightedHistogramReadlength | Read length distribution |
| Yield_By_Length | Cumulative yield |
## Key Parameters - NanoPlot
| Parameter | Description |
|-----------|-------------|
| --fastq | Input FASTQ |
| --bam | Input BAM |
| --summary | Sequencing summary |
| -o | Output directory |
| -t | Threads |
| --N50 | Show N50 line |
| --plots | Plot types |
| --format | Output formats |
## Key Parameters - chopper
| Parameter | Default | Description |
|-----------|---------|-------------|
| -q | 0 | Min quality |
| -l | 0 | Min length |
| --maxlength | inf | Max length |
| --headcrop | 0 | Trim from start |
| --tailcrop | 0 | Trim from end |
| -t | 4 | Threads |
## Quality Thresholds
| Q Score | Accuracy | Typical Use |
|---------|----------|-------------|
| Q7 | ~80% | Very low quality |
| Q10 | ~90% | Basic filtering |
| Q15 | ~97% | Moderate filtering |
| Q20 | ~99% | High quality (SUP) |
| Q30 | ~99.9% | Very high (HiFi) |
## Related Skills
- long-read-alignment - Align filtered reads
- sequence-io/fastq-quality - FASTQ quality analysis
- medaka-polishing - Polish with filtered readsRelated Skills
bio-longread-structural-variants
Detect structural variants from long-read alignments using Sniffles, cuteSV, and SVIM. Use when detecting deletions, insertions, inversions, translocations, or complex rearrangements from ONT or PacBio data, especially those missed by short-read methods.
bio-longread-medaka
Polish assemblies and call variants from Oxford Nanopore data using medaka. Uses neural networks trained on specific basecaller versions. Use when improving ONT-only assemblies or calling variants from Nanopore data without short-read polishing.
bio-longread-alignment
Align long reads using minimap2 for Oxford Nanopore and PacBio data. Supports various presets for different read types and applications. Use when aligning ONT or PacBio reads to a reference genome for variant calling, SV detection, or coverage analysis.
zinc-database
Access ZINC (230M+ purchasable compounds). Search by ZINC ID/SMILES, similarity searches, 3D-ready structures for docking, analog discovery, for virtual screening and drug discovery.
zarr-python
Chunked N-D arrays for cloud storage. Compressed arrays, parallel I/O, S3/GCS integration, NumPy/Dask/Xarray compatible, for large-scale scientific computing pipelines.
xlsx
Use this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like "the xlsx in my downloads") — and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved.
writing-skills
Use when creating new skills, editing existing skills, or verifying skills work before deployment
writing-plans
Use when you have a spec or requirements for a multi-step task, before touching code
wikipedia-search
Search and fetch structured content from Wikipedia using the MediaWiki API for reliable, encyclopedic information
wellally-tech
Integrate digital health data sources (Apple Health, Fitbit, Oura Ring) and connect to WellAlly.tech knowledge base. Import external health device data, standardize to local format, and recommend relevant WellAlly.tech knowledge base articles based on health data. Support generic CSV/JSON import, provide intelligent article recommendations, and help users better manage personal health data.
weightloss-analyzer
分析减肥数据、计算代谢率、追踪能量缺口、管理减肥阶段
<!--
# COPYRIGHT NOTICE