Fastx::Fastq::Reader
Inherits Reference < Object
Constructors
Creates a new FASTQ reader for the specified file. Automatically detects gzip compression from .gz extension.
Creates a new FASTQ reader for an already opened IO stream. IO-based readers do not perform gzip auto-detection. The reader takes ownership of the IO and closes it when the reader is closed.
Class methods
Opens a FASTQ file, yields the reader to the block, and automatically closes it.
Opens a FASTQ stream, yields the reader to the block, and automatically closes it.
Instance methods
Iterates over each FASTQ record, yielding identifier, sequence, and quality
as owned String copies that remain valid after iteration.
Iterates over each FASTQ record, yielding identifier, sequence, and quality
as borrowed Bytes (Slice(UInt8)).
The yielded slices point into internal buffers that are reused on every
iteration. They are backed by reader-owned reusable buffers, not
guaranteed zero-copy views of the input stream, and are only valid until
the next record is read. To keep a value beyond the current iteration,
copy it (String.new(bytes) or bytes.dup) or use #each.
Iterates over conventional four-line FASTQ records while streaming each record's sequence and quality lines without accumulating the full fields in memory. This is the lowest-memory FASTQ reading API.
The yielded identifier is an owned String. SequenceLines#each and
QualityLines#each yield borrowed Bytes slices into an internal buffer;
each slice is only valid until the next line is read. Copy it
(String.new(bytes) or bytes.dup) to keep it.
The sequence line is consumed before quality (automatically, if the caller skips it) so sequence/quality length equality can be validated.
The specific method name leaves #each_record available for a possible
future record-oriented API.