Skip to content

Isovar White Paper: Evidence-First Tumor RNA Reconstruction Across Antigen Categories

Version: 1.97.7
Project: OpenVax / Isovar


Executive Summary

Translating somatic DNA variant calls directly against a canonical reference transcript is an unreliable proxy for the peptide sequences that a tumor actually transcribes. Real tumor RNA frequently differs from DNA-only predictions because of unexpressed alleles, nonsense-mediated decay, adjacent phased germline or somatic polymorphisms, alternative or cryptic splicing, structural rearrangements with unannotated junctions, strain-divergent viral transcripts, and compartment-specific genetic codes.

Isovar is an evidence-first RNA sequence reconstruction and reconciliation library for cancer immunology. Rather than patching a reference transcript with a single nominated edit, Isovar collects original aligned tumor RNA reads, assembles observed nucleotide paths, anchors reading frames against versioned transcript or ORF models, and quantifies exact fragment-level and read-level support without ever filling uncovered gaps from reference sequence.

Within the OpenVax pipeline, responsibilities are strictly partitioned:

  • Varcode generates transcript hypotheses and predicts coding consequences from DNA and structural variants.
  • Isovar reconstructs RNA-supported nucleotide and protein sequences from original alignments, reconciles them against Varcode hypotheses and reference catalogues, and preserves competing or unresolved outcomes explicitly.
  • Vaxrank ranks protein and peptide vaccine candidates from Isovar's reconstructed sequences and MHC predictions.

This white paper describes Isovar's scientific principles, core algorithms and data structures, cross-platform safeguards, and verified benchmarks on seven public datasets spanning somatic SNVs and indels, structural variants and fusions, viral antigens, cancer-testis antigen (CTA) isoforms, non-canonical ORFs, and cross-species models.


1. Scientific Purpose and Design Principles

DNA-only neoantigen pipelines silently introduce four recurring failure modes:

  1. Unexpressed or degraded alleles. A somatic coding mutation in DNA may have zero RNA expression or undergo nonsense-mediated decay, producing no transcribed antigen.
  2. Cis-phased context errors. A nearby germline SNP, somatic MNV, or in-frame indel on the same haplotype alters the surrounding 8–25 aa peptide window; predicting from the reference plus one edit manufactures a nonexistent peptide.
  3. Splicing and rearrangement divergence. Exon skipping, cryptic splice sites, intron retention, and structural-variant junctions frequently depart from canonical transcript structures and cannot be inferred from DNA breakpoints alone.
  4. Conflated evidence units. Treating alignment record counts as independent molecules, pooling technical reprocessings across libraries, or extrapolating reference sequence past observed read coverage inflates confidence and hides ambiguity.

Isovar enforces five invariant contracts across every workflow:

Principle Operational guarantee
No reference padding Every nucleotide in a reconstructed protein window comes from observed RNA reads; uncovered sequence is never filled from reference DNA.
Non-destructive filtering Filters annotate results (passes_all_filters, filter:<name>) without silently dropping variants or hiding empty results.
Explicit evidence units Sequenced segments (reads), paired-end templates (fragments), whole-path spans, and optional UMI/cell labels are tracked separately and never equated with verified molecule counts or TPM.
Preserved ambiguity Competing spliced paths, multi-mapping placements (NH, SA, MAPQ=0), and unresolved reading frames remain explicit instead of forcing a single arbitrary call.
Bounded scientific claims Reconstructed RNA supports transcription of a sequence; it does not establish translation initiation, protein abundance, tumor specificity, or MHC presentation.

OpenVax Ecosystem and Antigen Routing

flowchart LR
    subgraph Inputs["Observed & Reference Inputs"]
        DNA["DNA Variants (VCF / MAF / SV)"]
        RNA["Tumor & Normal RNA (BAM / CRAM)"]
        REF["Versioned References (PyEnsembl, GDC GRCh38.d1.vd1, ORFdata, OncoRef)"]
    end

    subgraph Varcode["Varcode"]
        VC["Transcript & Structural Hypotheses (EffectCandidate, MutantTranscript)"]
    end

    subgraph Isovar["Isovar Reconstruction & Reconciliation"]
        SV["Small Variants (run_isovar / isovar run)"]
        SVRNA["SV & Fusion RNA (isovar sv-rna / fusion-rna)"]
        ISO["CTA & Antigen Isoforms (isovar isoforms)"]
        VIR["Viral RNA (isovar viral-rna)"]
        ORF["Non-canonical ORFs & Compartment Origin (variant-rna-paths / rna-origin)"]
    end

    subgraph Downstream["Downstream Consumers"]
        VR["Vaxrank (Epitope & Vaccine Ranking)"]
        PR["RNA Proteome & Evidence Reports (CSV / JSON / FASTA / PDF)"]
    end

    DNA --> VC
    REF --> VC
    REF --> Isovar
    VC --> SV
    VC --> SVRNA
    RNA --> SV
    RNA --> SVRNA
    RNA --> ISO
    RNA --> VIR
    RNA --> ORF
    SV --> VR
    SV --> PR
    SVRNA --> PR
    ISO --> PR
    VIR --> PR
    ORF --> PR

2. Core Architecture and Mechanisms

Isovar combines two complementary engines built on shared read-identity, contig-resolution, and genetic-code primitives:

  1. The locus-anchored small-variant pipeline (run_isovar) for SNVs, MNVs, and literal indels.
  2. The unified RNA-path discovery and complete-input support engine (discover_rna_paths and support_rna_paths) for structural variants, fusions, variant-free CTA isoforms, viral transcripts, and literal allele paths.

2.1 Small-Variant Pipeline (run_isovar)

For each literal genomic variant, Isovar transforms aligned RNA segments into ranked, frame-anchored mutant protein hypotheses in five stages:

flowchart TD
    A["VCF / Variant + Indexed Genomic BAM"] --> B["ReadCollector: fetch overlapping alignments"]
    B --> C["LocusRead: CIGAR & alignment filtering (MAPQ, duplicates, secondary, soft-clips, mate merging)"]
    C --> D["AlleleRead & ReadEvidence: partition into ref / alt / other alleles"]
    D --> E["VariantSequenceCreator: overlap assembly & coverage trimming (context-length ladder)"]
    E --> F["ReferenceContext: collapse overlapping Ensembl coding transcripts into upstream cDNA + frame {0,+1,+2} + NCBI table"]
    F --> G["VariantORF & Translation: match assembled cDNA against reference contexts and translate to stop"]
    G --> H["ProteinSequenceCreator: group equivalent amino-acid sequences, compute TranscriptAssemblyEdit & support"]
    H --> I["IsovarResult: top_protein_sequence, sorted_protein_sequences, allele support, non-destructive filters"]

Key algorithmic details at each stage:

  • Read collection and allele partitioning (ReadCollector, LocusRead, AlleleRead): Alignments overlapping the trimmed genomic footprint are extracted via CIGAR operations while retaining original query coordinates, base qualities (including missing QUAL as explicitly unknown), and alignment provenance. Reads are partitioned into ref, alt, and other pools. Mate pairs belonging to one template share a fragment identity so paired reads are never double-counted as independent fragments. Optional BaseQualityPolicy evaluates focal-allele quality footprints without silently discarding unknown qualities.
  • Exact-overlap assembly and coverage trimming (VariantSequenceCreator): Mutant AlleleRead sequences are assembled by exact sequence overlap into longer VariantSequence candidates. Assembly never bridges gaps with reference bases. When variant_sequence_length is omitted on the CLI, the pipeline evaluates a context-length ladder so a variant with limited flank depth still recovers its maximal supported window rather than failing an arbitrary fixed length.
  • Reference-context collapsing (ReferenceContext, ReferenceSequenceKey): All complete coding transcripts overlapping the variant are collapsed by their upstream cDNA context, reading frame {0, +1, +2}, and compartment genetic code (translation_table, e.g., NCBI table 1 nuclear vs. table 2 vertebrate mitochondrial). Distinct genetic codes never collapse into one context even when local sequences match.
  • Frame placement, translation, and edit attribution (VariantORF, ProteinSequenceCreator): Each VariantSequence is aligned to compatible ReferenceContext sequences and translated using Varcode's shared NCBI codon tables until an observed stop codon or the end of observed RNA. Distinct assemblies yielding the same protein are merged into one ProteinSequence while preserving all supporting reads, transcript IDs, and TranscriptAssemblyEdit records capturing any co-occurring cis alleles or splice differences.
  • High-depth performance indexing (SharedReadSupportIndex): At deep multi-transcript loci, ReadCollector shares equal coordinate integers inline (#241), and SharedReadSupportIndex uses bitmask coverage and C-level frozenset intersections (#544) to reuse flank/read-pool matching across pre-/post-trim passes and transcript groups with identical scientific outputs.

2.2 Unified RNA-Path Engine (SVs, Fusions, CTA Isoforms, and Viral RNA)

Structural variants, fusions, cancer-testis isoforms, and viral transcripts cannot assume a single small local genomic coordinate. Isovar therefore shares one two-phase architecture across isovar sv-rna, isovar fusion-rna, isovar isoforms, isovar viral-rna, and isovar variant-rna-paths:

flowchart TD
    BAM["Original BAM / CRAM + Versioned Genome FASTA"] --> IDX["RnaLibraryIndex (SQLite disk-backed template index preserving all mates, secondary & SA records)"]
    IDX --> DISC["Phase 1: discover_rna_paths (budgeted exact-overlap extension with per-parent placement constraints)"]
    DISC --> CAND["Candidate RNA Paths (observed assemblies + reference competitors where declared)"]
    IDX --> SUP["Phase 2: support_rna_paths (exhaustive complete-input recount; never capped by discovery budget)"]
    CAND --> SUP
    SUP --> EV["Per-Path & Equivalence-Class Evidence (unique_fragments, compatible_fragments, whole_path_segments, placement_uncertainty, CellUmiEvidence)"]
    EV --> SVOUT["SV & Fusion Reconciliation (Varcode MutantTranscript, event_linked vs ordinary splice, ORF start tiers)"]
    EV --> ISOOUT["CTA Isoforms (complete_CDS, protein_groups, optional Salmon competitive-transcriptome TPM)"]
    EV --> VIROUT["Viral RNA (GDC GRCh38.d1.vd1 or custom contigs, ORFdata sequence-qualified coding anchors)"]

Why separating Phase 1 (bounded discovery) from Phase 2 (complete-input support) matters:

  1. Disk-backed template fidelity (RnaLibraryIndex): All alignment records for a template (read 1, read 2, supplementary split alignments, and secondary multi-mappers) are indexed on disk by (read_group, query_name). An SA tag is treated as a hint, never as an independently observed alignment; missing mapped mates, MAPQ=0, MAPQ=255 without NH, or unreported NH placements are recorded in placement_uncertainty and block false unique attribution.
  2. Parent-constrained path assembly: Alternative placements of the same sequenced segment cannot extend one another into a synthetic chimera. When discovery reaches max_discovery_reads or max_paths, discovery.truncated is explicitly flagged (and blocks dominance claims in isoform quantification), while Phase 2 still recounts every eligible read across the entire declared input.
  3. Reference models as competitors, never sequence donors: In isovar isoforms, annotated transcripts enter Phase 2 as explicit competitors alongside observed assemblies. Unobserved reference models remain marked sequence_status="not_observed" with compacted empty coverage arrays in JSON and are excluded from transcripts.fa by default, while remaining available for Salmon's competitive transcriptome index.

2.3 Cross-Platform Evidence Units and Confounder Safeguards

flowchart LR
    subgraph Units["Evidence Unit Hierarchy"]
        R["Aligned Records (primary / secondary / supplementary)"] --> S["Sequenced Segments (read_group, query_name, mate)"]
        S --> F["Distinct Fragments (read_group, query_name)"]
        F --> U["Cell / UMI Labels (CB / UB; library-scoped, never pooled across timepoints)"]
    end

    subgraph Safeguards["Built-in Confounder Controls"]
        P["Phasing & Error Calibration (four-gamete test + truth-labeled control BAMs)"]
        AD["Adapter & Poly-A Profiles (CIGAR-safe read-end annotation; prevents adapter-induced false fusions)"]
        NM["Matched-Normal Evidence (allele-level comparison without collapsing GRCh37 MT vs chrM)"]
        MT["Nuclear vs Mitochondrial Origin (explicit NCBI tables 1/2/3 + NuMT placement diagnostics)"]
    end

    Units --> Safeguards
  • Control-derived phasing calibration (isovar calibrate-phasing): Pairwise phasing uses directional upper error bounds derived from independent truth-labeled control BAMs (verified by both path and SHA-256 content hash) rather than assuming a fixed symmetric error rate across Illumina, ONT, and PacBio chemistries.
  • Adapter and poly-A recognition (ReadEndProfile): Soft-clipped sequence reused near SV breakends is checked against explicit sequencing-adapter and poly-A/T profiles so technical tails cannot masquerade as fusion partner evidence.
  • Reference and compartment discipline: On GRCh37/hg19, Isovar keeps hg19 chrM (NC_001807) strictly separate from rCRS MT (NC_012920). Mitochondrial coding translation uses NCBI table 2 only when anchored to mitochondrial reference contexts; nuclear NuMT loci retain nuclear table 1, and isovar rna-origin quantifies placement ambiguity between nuclear and mitochondrial contigs.

3. Benchmarks on Public Data Across Antigen Categories

Every benchmark below uses unmodified public sequencing data pinned by accession and SHA-256 checksum in this repository's regression and audit suites. Because several fixtures are regional or locus-selected slices rather than whole-transcriptome screens, each dataset's exact scope and limitations are stated beside its results.

3.1 Cross-Category Benchmark Summary

Antigen category Public dataset & accession Platform / assembly Scale evaluated Key verified Isovar outcome
Somatic SNVs (mouse melanoma) B16-F10 (tests/data/b16.f10/) Bulk Illumina RNA-seq; GRCm38 / Ensembl 102 4 somatic SNVs 2 expressed (chr9:82927102 G>T: 15 alt fragments; chrX:8125624 C>A: 21 alt fragments) yielding 49-aa mutant windows; 2 unexpressed (0 alt fragments) retained and flagged by filters
Somatic SNVs & deletions (human multi-platform cohort) Sid osteosarcoma (osteosarc.com, CC0; tests/data/osteosarc/expansion/audit/SUMMARY.md) Bulk Illumina, ONT scRNA, PacBio Iso-Seq, 10x scRNA, blood pools; GRCh38 44 vaccine variants (37 SNVs, 7 deletions) × 164 RNA products = 7,216 rows 749 expected_top_protein; 16 different_top_protein (real RNA diverging from DNA-only prediction); 3,740 no_alt_reads; 78 no_translation; explicit separation of missing indexes & timeouts
Cross-species somatic SNV (canine osteosarcoma) WLOS_0001 TP53 (SRR8691780 / PRJNA525883; tests/data/wlos0001_tp53/) Bulk Illumina tumor RNA; CanFam3.1 / Ensembl 98 1,087 regional records at 5:32563056 G>A After duplicate/secondary exclusion: 297 alt reads (289 alt fragments) vs. 107 ref reads (102 ref fragments) and 1 other; translates mutant Cys across 3 Ensembl 98 transcripts (p.R261C, p.R325C, p.R238C)
Gene fusion (short-read + long-read cross-check) HCC1395 EIF3K–CYP39A1 (INTEGRATE Illumina + ONT direct RNA SRR23456709; tests/data/hcc1395_eif3k_cyp39a1/) Illumina + ONT direct RNA; GRCh37-lite / GRCh38, Ensembl 87 185 Illumina fusion records + 19 tiling records; 18 tumor vs. 0 normal DNA pairs (MAPQ 37); 21 ONT queries Exact >=20-nt Illumina overlap tiling reconstructs complete 531-aa predicted fusion CDS; 9 ONT reads span start-to-stop (4 with exact 20+20-nt junction covering 1,513–1,539 / 1,596 coding bases)
Whole-run SV & somatic audit COLO829 melanoma (SRR8615617, SMaHT + Valle-Inclan / Paulin Paz v2; tests/data/colo829_whole_run/) Bulk Illumina RNA (115,269,780 pairs / 230.54M reads); GRCh38 129,534 selected-site alignments (125,980 primary) across SNVs/indels + 188 SV records Reproducible offline replay of small variants and SV breakpoints; SV3 local join extends to 2,435 nt (5 spots with exact 43-nt junction) with 0 exact CNIH3 exon anchor bases, correctly retained as exploratory rather than promoted
Long-read SV / fusion windows (human osteosarcoma) Sid ONT T1/T2 fusions (tests/data/fusions/) ONT single-cell tagged BAMs; GRCh38 / Ensembl 87 TPST1–CRCP, FOXO3, PARD3B regional windows Retains exact junction sequence and PARD3B 12-nt TGTGCTGATATG insertion (TPST1: 61/122 CB-UMI labels; FOXO3: 5/5; PARD3B: 2 T1); keeps all 5 partial windows explicitly unresolved where donor CDS anchoring is absent
Viral RNA & coding variants (cervical cancer) SiHa cell line (GSM4785628 / SRR12650977, PRJNA663801; tests/data/viral/siha/) Total Illumina RNA competitively aligned to GDC GRCh38.d1.vd1; ORFdata 1M-pair full replay (71 target fragments, 26 paths) + 23-fragment pinned slice (46 records, 7 paths) Reconstructs 344-nt tiled HPV16 path encoding a complete 98-aa E7 coding prediction carrying the strain/sample L28F difference from RefSeq NP_041326.1 (all_bases_observed=True, 3 host-competing fragments kept separate in full replay)
CTA isoforms & competitive quantification OncoRef human CTA catalogue + GDC GRCh38.d1.vd1 (tests/test_antigen_isoforms.py, docs/antigen-isoforms.md) Short- and long-read RNA; GRCh38 / GENCODE / Ensembl + Salmon Multi-isoform mixtures, paralogs, novel internal splices, and sequence alleles Exact sequence recovery for novel alleles and internal splices; separates observed_coding_tpm from uncovered_reference_coding_tpm; collapses indistinguishable paralog/isoform groups and refuses dominance under truncation or NH>1
Non-canonical ORFs & mitochondrial codes ORFdata + OpenProt IP_306399 (vertebrate MT) + yeast OLI1 / Q0092 (docs/uorf-evidence.md, tests/test_uorf_catalog.py) Human, vertebrate MT, and yeast MT annotations Schema isovar.variant_rna_orfs.v2 Preserves explicit NCBI translation_table (1, 2, 3) and translation_table_source (orf_model vs. reference_context); separates reference MS/Ribo-seq evidence from conditional altered products

3.2 Case Study Highlights: Why RNA-First Reconstruction Matters

  1. Divergence from DNA-only predictions (osteosarc.com, 7,216 evaluations): Across 44 vaccine-nominated variants in 164 RNA alignment products, 749 rows matched the reference-plus-single-edit protein while 16 rows produced a genuinely different top RNA-translated protein (different_top_protein), and 3,740 rows had zero alt-supporting reads (no_alt_reads). Another 460 rows had alt reads but failed assembly (no_rna_candidate, 382) or reading-frame translation (no_translation, 78). DNA-only pipelines cannot distinguish these failure modes from expressed neoantigens.
  2. Annotation-independent cross-species anchoring (WLOS_0001 canine TP53): The published p.Arg263Cys label depends on a specific transcript numbering, whereas Ensembl release 98 assigns p.R261C, p.R325C, and p.R238C across three TP53 isoforms. Anchoring on the genomic call (5:32563056 G>A) and observed RNA fragments (289 alt fragments vs. 102 ref fragments) reconstructs the mutant Cys protein context consistently across all three transcripts.
  3. Strain-divergent viral epitopes without a viral GTF (SiHa HPV16 E7): Aligning total tumor RNA competitively against GDC GRCh38.d1.vd1 (2,779 human/decoy/viral contigs including a 200-contig viral panel) and reconstructing with isovar viral-rna recovers the observed HPV16 E7 RNA sequence carrying L28F relative to canonical RefSeq NP_041326.1 — a sequence difference that reference-only viral epitope prediction would miss — while explicitly flagging rna_strand="unknown" and whole_cds_segments=[] because the 344-nt path is tiled rather than spanned by one read.
  4. Refusing to fabricate uncertain SV ORFs (COLO829 SV3 and Sid ONT fusions): On COLO829 (SRR8615617, 115.27M pairs), five fragments carry an exact 43-nt SV3 junction and extend locally to 2,435 nt, yet none anchor directly to an Ensembl 87 CNIH3 exon; similarly, five local Sid ONT fusion windows lack collinear donor CDS anchoring. In both cases Isovar preserves the exact observed sequences and fragment counts while refusing to promote exploratory ORFs into confirmed mutant proteins.

4. Computational Performance and Scaling

Isovar is engineered to run on real tumor RNA-seq libraries (from 1M-read ONT direct RNA runs up to >100M-pair bulk Illumina BAMs) with predictable memory and exact reproducibility:

  • Low-overhead read collection: ReadCollector shares equal genomic coordinate integers inline during LocusRead construction, avoiding redundant per-read coordinate allocations at high-depth loci (#241), and supports htslib decompression_threads for parallel BAM/CRAM decoding.
  • Shared support indexing: SharedReadSupportIndex indexes flanking reads once per locus using bitmask coverage and C-level frozenset intersections across trim passes, context lengths, and transcript groups (#544).
  • Disk-backed reusable RNA library indexes (--library-cache): RnaLibraryIndex stores original template alignments in a content-validated SQLite cache so viral, CTA isoform, and SV path tasks avoid holding whole BAMs in RAM and can reuse indexes across runs with matching reference and read-collection policies.
  • Scoped discovery budgets (--discovery-partition gene): For large panels such as the OncoRef CTA catalogue, per-gene discovery partitioning prevents a single highly expressed locus from exhausting the panel budget while Phase 2 still performs exhaustive complete-input support counting. Compact empty coverage lists (coverage=[]) for unobserved reference models prevent multi-megabyte zero-padding in JSON exports.

5. Scope and Scientific Interpretation Guardrails

What Isovar establishes What Isovar does not establish
Exact nucleotide sequences and local reading-frame translations supported by observed RNA alignments Protein translation efficiency, steady-state protein abundance, or MHC presentation (downstream of RNA)
Distinct segment, fragment, whole-path, and optional cell/UMI support counts under an explicit read policy Verified independent RNA molecule counts (without validated UMI deduplication) or library-normalized TPM
Explicit agreement or divergence between observed RNA and DNA-based Varcode predictions Proof of biological absence when coverage is zero, discovery is truncated, or inputs are regional subsets
Matched-normal allele counts and nuclear/mitochondrial placement uncertainty Tumor specificity without matched-normal DNA/RNA and whole-genome uniqueness evidence

6. Further Reading