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

    Interface AlignmentRecord

    Alignment record from a BAM or SAM file.

    Extends AbstractSequence so that alignment records flow through the operations pipeline (grep, filter, unique, translate, etc.) without conversion. Extends QualityScoreBearing so that quality-aware operations (trimming, filtering, binning) work on alignment records the same way they work on FASTQ records.

    The alignment-specific fields represent a focused subset of the SAM/BAM specification — enough for common sequence-oriented workflows without trying to model the full spec. Fields like mate info (RNEXT, PNEXT, TLEN), optional tags, and BAM binary metadata are excluded from the initial implementation and can be added later.

    The AbstractSequence fields are populated as:

    • id ← QNAME (the read name)
    • sequence ← decoded sequence bytes
    • length ← sequence length
    • description ← undefined (SAM/BAM records don't have descriptions)
    interface AlignmentRecord {
        id: string;
        description?: string;
        sequence: GenotypeString;
        length: number;
        lineNumber?: number;
        quality: GenotypeString;
        qualityEncoding: QualityEncoding;
        format: "sam" | "bam";
        flag: number;
        referenceSequence: string;
        position: number;
        mappingQuality: number;
        cigar: string;
    }

    Hierarchy (View Summary)

    Index

    Properties

    id: string

    Sequence identifier (required, but may be empty string in malformed data)

    description?: string

    Optional description/comment line

    sequence: GenotypeString

    The actual sequence data

    length: number

    Cached sequence length for performance

    lineNumber?: number

    Original line number where this sequence started (for error reporting)

    qualityEncoding: QualityEncoding
    format: "sam" | "bam"
    flag: number

    SAM bitwise FLAG field (0-65535)

    referenceSequence: string

    Reference sequence name, or "*" if unmapped

    position: number

    1-based leftmost mapping position, or 0 if unmapped

    mappingQuality: number

    Mapping quality (0-255, where 255 indicates unavailable)

    cigar: string

    CIGAR string, or "*" if unavailable