FastqParser
Mojo struct 🡭
FastqParser
Section titled “FastqParser”@memory_onlystruct FastqParser[R: Reader, config: ParserConfig = ParserConfig(Int(262144), Int(1073741824), False, False, False, Optional(None))]Buffered FASTQ parser over any Reader.
Chunked reads through a BufferedReader; handles records spanning
buffer edges via compaction and optional growth. For plain local files,
MmapFastqParser offers a zero-copy alternative with the same API.
Parameters
Section titled “Parameters”- R (
Reader) - config (
ParserConfig)
Fields
Section titled “Fields”- src (
BufferedSource[R, config.buffer_capacity, config.buffer_growth_enabled, config.buffer_max_capacity]) - quality_schema (
QualitySchema) - validator (
Validator)
Implemented traits
Section titled “Implemented traits”AnyType, Deinitable, FastqParserLike, Movable
Methods
Section titled “Methods”__init__
Section titled “__init__”fn def __init__(out self, var reader: R)Args:
- reader (
R) - self (
Self)
Returns:
Self
Raises:
fn def __init__(out self, var reader: R, quality_schema: String)Args:
- reader (
R) - quality_schema (
String) - self (
Self)
Returns:
Self
Raises:
fn def __init__(out self, var reader: R, batch_size: Int, schema: String = "generic")Args:
- reader (
R) - batch_size (
Int) - schema (
String) - self (
Self)
Returns:
Self
Raises:
has_more
Section titled “has_more”fn def has_more(self) -> BoolArgs:
- self (
Self)
Returns:
Bool
next_view
Section titled “next_view”fn def next_view(mut self) -> FastqView[MutUntrackedOrigin]Args:
- self (
Self)
Returns:
FastqView[MutUntrackedOrigin]
Raises:
next_view_memchr_seq
Section titled “next_view_memchr_seq”fn def next_view_memchr_seq(mut self) -> FastqView[MutUntrackedOrigin]Benchmark-only variant that scans record boundaries via sequential memchr.
Args:
- self (
Self)
Returns:
FastqView[MutUntrackedOrigin]
Raises:
next_view_masks
Section titled “next_view_masks”fn def next_view_masks(mut self) -> FastqView[MutUntrackedOrigin]Benchmark-only variant using the hoisted-mask SIMD scanner.
Args:
- self (
Self)
Returns:
FastqView[MutUntrackedOrigin]
Raises:
next_record
Section titled “next_record”fn def next_record(mut self) -> FastqRecordArgs:
- self (
Self)
Returns:
FastqRecord
Raises:
next_record_memchr_seq
Section titled “next_record_memchr_seq”fn def next_record_memchr_seq(mut self) -> FastqRecordBenchmark-only variant that scans record boundaries via sequential memchr.
Args:
- self (
Self)
Returns:
FastqRecord
Raises:
next_record_masks
Section titled “next_record_masks”fn def next_record_masks(mut self) -> FastqRecordArgs:
- self (
Self)
Returns:
FastqRecord
Raises:
next_batch
Section titled “next_batch”fn def next_batch(mut self, max_records: Int = Int(4096)) -> FastqBatchArgs:
- self (
Self) - max_records (
Int)
Returns:
FastqBatch
Raises:
fn def views(ref self) -> _FastqViewIter[Self, origin_of(self)]Args:
- self (
Self)
Returns:
_FastqViewIter[Self, origin_of(self)]
records
Section titled “records”fn def records(ref self) -> _FastqRecordIter[Self, origin_of(self)]Args:
- self (
Self)
Returns:
_FastqRecordIter[Self, origin_of(self)]
batches
Section titled “batches”fn def batches(ref self, max_records: Optional[Int] = None) -> _FastqBatchIter[Self, origin_of(self)]Args:
- self (
Self) - max_records (
Optional[Int])
Returns:
_FastqBatchIter[Self, origin_of(self)]