Skip to content

FastqParser

Mojo struct 🡭

@memory_only
struct 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.

  • R (Reader)
  • config (ParserConfig)
  • src (BufferedSource[R, config.buffer_capacity, config.buffer_growth_enabled, config.buffer_max_capacity])
  • quality_schema (QualitySchema)
  • validator (Validator)

AnyType, Deinitable, FastqParserLike, Movable

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:

fn def has_more(self) -> Bool

Args:

  • self (Self)

Returns:

Bool

fn def next_view(mut self) -> FastqView[MutUntrackedOrigin]

Args:

  • self (Self)

Returns:

FastqView[MutUntrackedOrigin]

Raises:

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:

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:

fn def next_record(mut self) -> FastqRecord

Args:

  • self (Self)

Returns:

FastqRecord

Raises:

fn def next_record_memchr_seq(mut self) -> FastqRecord

Benchmark-only variant that scans record boundaries via sequential memchr.

Args:

  • self (Self)

Returns:

FastqRecord

Raises:

fn def next_record_masks(mut self) -> FastqRecord

Args:

  • self (Self)

Returns:

FastqRecord

Raises:

fn def next_batch(mut self, max_records: Int = Int(4096)) -> FastqBatch

Args:

  • 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)]

fn def records(ref self) -> _FastqRecordIter[Self, origin_of(self)]

Args:

  • self (Self)

Returns:

_FastqRecordIter[Self, origin_of(self)]

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)]