MmapFastqParser
Mojo struct 🡭
MmapFastqParser
Section titled “MmapFastqParser”@memory_onlystruct MmapFastqParserZero-copy FASTQ parser over a memory-mapped file.
Same API surface as FastqParser; parses directly from the page cache
with no buffering and no kernel-to-user copies. The parser owns the
mapping, so record views stay valid until the next read. Best for plain
local files; use FastqParser for gzip/network streams.
Example:
var parser = MmapFastqParser(Path("data.fastq"))for view in parser.views(): _ = view.sequence()Fields
Section titled “Fields”- src (
MmapSource) - 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, path: Path, check_ascii: Bool = False, check_quality: Bool = False, quality_schema_name: String = "generic")Args:
- path (
Path) - check_ascii (
Bool) - check_quality (
Bool) - quality_schema_name (
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)]