← Về thư mục
📄 / / profiles / r-and-d / raw_evidence / OpenAI4S / skills / bioskills / bio-sequence-io-fastq-quality / references / usage-guide.md

FASTQ Quality - Usage Guide

Overview

This skill enables AI agents to help you work with FASTQ quality scores for NGS data: accessing Phred scores, filtering and trimming by quality, profiling quality by position, and converting between the Sanger/Phred+33, Solexa, and Illumina/Phred+64 encodings using Biopython.

Prerequisites

pip install biopython

Quick Start

Tell your AI agent what you want to do:

Example Prompts

Quality Analysis

"Show me the quality distribution of reads.fastq and the fraction of reads above Q30"

Filtering

"Keep only reads with average quality >= 30 and write them to filtered.fastq"

Trimming

"Trim the 3' end where a 5-base sliding window drops below Q20"

Per-Position Profiling

"Generate a per-position mean quality profile and tell me where quality starts dropping"

Encoding and Conversion

"This is legacy Solexa data - convert it to standard Phred+33 without corrupting the scores" "Confirm whether reads.fastq is Phred+33 or Phred+64 before I filter it"

What the Agent Will Do

  1. Determine the FASTQ quality encoding from instrument/run metadata before parsing - never guessing the offset
  2. Parse records and read scores from record.letter_annotations['phred_quality']
  3. Compute per-read or per-position quality metrics
  4. Filter, trim, or convert encodings as requested
  5. Report summary statistics and flag binning or B-tail artifacts

Quality Score Reference

The Four Encodings

Variant Format string Offset Score type
Sanger / Illumina 1.8+ 'fastq' / 'fastq-sanger' 33 Phred
Solexa / Illumina 1.0 'fastq-solexa' 64 Solexa odds (can go negative)
Illumina 1.3-1.7 'fastq-illumina' 64 Phred

Tips