Architecture โ Multi-Layer Pipeline to Novel Isoforms¶
Three-layer architecture enabling progression from canonical prediction to novel isoform discovery:
%%{init: {'theme':'base', 'themeVariables': { 'fontSize':'15px','fontFamily':'ui-sans-serif, system-ui, sans-serif'}}}%%
graph TB
subgraph AGENTIC["<b>๐ค AGENTIC LAYER</b> - Clinical Translation & Validation"]
direction TB
LIT["<b>๐ Literature Mining</b><br/>PubMed โข arXiv<br/>Splice Databases"]:::agent
EXP["<b>๐งฌ Expression Evidence</b><br/>GTEx โข TCGA<br/>RNA-seq Junctions"]:::agent
CLIN["<b>๐ฅ Clinical Integration</b><br/>ClinVar โข COSMIC<br/>Disease Associations"]:::agent
NEXUS["<b>๐ฏ Nexus Research Agent</b><br/>(Orchestrator)<br/>โโโโโโโโโโโโโโโ<br/>โข Evidence Aggregation<br/>โข Validation Workflows<br/>โข Drug Target Assessment<br/>โข Report Generation"]:::orchestrator
LIT --> NEXUS
EXP --> NEXUS
CLIN --> NEXUS
OUTPUT1["<b>โ
OUTPUT</b><br/>Validated Novel Isoforms<br/>Drug Target Reports"]:::output
NEXUS --> OUTPUT1
end
subgraph META["<b>๐ง META LAYER</b> - Adaptive Context-Aware Prediction"]
direction TB
MULTIMODAL["<b>๐จ Multimodal Evidence Fusion</b><br/>9 Modalities โข 100 Features"]:::metalayer
BASE["<b>๐ Base Scores</b><br/>Foundation Model<br/>Predictions (43)"]:::input
SEQ["<b>๐งฌ Sequence + Genomic</b><br/>DNA Context โข GC<br/>Conservation (19)"]:::input
EPI["<b>๐งช Epigenetic + Chromatin</b><br/>H3K36me3 โข H3K4me3<br/>ATAC-seq (18)"]:::input
RNA["<b>๐ฌ RNA Evidence</b><br/>Junction Reads โข RBP<br/>eCLIP Binding (20)"]:::input
BASE --> MULTIMODAL
SEQ --> MULTIMODAL
EPI --> MULTIMODAL
RNA --> MULTIMODAL
FUSION["<b>โก Fusion Predictor</b><br/>+ Delta Scorer<br/>โโโโโโโโโโโโโโโ<br/>ฮ = Meta - Base<br/>High ฮ โ Novel Site!"]:::fusion
MULTIMODAL --> FUSION
DETECTOR["<b>๐ Novel Site Detector</b><br/>โโโโโโโโโโโโโโโ<br/>โข High-confidence Filtering<br/>โข Context Clustering<br/>โข Multi-factor Scoring"]:::discovery
RECON["<b>๐งฉ Isoform Reconstruction</b><br/>โโโโโโโโโโโโโโโ<br/>โข Transcript Assembly<br/>โข ORF Validation<br/>โข Functional Annotation"]:::discovery
FUSION --> DETECTOR
DETECTOR --> RECON
OUTPUT2["<b>โ
OUTPUT</b><br/>Novel Splice Sites<br/>Reconstructed Isoforms"]:::output
RECON --> OUTPUT2
end
subgraph BASE_LAYER["<b>๐ฌ BASE LAYER</b> - Foundation Models (Extensible)"]
direction TB
RUNNER["<b>โ๏ธ Base Model Runner</b><br/>Standardized I/O Protocol"]:::baselayer
SA["<b>SpliceAI</b><br/>GRCh37<br/>Pre-trained"]:::foundation
OSA["<b>OpenSpliceAI</b><br/>GRCh38/MANE<br/>Pre-trained"]:::foundation
EXT["<b>Extensible</b><br/>Evo โข GPT-based<br/>Any New Model"]:::foundation
RUNNER --> SA
RUNNER --> OSA
RUNNER --> EXT
RESOURCES["<b>๐ Genomic Resources</b><br/>โโโโโโโโโโโโโโโ<br/>โข GTF/FASTA Loading<br/>โข Sequence Extraction<br/>โข Splice Annotation<br/>โข Resource Registry"]:::resources
RESOURCES --> RUNNER
OUTPUT3["<b>โ
OUTPUT</b><br/>Per-Nucleotide Scores<br/>Canonical Baseline (~10%)"]:::output
SA --> OUTPUT3
OSA --> OUTPUT3
EXT --> OUTPUT3
end
FINAL["<b>๐ NOVEL ISOFORM CATALOG</b><br/>โโโโโโโโโโโโโโโโโโโโโ<br/>โ Disease-Specific Isoforms<br/>โ Variant-Induced Splicing<br/>โ Tissue-Specific Transcripts<br/>โ Druggable Targets + Evidence<br/>โ Biomarker Candidates"]:::final
OUTPUT3 --> META
OUTPUT2 --> AGENTIC
OUTPUT1 --> FINAL
classDef agent fill:#0891b2,stroke:#0e7490,stroke-width:3px,color:#ffffff,font-weight:bold
classDef orchestrator fill:#7c3aed,stroke:#6d28d9,stroke-width:4px,color:#ffffff,font-weight:bold
classDef metalayer fill:#8b5cf6,stroke:#7c3aed,stroke-width:3px,color:#ffffff,font-weight:bold
classDef input fill:#06b6d4,stroke:#0891b2,stroke-width:2px,color:#ffffff
classDef fusion fill:#d946ef,stroke:#c026d3,stroke-width:3px,color:#ffffff,font-weight:bold
classDef discovery fill:#059669,stroke:#047857,stroke-width:3px,color:#ffffff,font-weight:bold
classDef baselayer fill:#1e40af,stroke:#1e3a8a,stroke-width:3px,color:#ffffff,font-weight:bold
classDef foundation fill:#3b82f6,stroke:#2563eb,stroke-width:2px,color:#ffffff
classDef resources fill:#475569,stroke:#334155,stroke-width:2px,color:#ffffff
classDef output fill:#ea580c,stroke:#c2410c,stroke-width:3px,color:#ffffff,font-weight:bold
classDef final fill:#d97706,stroke:#b45309,stroke-width:4px,color:#ffffff,font-weight:bold,font-size:16px
Layer Responsibilities¶
| Layer | Purpose | Output | Status |
|---|---|---|---|
| Base Layer | Canonical splice prediction (MANE) | Baseline scores for ~10% of sites | Done |
| Feature Engineering | Multimodal evidence fusion | 9-modality, 100-column enriched features | Done |
| Foundation Models | Evo2/SpliceBERT splice classification | Per-nucleotide embeddings + classifiers | Experimental |
| Meta Layer | Context-aware adaptive prediction (M1-M4) | Novel sites (90% beyond MANE) | Active |
| Agentic Layer | Multi-source validation + reports | Validated isoforms + drug targets | Planned |
Feature Engineering¶
The multimodal pipeline fuses 9 data modalities into 100 feature columns per genomic position via a YAML-driven workflow:
| Modality | Columns | Source |
|---|---|---|
| base_scores | 43 | Foundation model predictions (SpliceAI/OpenSpliceAI) |
| annotation | 3 | Ground truth splice labels |
| sequence | 3 | DNA context via pyfaidx |
| genomic | 4 | GC content, CpG density, dinucleotides |
| conservation | 9 | PhyloP/PhastCons (UCSC bigWig) |
| epigenetic | 12 | H3K36me3/H3K4me3 ChIP-seq (ENCODE) |
| junction | 12 | GTEx RNA-seq junction evidence |
| rbp_eclip | 8 | ENCODE RBP eCLIP binding peaks |
| chrom_access | 6 | ENCODE ATAC-seq chromatin accessibility |
See docs/multimodal_feature_engineering/feature_catalog.md for the complete feature reference and examples/features/docs/ for per-modality tutorials.
Delta Score Analysis¶
The key innovation for novel isoform discovery is the delta score -- the difference between meta layer and base layer predictions:
delta_score = meta_prediction - base_prediction
if delta_score > 0.3: # High confidence
# This splice site is context-dependent!
# -> Novel isoform candidate
# -> Not in MANE canonical set
# -> Validate with RNA-seq, literature, conservation
- Base layer (SpliceAI/OpenSpliceAI): Trained on canonical annotations, detects ~10% of sites
- Meta layer (Context-aware): Learns from variants, disease, tissue context, detects the other 90%
- Delta score = Confidence that this is a real novel isoform, not noise
Project Structure¶
agentic-spliceai/
โโโ src/
โ โโโ agentic_spliceai/
โ โ โ
โ โ โโโ splice_engine/ # Core splice prediction engine
โ โ โ โ
โ โ โ โโโ config/ # Configuration management
โ โ โ โ โโโ genomic_config.py # Config dataclass & loader
โ โ โ โ โโโ settings.yaml # Default settings
โ โ โ โ
โ โ โ โโโ resources/ # Genomic resource management
โ โ โ โ โโโ registry.py # Path resolution for GTF/FASTA/models
โ โ โ โ โโโ schema.py # Column standardization (splice_type, chrom)
โ โ โ โ
โ โ โ โโโ utils/ # Shared utilities
โ โ โ โ โโโ dataframe.py # DataFrame operations
โ โ โ โ โโโ display.py # Printing & formatting
โ โ โ โ โโโ filesystem.py # File I/O helpers
โ โ โ โ
โ โ โ โโโ base_layer/ # Base model predictions
โ โ โ โ โโโ models/ # Model configs + runner
โ โ โ โ โ โโโ config.py # BaseModelConfig, WorkflowConfig
โ โ โ โ โ โโโ runner.py # BaseModelRunner
โ โ โ โ โโโ prediction/ # Core prediction logic
โ โ โ โ โโโ workflows/ # Chunked prediction pipeline
โ โ โ โ โ โโโ prediction.py # PredictionWorkflow (checkpointing, resume)
โ โ โ โ โโโ io/ # Artifact management
โ โ โ โ โ โโโ artifacts.py # ArtifactManager (atomic writes, mode-aware)
โ โ โ โ โโโ data/ # Data types & preparation
โ โ โ โ
โ โ โ โโโ features/ # Multimodal feature engineering
โ โ โ โ โโโ pipeline.py # FeaturePipeline (dependency resolution)
โ โ โ โ โโโ workflow.py # FeatureWorkflow (genome-scale)
โ โ โ โ โโโ modality.py # Modality protocol (ABC)
โ โ โ โ โโโ verification.py # Position alignment verification
โ โ โ โ โโโ modalities/ # 9 modalities:
โ โ โ โ โโโ base_scores.py # 43 engineered features
โ โ โ โ โโโ annotation.py # Ground truth labels (3)
โ โ โ โ โโโ sequence.py # DNA context via pyfaidx (3)
โ โ โ โ โโโ genomic.py # GC content, CpG, dinucs (4)
โ โ โ โ โโโ conservation.py # PhyloP/PhastCons bigWig (9)
โ โ โ โ โโโ epigenetic.py # H3K36me3/H3K4me3 ChIP-seq (12)
โ โ โ โ โโโ junction.py # GTEx RNA-seq junctions (12)
โ โ โ โ โโโ rbp_eclip.py # ENCODE RBP eCLIP binding (8)
โ โ โ โ โโโ chrom_access.py # ENCODE ATAC-seq accessibility (6)
โ โ โ โ
โ โ โ โโโ eval/ # Cross-layer evaluation
โ โ โ โ โโโ metrics.py # TP/FP/FN, sensitivity, specificity
โ โ โ โ โโโ output.py # EvaluationOutputWriter
โ โ โ โ โโโ display.py # Result visualization
โ โ โ โ
โ โ โ โโโ data/ # Cross-layer data utilities
โ โ โ โ โโโ sampling.py # Balanced train/test sampling
โ โ โ โ
โ โ โ โโโ meta_layer/ # Meta-learning layer
โ โ โ โ โโโ core/ # Configuration & schema
โ โ โ โ โ โโโ config.py # MetaLayerConfig
โ โ โ โ โ โโโ feature_schema.py # Feature definitions (8 column groups)
โ โ โ โ โโโ models/ # Neural network models
โ โ โ โ โโโ training/ # Training pipeline
โ โ โ โ โโโ workflows/ # Meta-layer workflows
โ โ โ โ
โ โ โ โโโ cli/ # CLI entry points
โ โ โ โโโ predict.py # agentic-spliceai-predict
โ โ โ โโโ prepare.py # agentic-spliceai-prepare
โ โ โ
โ โ โโโ agents/ # Agentic workflows (WIP)
โ โ โโโ server/ # FastAPI splice service
โ โ โโโ analysis/ # Analysis tools & templates
โ โ
โ โโโ nexus/ # Research agent package
โ โโโ agents/ # Multi-agent pipeline
โ โ โโโ research/ # Research orchestrator
โ โ โโโ planner/ # Research planning
โ โ โโโ researcher/ # Information gathering
โ โ โโโ writer/ # Report writing
โ โ โโโ editor/ # Report refinement
โ โโโ core/ # Core utilities
โ โโโ cli/ # CLI interface
โ โโโ templates/ # Report templates
โ
โโโ foundation_models/ # Experimental sub-project (own pyproject.toml)
โ โโโ foundation_models/
โ โ โโโ evo2/ # Evo2-based exon classifier
โ โ โ โโโ config.py # Evo2Config (device auto-detect)
โ โ โ โโโ model.py # HuggingFace wrapper
โ โ โ โโโ embedder.py # Chunked extraction + HDF5 cache
โ โ โ โโโ classifier.py # ExonClassifier (linear/MLP/CNN/LSTM)
โ โ โโโ utils/ # Quantization, chunking
โ โโโ configs/skypilot/ # SkyPilot cloud deployment (RunPod)
โ โโโ examples/ # Learning path (01-05)
โ โโโ docs/ # Sub-project documentation
โ
โโโ server/ # Standalone FastAPI services
โ โโโ bio/ # Bioinformatics Lab UI (port 8005)
โ โ โโโ app.py # FastAPI + Jinja2 entry point
โ โ โโโ bio_service.py # Core service (LRU cache, predictions)
โ โ โโโ templates/ # HTML templates (Gene Browser, etc.)
โ โโโ splice_service/ # Splice prediction API (port 8004)
โ โโโ chart_service/ # Chart/viz API (port 8003)
โ
โโโ examples/ # Learning path examples
โ โโโ base_layer/ # 5 scripts: prediction -> precomputation
โ โโโ features/ # 4 scripts: base scores -> genome-scale
โ โโโ foundation_models/ # 5 scripts: resource check -> orchestrate
โ โโโ data_preparation/ # Data prep & ground truth generation
โ
โโโ data/ # Data directory (symlinked)
โ โโโ ensembl/GRCh37/ # Ensembl annotations
โ โโโ mane/GRCh38/ # MANE annotations
โ โโโ models/ # Pre-trained model weights
โ
โโโ notebooks/ # Jupyter analysis & demos
โโโ docs/ # Public documentation (MkDocs)
โโโ scripts/ # Utility scripts
โโโ tests/ # Unit tests
โโโ pyproject.toml # Package configuration
Related Documentation¶
- Package Organization -- How the codebase is structured
- Structure Guide -- Directory structure overview
- Processing Architecture -- Base layer architecture
- Configuration System -- Pydantic-based configuration patterns
Last Updated: March 2026