Skip to content
chazhyseniPublic

About

Biological Regulatory Integration & Detection through Genomic Language Models

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

Β 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

BRIDGE-LM

Biological Regulatory Integration & Detection through Genomic Language Models

Python 3.9+ PyTorch

A hierarchical transformer-based framework that orchestrates multiple genomic language models to detect regulatory elements with both genome-wide context and nucleotide-level precision

πŸ“š Full Documentation | πŸš€ Quick Start | πŸ“Š Examples


🎯 The Challenge

Regulatory elements (enhancers and promoters) pose unique detection challenges:

  • Distance: Can be up to 1 million base pairs away from target genes
  • Size variability: Enhancers range from 100-2000bp with no fixed length
  • Fuzzy boundaries: Unlike genes, regulatory elements have gradual transitions
  • Context-dependent: Same sequence can be active in one cell type but not another
  • Evolutionary flexibility: Regulatory sequences evolve rapidly

Traditional methods miss complex patterns. Single deep learning models face a fundamental tradeoff between long-range context and nucleotide precision.

πŸ’‘ The BRIDGE Solution

Key Insight: Instead of building one model that does everything adequately, BRIDGE orchestrates multiple specialized models, each excelling at what it does best, in a biologically-informed pipeline.

Three-Stage Hierarchical Approach

Input DNA (up to 450kb)
        ↓
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Stage 1: Long-Range Scanning        β”‚
β”‚ HyenaDNA (450kb context)            β”‚
β”‚ β†’ Coarse predictions                β”‚
β”‚ β†’ Candidate regions                 β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
        ↓
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Stage 2: Precise Boundary Detection β”‚
β”‚ DNABERT-2 (512bp windows)           β”‚
β”‚ β†’ Token-level analysis              β”‚
β”‚ β†’ Attention gradients               β”‚
β”‚ β†’ Exact boundaries                  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
        ↓
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Stage 3: Multi-Signal Integration   β”‚
β”‚ β€’ LucaOne validation                β”‚
β”‚ β€’ DNA shape features                β”‚
β”‚ β€’ Conservation scores               β”‚
β”‚ β€’ Motif analysis                    β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
        ↓
Validated Regulatory Elements

🌟 Key Features

  • 🎯 Multi-scale analysis: Combines long-range (450kb) and short-range (512bp) models
  • 🌍 Cross-species support: Works across human, mouse, zebrafish, and other species using mean pooling
  • ⚑ Production-ready: vLLM optimization, REST API, batch processing, and continuous serving
  • 🧬 Multi-modal validation: DNA, RNA, and protein sequence integration
  • πŸ“Š Expression prediction: Links regulatory elements to gene expression
  • πŸ”§ Modular design: Easy to extend with new models or analysis types
  • 🎨 Precise boundaries: Multi-signal integration for accurate element delineation

πŸš€ Quick Start

Installation

# Clone repository
git clone https://github.com/chazhyseni/BRIDGE-LM.git
cd BRIDGE-LM

# Create conda environment
conda env create -f environment.yml
conda activate dna-models

# Install BRIDGE
pip install -e .

# Download pre-trained models (50GB)
python scripts/download_models.py
python scripts/download_data.py --genomes hg38 mm10

Basic Usage

from bridge import WorkflowOrchestrator
import asyncio

# Initialize BRIDGE
orchestrator = WorkflowOrchestrator()
await orchestrator.initialize()

# Analyze a sequence
from bridge.core.models import DNASequence
seq = DNASequence(
    sequence="ATCGATCG" * 1000,  # 8kb sequence
    chromosome="chr12",
    start=7940000,
    end=7948000
)

# Get results
results = await orchestrator.components['model_manager'].predict_regulatory_elements(seq)

# Print detected elements
for element in results:
    print(f"{element.element_type}: {element.chr}:{element.start}-{element.end}")
    print(f"  Score: {element.score:.3f}")
    print(f"  Core region: {element.core_start}-{element.core_end}")
    print(f"  TF motifs: {', '.join([m['tf'] for m in element.tf_motifs[:3]])}")

Command Line Interface

# Analyze single sequence
bridge analyze -s ATCGATCG... --output results.json

# Batch analysis
bridge batch -i sequences.fasta -o results.bed --format bed

# Gene-centric analysis
bridge gene -g NANOG --upstream 1000000 --downstream 100000

# Start API server
bridge serve --host 0.0.0.0 --port 8000

πŸ“Š Examples

Cross-Species Analysis

# Compare regulatory landscapes across species
results = await orchestrator.cross_species_analysis(
    reference_species="human",
    target_species=["mouse", "zebrafish"],
    chromosome="chr2",
    start=176000000,
    end=176100000
)

# Find ultra-conserved elements
for element in results['ultra_conserved']:
    print(f"Conserved {element['type']}: {element['conservation']:.1%}")

Multi-Modal Validation

# Validate DNA→RNA→Protein relationships
validation = await orchestrator.multimodal_analysis(
    dna_sequence="ATCG...",
    rna_sequence="AUGC...",
    protein_sequence="MKVL..."
)

print(f"Central dogma valid: {validation['central_dogma']['all_valid']}")
print(f"Protein-DNA binding score: {validation['protein_dna_interaction']['score']}")

πŸ”¬ Technical Innovations

1. Attention Gradient Boundary Detection

DNABERT-2's attention patterns show sharp transitions at regulatory boundaries. We compute attention gradients and use peaks to identify precise start/end positions.

2. Multi-Signal Integration

Different signals are weighted based on element type:

  • Enhancers: Higher weight on motif density and nucleosome depletion
  • Promoters: Higher weight on attention gradients and conservation

3. Cross-Species Mean Pooling

HyenaDNA's mean pooling creates species-agnostic representations, enabling analysis of any species without retraining.

πŸ’» System Requirements

  • GPU: NVIDIA GPU with 16GB+ VRAM (V100/A100 recommended)
  • RAM: 32GB minimum
  • Storage: 50GB for models and reference data
  • OS: Linux (Ubuntu 20.04+) or macOS
  • Python: 3.9-3.10

πŸ“ˆ Performance

  • Throughput: 1000+ sequences/second (with GPU)
  • Memory efficiency: Handles 450kb sequences
  • Accuracy: Validated on VISTA enhancers and ENCODE cCREs
  • Scalability: Distributed processing support

πŸ› οΈ Advanced Features

  • Fine-tuning: LoRA-based adaptation for cell types
  • Custom pipelines: YAML-based workflow definition
  • Variant impact: Predict effects of mutations
  • CRISPR design: Target regulatory cores
  • Expression prediction: Link elements to genes

🀝 Contributing

We welcome contributions! See CONTRIBUTING.md for guidelines.

πŸ™ Acknowledgments

BRIDGE-LM builds upon excellent work by:

πŸ“§ Contact


BRIDGE-LM - Advancing genomic understanding through hierarchical model orchestration

About

Biological Regulatory Integration & Detection through Genomic Language Models

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages