RapidgzipReader
Mojo struct 🡭
RapidgzipReader
Section titled “RapidgzipReader”@memory_onlystruct RapidgzipReaderReader for gzip-compressed files (.gz) using parallel rapidgzip decompression.
Implements the Reader trait like FileReader and GZFile. Use for .fastq.gz
files with FastqParser when higher throughput from parallel decompression
is desired.
Example:
from blazeseq import RapidgzipReader, FastqParservar r = RapidgzipReader("data.fastq.gz", parallelism=0)var parser = FastqParser[RapidgzipReader](r^, "illumina_1.8")for record in parser.records(): _ = record.id()Implemented traits
Section titled “Implemented traits”AnyType, ImplicitlyDestructible, Movable, Reader
Methods
Section titled “Methods”__init__
Section titled “__init__”def __init__(out self, path: String, parallelism: UInt32 = 0)Open a gzip file for parallel decompression.
Args:
- path (
String): Path to the .gz file. - parallelism (
UInt32): Number of worker threads; 0 = auto-detect. - self (
Self)
Returns:
Self
Raises:
Error: If the file cannot be opened.
def __init__(out self, path: Path, parallelism: UInt32 = 0)Open a gzip file for parallel decompression.
Args:
- path (
Path): Path to the .gz file. - parallelism (
UInt32): Number of worker threads; 0 = auto-detect. - self (
Self)
Returns:
Self
Raises:
Error: If the file cannot be opened.
read_to_buffer
Section titled “read_to_buffer”def read_to_buffer(mut self, mut buf: Span[Byte, MutExternalOrigin], amt: Int, pos: Int) -> UInt64Read decompressed bytes into buf at offset pos. Returns bytes read (0 at EOF).
Args:
- self (
Self) - buf (
Span) - amt (
Int) - pos (
Int)
Returns:
UInt64
Raises: