Genotype API Documentation - v0.1.0
    Preparing search index...

    Class BGZFCompressor

    BGZF compressor for creating BAM files

    Implements streaming compression with block-level compression for efficient writing of large BAM files. Follows Tiger Style with comprehensive validation and error handling.

    Index

    Constructors

    Methods

    • Compress a single block of data into BGZF format

      Parameters

      • data: Uint8Array

        Uncompressed data to compress

      Returns Promise<Uint8Array<ArrayBufferLike>>

      Promise resolving to compressed BGZF block

      If compression fails

    • Write a compressed block to a stream or writer

      Parameters

      • writer:
            | WritableStreamDefaultWriter<Uint8Array<ArrayBufferLike>>
            | { write(data: Uint8Array): Promise<void> }

        Writer or stream to write to

      • data: Uint8Array

        Uncompressed data to compress and write

      Returns Promise<void>

      Promise resolving when write is complete

    • Create a streaming BGZF compressor transform

      Returns TransformStream<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>

      TransformStream for streaming BGZF compression

    • Get compression statistics and performance info

      Returns {
          compressionLevel: number;
          blockSize: number;
          bunOptimized: boolean;
          streamingSupported: boolean;
          maxBlockSize: number;
      }

      Compression configuration and capabilities

    • Create an optimized compressor for high-performance scenarios

      Parameters

      • options: { compressionLevel?: number; blockSize?: number; prioritizeSpeed?: boolean } = {}

        Performance tuning options

      Returns BGZFCompressor

      Optimized compressor instance