Documentation

FastqReader.php

Reads a FASTQ file into FastqRecord instances Freely inspired by BioPHP's project biophp.org Created 30 September 2026 Last modified 9 October 2026

Table of Contents

Classes

FastqReader
A standalone, persistence-independent text reader, in the same spirit as Domain\Cloning's GffFeatureReader : FASTQ has no entry delimiters DatabaseParserFactory could recognize, and no Doctrine entity to persist into. A record is an identifier line ("@..."), its sequence, a separator line ("+...") and its quality string. Most files write the sequence and the quality on one line each, but the original Sanger format let both wrap over several lines, and readers are expected to accept it (Cock et al., Nucleic Acids Res. 2010, 38:1767) : the sequence runs until the "+" line, the quality until it is as long as the sequence. A quality line may itself start with "@" or "+", so a quality line is only taken while it keeps the quality no longer than the sequence ; a quality left short is reported, and the next line read as the next record. A record that does not fit this shape, or whose sequence/quality content is rejected by FastqRecord's own validation, is skipped and reported in FastqImportResult::getWarnings() rather than thrown, exactly like GffFeatureReader treats a malformed GFF3 line. Blank lines between records are ignored.
On this page

Search results