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

    Interface WindowOptions<K>

    Options for sliding window extraction (k-mer generation)

    Generates overlapping or tiling subsequences from input sequences using a sliding window approach. Supports linear and circular sequences.

    The size parameter can be specified as a literal number to enable compile-time k-mer size inference in the output type.

    // Compile-time k-mer size tracking
    const opts = { size: 21 as const, step: 1 };
    // Type: WindowOptions<21>

    // Generate all 21-mers (overlapping)
    const kmers = await seqops(sequences).windows({ size: 21 as const }).toArray();

    // Tiling windows (non-overlapping)
    const tiles = await seqops(sequences).windows({ size: 100 as const, step: 100 }).toArray();
    interface WindowOptions<K extends number = number> {
        size: K;
        step?: number;
        greedy?: boolean;
        circular?: boolean;
        suffix?: string;
        zeroBased?: boolean;
    }

    Type Parameters

    • K extends number = number

      K-mer size as a literal number type

    Index

    Properties

    size: K

    Window size in base pairs (required)

    When specified as a literal (e.g., 21 as const), TypeScript will track this size at compile-time in the output type.

    step?: number

    Step size - distance to slide window (default: 1)

    Controls overlap between consecutive windows:

    • step < size: overlapping windows
    • step = size: adjacent (tiling) windows
    • step > size: gaps between windows
    1
    
    greedy?: boolean

    Include final window even if shorter than size (default: false)

    circular?: boolean

    Treat sequence as circular, wrapping around end (default: false)

    suffix?: string

    Suffix to append to sequence IDs (default: "_window")

    zeroBased?: boolean

    Use 0-based coordinates in output IDs (default: false = 1-based)