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

    Interface LibGenotype

    Determine the Zig target triple for the current platform Maps Node.js platform/arch to Zig-compatible target strings

    Target string in format "arch-platform" (e.g., "x86_64-macos")

    interface LibGenotype {
        calculateGCContent(sequence: string): number;
        decompressBGZFBlock?(
            compressedData: Uint8Array,
            outputBuffer: Uint8Array,
        ): number;
        decodePackedSequence?(
            packedData: Uint8Array,
            sequenceLength: number,
        ): string;
        convertQualityScores?(qualityString: string): number[];
    }
    Index

    Methods

    • Calculate GC content for a nucleotide sequence Optimized Rust implementation for large genomic sequences

      Parameters

      • sequence: string

        Input nucleotide sequence string (IUPAC codes)

      Returns number

      GC content as ratio (0.0 to 1.0), ignoring ambiguous bases

    • Decompress a BGZF block using optimized native implementation BGZF is the block-compressed gzip format used in BAM files

      Parameters

      • compressedData: Uint8Array

        Input compressed data buffer

      • outputBuffer: Uint8Array

        Output buffer for decompressed data (must be pre-allocated)

      Returns number

      Number of bytes written to output buffer, or -1 on error

    • Decode 4-bit packed nucleotide sequence to ASCII string Used for BAM sequence field decoding where each base uses 4 bits

      Parameters

      • packedData: Uint8Array

        4-bit packed sequence data from BAM file

      • sequenceLength: number

        Number of bases to decode

      Returns string

      Decoded nucleotide sequence string using IUPAC codes

      Error if packed data is insufficient for sequence length

    • Convert quality string to numeric scores array Handles Phred+33 encoding (standard in modern FASTQ files)

      Parameters

      • qualityString: string

        Input quality string (ASCII encoded)

      Returns number[]

      Array of numeric quality scores (0-93 for Phred+33)

      Error if quality string contains invalid characters