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

    Interface PairOptions

    Options for paired-end read matching and ordering

    Controls how reads are matched by ID, memory limits for buffering, and handling of unpaired reads at end-of-file.

    // Basic usage with defaults
    seqops(r1Stream).pair(r2Stream);

    // Custom ID extraction for non-standard formats
    seqops(r1Stream).pair(r2Stream, {
    extractPairId: (id) => id.split('_')[0]
    });

    // Strict mode - error on unpaired reads
    seqops(mixedStream).pair({
    onUnpaired: 'error',
    maxBufferSize: 50000
    });
    interface PairOptions {
        extractPairId?: (id: string) => string;
        maxBufferSize?: number;
        onUnpaired?: "error" | "warn" | "skip";
    }
    Index

    Properties

    extractPairId?: (id: string) => string

    Custom function to extract base ID from sequence ID

    Used to match R1 and R2 reads that have different suffixes. Default implementation strips common suffixes like /1, /2, _R1, _R2, etc.

    Type Declaration

      • (id: string): string
      • Parameters

        • id: string

          Full sequence ID

        Returns string

        Base ID for matching

    defaultExtractPairId
    
    // Default handles standard formats:
    // "READ_001/1" → "READ_001"
    // "READ_001_R1" → "READ_001"

    // Custom extraction for special format:
    extractPairId: (id) => id.split('_')[0]
    // "Sample_001_forward" → "Sample"
    maxBufferSize?: number

    Maximum reads to buffer before throwing MemoryError

    Prevents memory overload when processing highly shuffled data. Warning emitted at 80% of limit.

    100000
    
    // Conservative limit for large files
    { maxBufferSize: 50000 }

    // Generous limit for heavily shuffled data
    { maxBufferSize: 500000 }
    onUnpaired?: "error" | "warn" | "skip"

    How to handle unpaired reads at end-of-file

    Controls behavior when reads don't have matching pairs:

    • 'warn': Emit read and log warning (default)
    • 'skip': Drop unpaired reads silently
    • 'error': Throw error on first unpaired read
    'warn'
    
    // Production: skip unpaired reads
    { onUnpaired: 'skip' }

    // Development: strict validation
    { onUnpaired: 'error' }

    // QC: emit warnings for investigation
    { onUnpaired: 'warn' }