Upload DNA Tiny World benchmark dataset
Browse files- .gitignore +60 -0
- README.md +67 -0
- bench_dna_tiny_v1_1/README.md +45 -0
- bench_dna_tiny_v1_1/dna_world_tiny_v1_1.jsonl +30 -0
- scripts/build_benchmark.py +521 -0
- scripts/design_negative_cases.py +285 -0
- scripts/mpra_queries.py +456 -0
- scripts/score.py +505 -0
.gitignore
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Python
|
| 2 |
+
__pycache__/
|
| 3 |
+
*.py[cod]
|
| 4 |
+
*$py.class
|
| 5 |
+
*.so
|
| 6 |
+
.Python
|
| 7 |
+
build/
|
| 8 |
+
develop-eggs/
|
| 9 |
+
dist/
|
| 10 |
+
downloads/
|
| 11 |
+
eggs/
|
| 12 |
+
.eggs/
|
| 13 |
+
lib/
|
| 14 |
+
lib64/
|
| 15 |
+
parts/
|
| 16 |
+
sdist/
|
| 17 |
+
var/
|
| 18 |
+
wheels/
|
| 19 |
+
*.egg-info/
|
| 20 |
+
.installed.cfg
|
| 21 |
+
*.egg
|
| 22 |
+
|
| 23 |
+
# Large data files (not version controlled)
|
| 24 |
+
*.db
|
| 25 |
+
*.sqlite
|
| 26 |
+
*.sqlite3
|
| 27 |
+
|
| 28 |
+
# Cache directories
|
| 29 |
+
mpra_cache/
|
| 30 |
+
mpra_sources/
|
| 31 |
+
.cache/
|
| 32 |
+
*.cache
|
| 33 |
+
|
| 34 |
+
# Test outputs and predictions
|
| 35 |
+
predictions_*.jsonl
|
| 36 |
+
results_*.json
|
| 37 |
+
scoring_*.json
|
| 38 |
+
test_*.jsonl
|
| 39 |
+
|
| 40 |
+
# IDE
|
| 41 |
+
.vscode/
|
| 42 |
+
.idea/
|
| 43 |
+
*.swp
|
| 44 |
+
*.swo
|
| 45 |
+
*~
|
| 46 |
+
.DS_Store
|
| 47 |
+
|
| 48 |
+
# OS
|
| 49 |
+
Thumbs.db
|
| 50 |
+
|
| 51 |
+
# Virtual environments
|
| 52 |
+
venv/
|
| 53 |
+
ENV/
|
| 54 |
+
env/
|
| 55 |
+
.venv
|
| 56 |
+
|
| 57 |
+
# Temporary files
|
| 58 |
+
*.tmp
|
| 59 |
+
*.temp
|
| 60 |
+
*.log
|
README.md
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# DNA-World-Tiny
|
| 2 |
+
|
| 3 |
+
Benchmark for DNA foundational models using real MPRA data from MPRAbase.
|
| 4 |
+
|
| 5 |
+
## Overview
|
| 6 |
+
|
| 7 |
+
30 tasks across 5 regulatory element types (promoters, enhancers, long-range, negatives, gradient). All targets are real wet-lab MPRA measurements.
|
| 8 |
+
|
| 9 |
+
## Quick Start
|
| 10 |
+
|
| 11 |
+
```python
|
| 12 |
+
import json
|
| 13 |
+
from pathlib import Path
|
| 14 |
+
|
| 15 |
+
# Load tasks
|
| 16 |
+
tasks = []
|
| 17 |
+
with open("bench_dna_tiny_v1_1/dna_world_tiny_v1_1.jsonl") as f:
|
| 18 |
+
for line in f:
|
| 19 |
+
tasks.append(json.loads(line))
|
| 20 |
+
|
| 21 |
+
# Score predictions
|
| 22 |
+
from scripts.score import score_benchmark
|
| 23 |
+
results = score_benchmark(
|
| 24 |
+
Path("bench_dna_tiny_v1_1/dna_world_tiny_v1_1.jsonl"),
|
| 25 |
+
Path("predictions.jsonl")
|
| 26 |
+
)
|
| 27 |
+
```
|
| 28 |
+
|
| 29 |
+
## Benchmark
|
| 30 |
+
|
| 31 |
+
| Tier | Tasks | Challenge | Scoring |
|
| 32 |
+
|------|-------|-----------|---------|
|
| 33 |
+
| Promoter | 12 | 1.1×–3.0× | 60% ED, 30% logFC, 10% motif |
|
| 34 |
+
| Enhancer | 8 | 1.5×–2.0× | 40% ED, 40% logFC, 20% motif |
|
| 35 |
+
| Long-Range | 4 | Distal | 30% ED, 50% logFC, 20% motif |
|
| 36 |
+
| Negative | 4 | Failure modes | Inverse scoring |
|
| 37 |
+
| Gradient | 2 | Fine-tuning | 70% ED, 25% logFC, 5% motif |
|
| 38 |
+
|
| 39 |
+
## Task Format
|
| 40 |
+
|
| 41 |
+
```json
|
| 42 |
+
{
|
| 43 |
+
"id": "uuid",
|
| 44 |
+
"task_id": "semantic_id",
|
| 45 |
+
"context": "Design instruction",
|
| 46 |
+
"metadata": {"tier": "promoter", "challenge_level": "medium"},
|
| 47 |
+
"reference_sequence": "ACGT...",
|
| 48 |
+
"target_sequence_real": "ACGT...",
|
| 49 |
+
"target_logfc": 0.585,
|
| 50 |
+
"motifs_hint": ["TATA-box", "HNF1"],
|
| 51 |
+
"mpra_source": {"element_id": "...", "pmid": "..."}
|
| 52 |
+
}
|
| 53 |
+
```
|
| 54 |
+
|
| 55 |
+
## Scripts
|
| 56 |
+
|
| 57 |
+
- `mpra_queries.py` - Query MPRA database
|
| 58 |
+
- `design_negative_cases.py` - Generate failure modes
|
| 59 |
+
- `build_benchmark.py` - Assemble benchmark
|
| 60 |
+
- `score.py` - Evaluate predictions
|
| 61 |
+
|
| 62 |
+
## Data
|
| 63 |
+
|
| 64 |
+
- **Source**: MPRAbase v4.9.3
|
| 65 |
+
- **Elements**: 200,000+ MPRA sequences
|
| 66 |
+
- **Cell Lines**: HepG2, K562
|
| 67 |
+
- **Real vs Synthetic**: ~60% genomic, ~40% designed
|
bench_dna_tiny_v1_1/README.md
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# DNA-World-Tiny Benchmark
|
| 2 |
+
|
| 3 |
+
30-task benchmark for DNA foundational models using real MPRA data.
|
| 4 |
+
|
| 5 |
+
## Tasks
|
| 6 |
+
|
| 7 |
+
| Tier | Count | Challenge | Metrics |
|
| 8 |
+
|------|-------|-----------|---------|
|
| 9 |
+
| Promoters | 12 | 1.1×–3.0× | 60% ED, 30% logFC, 10% motif |
|
| 10 |
+
| Enhancers | 8 | 1.5×–2.0× | 40% ED, 40% logFC, 20% motif |
|
| 11 |
+
| Long-Range | 4 | Distal (30–60kb) | 30% ED, 50% logFC, 20% motif |
|
| 12 |
+
| Negatives | 4 | Failure modes | Inverse scoring |
|
| 13 |
+
| Gradient | 2 | Fine-tuning | 70% ED, 25% logFC, 5% motif |
|
| 14 |
+
|
| 15 |
+
## Negative Modes
|
| 16 |
+
|
| 17 |
+
- TATA-less: Remove core promoter motif
|
| 18 |
+
- GC-extreme: 90% GC content
|
| 19 |
+
- Motif-scrambled: Shuffle TF binding sites
|
| 20 |
+
- Repressor-heavy: Pack with NRSF/REST motifs
|
| 21 |
+
|
| 22 |
+
## Format
|
| 23 |
+
|
| 24 |
+
```json
|
| 25 |
+
{
|
| 26 |
+
"id": "uuid",
|
| 27 |
+
"task_id": "semantic_id",
|
| 28 |
+
"context": "Design instruction",
|
| 29 |
+
"metadata": {"tier": "promoter", "challenge_level": "medium"},
|
| 30 |
+
"reference_sequence": "ACGT...",
|
| 31 |
+
"target_sequence_real": "ACGT...",
|
| 32 |
+
"target_logfc": 0.585,
|
| 33 |
+
"motifs_hint": ["TATA-box"],
|
| 34 |
+
"mpra_source": {"element_id": "...", "pmid": "..."}
|
| 35 |
+
}
|
| 36 |
+
```
|
| 37 |
+
|
| 38 |
+
## Data
|
| 39 |
+
|
| 40 |
+
- **Source**: MPRAbase v4.9.3
|
| 41 |
+
- **Cell Lines**: HepG2, K562
|
| 42 |
+
- **Composition**: ~60% natural genomic loci, ~40% synthetic/designed
|
| 43 |
+
- **Coordinates**: hg19
|
| 44 |
+
|
| 45 |
+
All targets are real wet-lab MPRA measurements.
|
bench_dna_tiny_v1_1/dna_world_tiny_v1_1.jsonl
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{"id": "8fc1832c-7bb2-4fac-a9d5-52dbb54a3c13", "task_id": "promo_hepg2_alb_up_medium_v1", "context": "Design a HepG2 promoter achieving ~1.5\u00d7 expression boost for ALB", "metadata": {"tier": "promoter", "gene": "ALB", "cell_line": "HepG2", "challenge_level": "medium", "direction": "up", "is_new_v1_1": false, "tags": ["promoter", "alb", "medium", "mpra"]}, "reference_sequence": "AGGACCGGATCAACTGCAAGTCTGCCATCGTGTTCAGAAGGGCCAGAAATGGGACACGTCATCACGAGGAGAATTAAGTCAGAGAGTTTCATTACTGAGTGTTGTTTGACTTTGTTGTCACGGATTCATTTAACCATCTCTCTACCTCAGCACCACGGACAGCGCTATGTCCAGTATGAAATAAAAACTGCCTCCTTCCAAATTAGAGGTGGCTGCATTGCGTGAACCGA", "target_sequence_real": "AGGACCGGATCAACTGCAAGTCTGCCATCGTGTTCAGAAGGGCCAGAAATGGGACACGTCATCACGAGGAGAATTAAGTCAGAGAGTTTCATTACTGAGTGTTGTTTGACTTTGTTGTCACGGATTCATTTAACCATCTCTCTACCTCAGCACCACGGACAGCGCTATGTCCAGTATGAAATAAAAACTGCCTCCTTCCAAATTAGAGGTGGCTGCATTGCGTGAACCGA", "target_logfc": 0.585, "target_logfc_actual": 0.635377, "motifs_hint": ["TATA-box", "HNF1", "HNF4A"], "mpra_source": {"element_id": "DS0133-LID01-EID00081745", "element_name": "Construct1_PIONEER/REPRESSOR/ACTIVATOR_AND_CONSTANT_MOTIF:Two_Motifs_XBP1REST_Template:ATGGGACACGTCATCAC_Template:TCAGCACCACGGACAGCGC_Pos1:33_Pos2:131", "sample_name": "Georgakopoulos_synthetic_Hepg2", "dataset_name": "Georgakopoulos_MPRA_Hepg2", "pmid": "37087538", "geo_number": "PRJNA854975"}, "evaluation_config": {"tier": "promoter", "tier_weights": [0.6, 0.3, 0.1], "is_negative": false, "metrics": ["edit_distance_to_real", "logfc_match_error", "validity_dna", "motif_enrichment"]}, "system_instructions": "Task: Optimize ALB promoter in HepG2 cells. Target: 1.5\u00d7 expression. Output uppercase DNA sequence only."}
|
| 2 |
+
{"id": "705d03b9-8f56-4671-8d64-3f42e168219d", "task_id": "promo_hepg2_ttr_up_medium_v1", "context": "Design a HepG2 promoter achieving ~1.5\u00d7 expression boost for TTR", "metadata": {"tier": "promoter", "gene": "TTR", "cell_line": "HepG2", "challenge_level": "medium", "direction": "up", "is_new_v1_1": false, "tags": ["promoter", "ttr", "medium", "mpra"]}, "reference_sequence": "AGGACCGGATCAACTGCAAGTCTGCCATCGTGTTCAGAAGGGCCAGAAATGCCCAAAATCAATAAGAGGAGAATTAAGTCAGAGAGTTTCATTACTGATCAGCACCACGGACAGCGCTCACGGATTCATTTAACCATCTCTCTACCATGGTAAAAATGTGTATCCTATGTCCAGTATGAAATAAAAACTGCCTCCTTCCAAATTAGAGGTGGCTGCATTGCGTGAACCGA", "target_sequence_real": "AGGACCGGATCAACTGCAAGTCTGCCATCGTGTTCAGAAGGGCCAGAAATGCCCAAAATCAATAAGAGGAGAATTAAGTCAGAGAGTTTCATTACTGATCAGCACCACGGACAGCGCTCACGGATTCATTTAACCATCTCTCTACCATGGTAAAAATGTGTATCCTATGTCCAGTATGAAATAAAAACTGCCTCCTTCCAAATTAGAGGTGGCTGCATTGCGTGAACCGA", "target_logfc": 0.585, "target_logfc_actual": 0.550803, "motifs_hint": ["TATA", "HNF3", "C/EBP"], "mpra_source": {"element_id": "DS0133-LID01-EID00078049", "element_name": "Construct1_PIONEER/REPRESSOR/ACTIVATOR_AND_CONSTANT_MOTIF:Two_Motifs_ONECUT1REST_Non-Template:CAAAATCAATAA_Template:TCAGCACCACGGACAGCGC_Pos1:38_Pos2:83", "sample_name": "Georgakopoulos_synthetic_Hepg2", "dataset_name": "Georgakopoulos_MPRA_Hepg2", "pmid": "37087538", "geo_number": "PRJNA854975"}, "evaluation_config": {"tier": "promoter", "tier_weights": [0.6, 0.3, 0.1], "is_negative": false, "metrics": ["edit_distance_to_real", "logfc_match_error", "validity_dna", "motif_enrichment"]}, "system_instructions": "Task: Optimize TTR promoter in HepG2 cells. Target: 1.5\u00d7 expression. Output uppercase DNA sequence only."}
|
| 3 |
+
{"id": "754b440e-41f9-4d11-8318-0daf669ae186", "task_id": "promo_hepg2_gapdh_up_medium_v1", "context": "Design a HepG2 promoter achieving ~1.5\u00d7 expression boost for GAPDH", "metadata": {"tier": "promoter", "gene": "GAPDH", "cell_line": "HepG2", "challenge_level": "medium", "direction": "up", "is_new_v1_1": false, "tags": ["promoter", "gapdh", "medium", "mpra"]}, "reference_sequence": "AGGACCGGATCAACTGCAAGTCTGCCATCGTGTTCAGAAGGGCCAGAAATGCTGACCTTTGCCCCGAGGAGAATTAAGTCAGCGGCCACCAGGGGGCGCCATTGTTTGACTTTGTTGTCACGGATTCATTTAACCATCTCTCTACCATGGTAAAAATGTGTATCCTATGTCCAGTATGAAATAAAAACTGCCTCCTTCCAAATTAGAGGTGGCTGCATTGCGTGAACCGA", "target_sequence_real": "AGGACCGGATCAACTGCAAGTCTGCCATCGTGTTCAGAAGGGCCAGAAATGCTGACCTTTGCCCCGAGGAGAATTAAGTCAGCGGCCACCAGGGGGCGCCATTGTTTGACTTTGTTGTCACGGATTCATTTAACCATCTCTCTACCATGGTAAAAATGTGTATCCTATGTCCAGTATGAAATAAAAACTGCCTCCTTCCAAATTAGAGGTGGCTGCATTGCGTGAACCGA", "target_logfc": 0.585, "target_logfc_actual": 0.498497, "motifs_hint": ["SP1", "NRF1", "CpG-rich"], "mpra_source": {"element_id": "DS0133-LID01-EID00086599", "element_name": "Construct1_PIONEER/REPRESSOR/ACTIVATOR_AND_CONSTANT_MOTIF:Two_Motifs_HNF4ACTCF_Template:TGACCTTTGCCCC_Non-Template:CGGCCACCAGGGGGCGCCA_Pos1:37_Pos2:67", "sample_name": "Georgakopoulos_synthetic_Hepg2", "dataset_name": "Georgakopoulos_MPRA_Hepg2", "pmid": "37087538", "geo_number": "PRJNA854975"}, "evaluation_config": {"tier": "promoter", "tier_weights": [0.6, 0.3, 0.1], "is_negative": false, "metrics": ["edit_distance_to_real", "logfc_match_error", "validity_dna", "motif_enrichment"]}, "system_instructions": "Task: Optimize GAPDH promoter in HepG2 cells. Target: 1.5\u00d7 expression. Output uppercase DNA sequence only."}
|
| 4 |
+
{"id": "cb60e861-bc9b-412c-b424-ec2a879ebbea", "task_id": "promo_hepg2_actb_up_medium_v1", "context": "Design a HepG2 promoter achieving ~1.5\u00d7 expression boost for ACTB", "metadata": {"tier": "promoter", "gene": "ACTB", "cell_line": "HepG2", "challenge_level": "medium", "direction": "up", "is_new_v1_1": false, "tags": ["promoter", "actb", "medium", "mpra"]}, "reference_sequence": "AGGACCGGATCAACTGCAAGTCTGCCATCGTGTTCAGAAGGGCCAGAAATGCCAAGGACTCAGGGGAGGAGAATTAAGTCAGAGAGTTTCATTACTGAGTGTTGTTTTGACGTCATGTCACGGATTCAGCACCACGGACAGCGCCCATGGTAAAAATGTGTATCCTATGTCCAGTATGAAATAAAAACTGCCTCCTTCCAAATTAGAGGTGGCTGCATTGCGTGAACCGA", "target_sequence_real": "AGGACCGGATCAACTGCAAGTCTGCCATCGTGTTCAGAAGGGCCAGAAATGCCAAGGACTCAGGGGAGGAGAATTAAGTCAGAGAGTTTCATTACTGAGTGTTGTTTTGACGTCATGTCACGGATTCAGCACCACGGACAGCGCCCATGGTAAAAATGTGTATCCTATGTCCAGTATGAAATAAAAACTGCCTCCTTCCAAATTAGAGGTGGCTGCATTGCGTGAACCGA", "target_logfc": 0.585, "target_logfc_actual": 0.634829, "motifs_hint": ["SP1", "YY1", "CpG-island"], "mpra_source": {"element_id": "DS0133-LID01-EID00048283", "element_name": "Construct1_Hetero:Two_Motifs_CREB1REST_Template:TGACGTCA_Template:TCAGCACCACGGACAGCGC_Pos1:92_Pos2:110_Distance:10", "sample_name": "Georgakopoulos_synthetic_Hepg2", "dataset_name": "Georgakopoulos_MPRA_Hepg2", "pmid": "37087538", "geo_number": "PRJNA854975"}, "evaluation_config": {"tier": "promoter", "tier_weights": [0.6, 0.3, 0.1], "is_negative": false, "metrics": ["edit_distance_to_real", "logfc_match_error", "validity_dna", "motif_enrichment"]}, "system_instructions": "Task: Optimize ACTB promoter in HepG2 cells. Target: 1.5\u00d7 expression. Output uppercase DNA sequence only."}
|
| 5 |
+
{"id": "c79930cf-8cb7-4e8e-9bdb-94dd8d103eab", "task_id": "promo_hepg2_gapdh_down_medium_v1", "context": "Design a HepG2 promoter achieving ~0.7\u00d7 expression boost for GAPDH", "metadata": {"tier": "promoter", "gene": "GAPDH", "cell_line": "HepG2", "challenge_level": "medium", "direction": "down", "is_new_v1_1": false, "tags": ["promoter", "gapdh", "medium", "mpra"]}, "reference_sequence": "AACTGGGCAGGAAAAGGAGTTGCGACAGGCATCTACTGGGTAGAGGTGAGGGATGTTGCTAAACATTCTACAATGCACAGGACAGCCCTAAGACAAAGAATGATCAGGCCCAAAGTCCACAGTGCCAAGGCTGAGAAATCCTGGTAGAAAGAAACTTCAGTGAGCTACCAG", "target_sequence_real": "AACTGGGCAGGAAAAGGAGTTGCGACAGGCATCTACTGGGTAGAGGTGAGGGATGTTGCTAAACATTCTACAATGCACAGGACAGCCCTAAGACAAAGAATGATCAGGCCCAAAGTCCACAGTGCCAAGGCTGAGAAATCCTGGTAGAAAGAAACTTCAGTGAGCTACCAG", "target_logfc": -0.585, "target_logfc_actual": -0.616, "motifs_hint": ["SP1", "NRF1", "CpG-rich"], "mpra_source": {"element_id": "DS0021-LID01-EID2174", "element_name": "R:HNF4A-ChMod_chr20:45950155-45950245_[chr20:45950114-45950285]:028", "sample_name": "Klein_ORI_HepG2", "dataset_name": "Klein_MPRA_HepG2", "pmid": "33046894", "geo_number": "GSE142696"}, "evaluation_config": {"tier": "promoter", "tier_weights": [0.6, 0.3, 0.1], "is_negative": false, "metrics": ["edit_distance_to_real", "logfc_match_error", "validity_dna", "motif_enrichment"]}, "system_instructions": "Task: Optimize GAPDH promoter in HepG2 cells. Target: 0.7\u00d7 expression. Output uppercase DNA sequence only."}
|
| 6 |
+
{"id": "8ffa849f-a05b-41be-babe-130f0b578436", "task_id": "promo_hepg2_ttr_down_medium_v1", "context": "Design a HepG2 promoter achieving ~0.7\u00d7 expression boost for TTR", "metadata": {"tier": "promoter", "gene": "TTR", "cell_line": "HepG2", "challenge_level": "medium", "direction": "down", "is_new_v1_1": false, "tags": ["promoter", "ttr", "medium", "mpra"]}, "reference_sequence": "TGAAAAGATATTTGTCAACCACAAACATTTGAAAGGGAAGCATTCCAAAGATTTTCACTGTTTATGTTCAAATTACAACATGTGCAGAAAGTTGTGCAACTGAAAATCCTTTCAAACAACAGCTACAAAAGAGATTGGTCAGTTAGGACAGGAATAGAAAGTGGAAACTTA", "target_sequence_real": "TGAAAAGATATTTGTCAACCACAAACATTTGAAAGGGAAGCATTCCAAAGATTTTCACTGTTTATGTTCAAATTACAACATGTGCAGAAAGTTGTGCAACTGAAAATCCTTTCAAACAACAGCTACAAAAGAGATTGGTCAGTTAGGACAGGAATAGAAAGTGGAAACTTA", "target_logfc": -0.585, "target_logfc_actual": -0.531, "motifs_hint": ["TATA", "HNF3", "C/EBP"], "mpra_source": {"element_id": "DS0021-LID01-EID1983", "element_name": "R:FOXA2-NoMod_chr2:216578220-216578339_[chr2:216578194-216578365]:044", "sample_name": "Klein_ORI_HepG2", "dataset_name": "Klein_MPRA_HepG2", "pmid": "33046894", "geo_number": "GSE142696"}, "evaluation_config": {"tier": "promoter", "tier_weights": [0.6, 0.3, 0.1], "is_negative": false, "metrics": ["edit_distance_to_real", "logfc_match_error", "validity_dna", "motif_enrichment"]}, "system_instructions": "Task: Optimize TTR promoter in HepG2 cells. Target: 0.7\u00d7 expression. Output uppercase DNA sequence only."}
|
| 7 |
+
{"id": "c11f1d40-9039-4306-bb13-4aea3a4aee70", "task_id": "promo_hepg2_alb_up_hard_v1", "context": "Design a HepG2 promoter achieving ~2.0\u00d7 expression boost for ALB", "metadata": {"tier": "promoter", "gene": "ALB", "cell_line": "HepG2", "challenge_level": "hard", "direction": "up", "is_new_v1_1": false, "tags": ["promoter", "alb", "hard", "mpra"]}, "reference_sequence": "AGGACCGGATCAACTCCTTTCGCCGCTTCTGAAGGTGACTCACAAAGCCAGTTTCACTTGGTTCCACATTGTTGCATCATTACATTTAAAGAAAGGGAAGAAATCTGTTTACTAAATGTTAGACTTGAAGTCTGGAGTATTTGTTCTAGCAGGTCCTGTTAGATTCCACA", "target_sequence_real": "AGGACCGGATCAACTCCTTTCGCCGCTTCTGAAGGTGACTCACAAAGCCAGTTTCACTTGGTTCCACATTGTTGCATCATTACATTTAAAGAAAGGGAAGAAATCTGTTTACTAAATGTTAGACTTGAAGTCTGGAGTATTTGTTCTAGCAGGTCCTGTTAGATTCCACA", "target_logfc": 1.0, "target_logfc_actual": 1.0246036145, "motifs_hint": ["TATA-box", "HNF1", "HNF4A"], "mpra_source": {"element_id": "DS0001-LID01-EID00001157", "element_name": "R:FOXA1_FOXA2-ChMod_chr11:20000406-20000566_[chr11:20000400-20000571]", "sample_name": "Inoue_Mutant_integrase_HepG2", "dataset_name": "Inoue_MPRA_HepG2", "pmid": "27831498", "geo_number": "GSE83894"}, "evaluation_config": {"tier": "promoter", "tier_weights": [0.6, 0.3, 0.1], "is_negative": false, "metrics": ["edit_distance_to_real", "logfc_match_error", "validity_dna", "motif_enrichment"]}, "system_instructions": "Task: Optimize ALB promoter in HepG2 cells. Target: 2.0\u00d7 expression. Output uppercase DNA sequence only."}
|
| 8 |
+
{"id": "2927d988-4dc5-4e8f-b158-79b68e485671", "task_id": "promo_k562_gfap_up_medium_v1", "context": "Design a K562 promoter achieving ~1.5\u00d7 expression boost for GFAP", "metadata": {"tier": "promoter", "gene": "GFAP", "cell_line": "K562", "challenge_level": "medium", "direction": "up", "is_new_v1_1": false, "tags": ["promoter", "gfap", "medium", "mpra"]}, "reference_sequence": "ACTTAGGCACCCCCTCCCAGCCCCAGCGGCCACTAGCGACAATATGGCTCCTAAGCACGTGACCCGATTAGACTTTTAAGCCGGTTCCCGGGGCTACGAGGCGGAAGCGAAGGCAGACGCAGTCTCCGTCGTTGACGTTAGTCGCAGTCTTCGCTGCTAACGGT", "target_sequence_real": "ACTTAGGCACCCCCTCCCAGCCCCAGCGGCCACTAGCGACAATATGGCTCCTAAGCACGTGACCCGATTAGACTTTTAAGCCGGTTCCCGGGGCTACGAGGCGGAAGCGAAGGCAGACGCAGTCTCCGTCGTTGACGTTAGTCGCAGTCTTCGCTGCTAACGGT", "target_logfc": 0.585, "target_logfc_actual": 0.62177, "motifs_hint": ["NFIA", "STAT3", "CpG-medium"], "mpra_source": {"element_id": "DS0006-LID01-EID12725", "element_name": "12725", "sample_name": "Gabbay_MPRA_Promoters_K562", "dataset_name": "Gabbay_MPRA_ K562", "pmid": "30622120", "geo_number": "GSE118242"}, "evaluation_config": {"tier": "promoter", "tier_weights": [0.6, 0.3, 0.1], "is_negative": false, "metrics": ["edit_distance_to_real", "logfc_match_error", "validity_dna", "motif_enrichment"]}, "system_instructions": "Task: Optimize GFAP promoter in K562 cells. Target: 1.5\u00d7 expression. Output uppercase DNA sequence only."}
|
| 9 |
+
{"id": "a7c5664f-7087-467a-a989-521885803a9a", "task_id": "promo_k562_mbp_up_medium_v1", "context": "Design a K562 promoter achieving ~1.5\u00d7 expression boost for MBP", "metadata": {"tier": "promoter", "gene": "MBP", "cell_line": "K562", "challenge_level": "medium", "direction": "up", "is_new_v1_1": false, "tags": ["promoter", "mbp", "medium", "mpra"]}, "reference_sequence": "ACTTTATCGAACCCATGTCAATATGCAAATTTTTGTTTTGGCACAATATGCAAATTGACTTTCCAAAATAATATGCAAATTCCCTCACTGCGACAATATGCAAATTTAGGCGTGTACGGTGGGAGGTCTATATAAGCAGAGCTCGTTTAGTGAACCGTCAGATC", "target_sequence_real": "ACTTTATCGAACCCATGTCAATATGCAAATTTTTGTTTTGGCACAATATGCAAATTGACTTTCCAAAATAATATGCAAATTCCCTCACTGCGACAATATGCAAATTTAGGCGTGTACGGTGGGAGGTCTATATAAGCAGAGCTCGTTTAGTGAACCGTCAGATC", "target_logfc": 0.585, "target_logfc_actual": 0.59719, "motifs_hint": ["SOX10", "MYT1", "CpG-rich"], "mpra_source": {"element_id": "DS0006-LID01-EID5345", "element_name": "5345", "sample_name": "Gabbay_MPRA_Promoters_K562", "dataset_name": "Gabbay_MPRA_ K562", "pmid": "30622120", "geo_number": "GSE118242"}, "evaluation_config": {"tier": "promoter", "tier_weights": [0.6, 0.3, 0.1], "is_negative": false, "metrics": ["edit_distance_to_real", "logfc_match_error", "validity_dna", "motif_enrichment"]}, "system_instructions": "Task: Optimize MBP promoter in K562 cells. Target: 1.5\u00d7 expression. Output uppercase DNA sequence only."}
|
| 10 |
+
{"id": "fbed7209-3998-4776-b28b-992ef5a28571", "task_id": "promo_k562_actb_shift_up_medium_v1", "context": "Design a K562 promoter achieving ~1.5\u00d7 expression boost for ACTB", "metadata": {"tier": "promoter", "gene": "ACTB", "cell_line": "K562", "challenge_level": "medium", "direction": "shift_up", "is_new_v1_1": false, "tags": ["promoter", "actb", "medium", "mpra"]}, "reference_sequence": "ACGGTTACCAGCCCATGTCAGTCAATGGGAGTTTGTTTTGGCGCGGATGTCATGACGTCAAATGAAACCTTCGTAACAACTCCCTCACTGCGACGCCCTTTTATGGTAGGCGTGTACGGTGGGAGGTCTATATAAGCAGAGCTCGTTTAGTGAACCGTCAGATC", "target_sequence_real": "ACGGTTACCAGCCCATGTCAGTCAATGGGAGTTTGTTTTGGCGCGGATGTCATGACGTCAAATGAAACCTTCGTAACAACTCCCTCACTGCGACGCCCTTTTATGGTAGGCGTGTACGGTGGGAGGTCTATATAAGCAGAGCTCGTTTAGTGAACCGTCAGATC", "target_logfc": 0.585, "target_logfc_actual": 0.66123, "motifs_hint": ["SP1", "YY1", "CpG-island"], "mpra_source": {"element_id": "DS0006-LID01-EID6234", "element_name": "6234", "sample_name": "Gabbay_MPRA_Promoters_K562", "dataset_name": "Gabbay_MPRA_ K562", "pmid": "30622120", "geo_number": "GSE118242"}, "evaluation_config": {"tier": "promoter", "tier_weights": [0.6, 0.3, 0.1], "is_negative": false, "metrics": ["edit_distance_to_real", "logfc_match_error", "validity_dna", "motif_enrichment"]}, "system_instructions": "Task: Optimize ACTB promoter in K562 cells. Target: 1.5\u00d7 expression. Output uppercase DNA sequence only."}
|
| 11 |
+
{"id": "d3d7359c-2de6-4204-bcfb-4581c3079f8d", "task_id": "promo_hepg2_alb_up_ultra_hard_v1", "context": "Design a HepG2 promoter achieving ~3.0\u00d7 expression boost for ALB", "metadata": {"tier": "promoter", "gene": "ALB", "cell_line": "HepG2", "challenge_level": "ultra_hard", "direction": "up", "is_new_v1_1": true, "tags": ["promoter", "alb", "ultra_hard", "mpra"]}, "reference_sequence": "AGGACCGGATCAACTGCAAGTCTGCCATCGTGTTCAGAAGGGCCAGAAATGCCAAGGACTCAGGGGAGGAGAATTAAGTCAGAGAGTTTCATTACTTGGCGCCCCCTGGTGGCCGGCCGCCATCTTGATTTAACCATCGGCCACCAGGGGGCGCCATGTGTATCCTATGTCCAGTATGAAATAAAAACTGCCTCCTTCCAAATTAGAGGTGGCTGCATTGCGTGAACCGA", "target_sequence_real": "AGGACCGGATCAACTGCAAGTCTGCCATCGTGTTCAGAAGGGCCAGAAATGCCAAGGACTCAGGGGAGGAGAATTAAGTCAGAGAGTTTCATTACTTGGCGCCCCCTGGTGGCCGGCCGCCATCTTGATTTAACCATCGGCCACCAGGGGGCGCCATGTGTATCCTATGTCCAGTATGAAATAAAAACTGCCTCCTTCCAAATTAGAGGTGGCTGCATTGCGTGAACCGA", "target_logfc": 1.585, "target_logfc_actual": 1.70255, "motifs_hint": ["TATA-box", "HNF1", "HNF4A"], "mpra_source": {"element_id": "DS0133-LID01-EID00199153", "element_name": "Construct1_Three_Motifs_CTCFYY1CTCF_Template:TGGCGCCCCCTGGTGGCCG_Template:GCCGCCATCTTG_Non-Template:CGGCCACCAGGGGGCGCCA_Pos1:81_Pos2:100_Pos3:122_Distance1:0_Distance2:10", "sample_name": "Georgakopoulos_synthetic_Hepg2", "dataset_name": "Georgakopoulos_MPRA_Hepg2", "pmid": "37087538", "geo_number": "PRJNA854975"}, "evaluation_config": {"tier": "promoter", "tier_weights": [0.6, 0.3, 0.1], "is_negative": false, "metrics": ["edit_distance_to_real", "logfc_match_error", "validity_dna", "motif_enrichment"]}, "system_instructions": "Task: Optimize ALB promoter in HepG2 cells. Target: 3.0\u00d7 expression. Output uppercase DNA sequence only."}
|
| 12 |
+
{"id": "8a14399a-e7b3-4c7b-b0d9-0fc0f54fe48b", "task_id": "promo_hepg2_ttr_up_ultra_easy_v1", "context": "Design a HepG2 promoter achieving ~1.1\u00d7 expression boost for TTR", "metadata": {"tier": "promoter", "gene": "TTR", "cell_line": "HepG2", "challenge_level": "ultra_easy", "direction": "up", "is_new_v1_1": true, "tags": ["promoter", "ttr", "ultra_easy", "mpra"]}, "reference_sequence": "CCCGAGTGCCTCAGGAATTGATGTTGGAGTGGACAAGAGTGATCTGGCTAGCCCCACCCACTGGGTCCCAGGTGCTGGAAGGGGCCAGAAGCCCTGCTGAGACTATTTGACCTCCAGTCGGGGTGGGGGCAGGGCCTGGTCCGGGGCATCTCCAGGAATGTCAAGGTCACC", "target_sequence_real": "CCCGAGTGCCTCAGGAATTGATGTTGGAGTGGACAAGAGTGATCTGGCTAGCCCCACCCACTGGGTCCCAGGTGCTGGAAGGGGCCAGAAGCCCTGCTGAGACTATTTGACCTCCAGTCGGGGTGGGGGCAGGGCCTGGTCCGGGGCATCTCCAGGAATGTCAAGGTCACC", "target_logfc": 0.138, "target_logfc_actual": 0.094, "motifs_hint": ["TATA", "HNF3", "C/EBP"], "mpra_source": {"element_id": "DS0021-LID01-EID1465", "element_name": "R:FOXA1-ChMod_chr7:100844457-100844599_[chr7:100844442-100844613]:076", "sample_name": "Klein_53_Mutant_integrase_HepG2", "dataset_name": "Klein_MPRA_HepG2", "pmid": "33046894", "geo_number": "GSE142696"}, "evaluation_config": {"tier": "promoter", "tier_weights": [0.6, 0.3, 0.1], "is_negative": false, "metrics": ["edit_distance_to_real", "logfc_match_error", "validity_dna", "motif_enrichment"]}, "system_instructions": "Task: Optimize TTR promoter in HepG2 cells. Target: 1.1\u00d7 expression. Output uppercase DNA sequence only."}
|
| 13 |
+
{"id": "e495d973-d6e5-4bba-8488-eccfb68e100f", "task_id": "enh_hepg2_hnf4a_cre_up_v1", "context": "Design an enhancer element in HepG2 cells achieving ~1.5\u00d7 activity for HNF4A_CRE", "metadata": {"tier": "enhancer", "element": "HNF4A_CRE", "cell_line": "HepG2", "challenge_level": "medium", "direction": "up", "tags": ["enhancer", "hnf4a_cre", "cre", "mpra"]}, "reference_sequence": "TGCCCGTATACACAGAGCTCTTATTAGCAATGCAAAGAGTATGAAGACATGTAAAGAAACATGCACTTTCAGTAATACAGGATGGAAACCGAGAAGCACTGTTAATAATGAGTATGAGGGAGGAAGTTGATCCAAATTTCAGAGGCTTTGGAACTGCATAGGAATGAGTTTTCAGGTTATTAGTTTCATTGCTCACTAACTAGACAGCCTTGAGAGCTTAATAATTAACCAGAGTCTATTTATAGTATTTTTAAAACATGGTCATTCCTAGGAGTTCTGGGCTGTTTATCATACTGCTCTGAGTTGACAAGGTCATGCAGAATTTTCGTGTGAAGAGAGACTGTAACCTCAAGGTCCAAATTCCCTAGGCTGTGTTGGAGGTACACTGGTATGAGAAAGTGATAACAGAGCAGGCTGGGCTTTTTATCTTCCCCAGATCCTCTGGAACATCTCTTTGAAGGCCTTTTTACCTAGGTGCAATTTTGTCCCCCTTCCATTAAAGATTACTCAATTATCTCAATAGCTTCTACTAGGGATAAGTGAATTTACCTCAGCCTTCTAAAAGGAAACCAGACTCCTACAAGTTGCTAAAATACACTTGCTAACCCATGACCAGGTCACAAATAAACTTGCTTATAAAATTTATGTGGATTCTTCGCTTCACGTGTCGCTCCTCTA", "target_sequence_real": "TGCCCGTATACACAGAGCTCTTATTAGCAATGCAAAGAGTATGAAGACATGTAAAGAAACATGCACTTTCAGTAATACAGGATGGAAACCGAGAAGCACTGTTAATAATGAGTATGAGGGAGGAAGTTGATCCAAATTTCAGAGGCTTTGGAACTGCATAGGAATGAGTTTTCAGGTTATTAGTTTCATTGCTCACTAACTAGACAGCCTTGAGAGCTTAATAATTAACCAGAGTCTATTTATAGTATTTTTAAAACATGGTCATTCCTAGGAGTTCTGGGCTGTTTATCATACTGCTCTGAGTTGACAAGGTCATGCAGAATTTTCGTGTGAAGAGAGACTGTAACCTCAAGGTCCAAATTCCCTAGGCTGTGTTGGAGGTACACTGGTATGAGAAAGTGATAACAGAGCAGGCTGGGCTTTTTATCTTCCCCAGATCCTCTGGAACATCTCTTTGAAGGCCTTTTTACCTAGGTGCAATTTTGTCCCCCTTCCATTAAAGATTACTCAATTATCTCAATAGCTTCTACTAGGGATAAGTGAATTTACCTCAGCCTTCTAAAAGGAAACCAGACTCCTACAAGTTGCTAAAATACACTTGCTAACCCATGACCAGGTCACAAATAAACTTGCTTATAAAATTTATGTGGATTCTTCGCTTCACGTGTCGCTCCTCTA", "target_logfc": 0.585, "target_logfc_actual": 0.58, "motifs_hint": ["CRE"], "mpra_source": {"element_id": "DS0021-LID02-EID5938", "element_name": "21:29628609-29629287_long", "sample_name": "Klein_shortMedLong_HepG2", "dataset_name": "Klein_MPRA_HepG2", "pmid": "33046894", "geo_number": "GSE142696"}, "evaluation_config": {"tier": "enhancer", "tier_weights": [0.4, 0.4, 0.2], "is_negative": false, "metrics": ["edit_distance_to_real", "logfc_match_error", "tf_binding_specificity"]}, "system_instructions": "Design enhancer for HNF4A_CRE. Target: 1.5\u00d7 activity. Output DNA sequence (800bp+)."}
|
| 14 |
+
{"id": "599cdd14-1ee7-4044-b59f-9ddf428ebce9", "task_id": "enh_hepg2_foxa2_pioneer_up_v1", "context": "Design an enhancer element in HepG2 cells achieving ~1.5\u00d7 activity for FOXA2_pioneer", "metadata": {"tier": "enhancer", "element": "FOXA2_pioneer", "cell_line": "HepG2", "challenge_level": "medium", "direction": "up", "tags": ["enhancer", "foxa2_pioneer", "cre", "mpra"]}, "reference_sequence": "TGCCCGTATACACAGAGCTCTTATTAGCAATGCAAAGAGTATGAAGACATGTAAAGAAACATGCACTTTCAGTAATACAGGATGGAAACCGAGAAGCACTGTTAATAATGAGTATGAGGGAGGAAGTTGATCCAAATTTCAGAGGCTTTGGAACTGCATAGGAATGAGTTTTCAGGTTATTAGTTTCATTGCTCACTAACTAGACAGCCTTGAGAGCTTAATAATTAACCAGAGTCTATTTATAGTATTTTTAAAACATGGTCATTCCTAGGAGTTCTGGGCTGTTTATCATACTGCTCTGAGTTGACAAGGTCATGCAGAATTTTCGTGTGAAGAGAGACTGTAACCTCAAGGTCCAAATTCCCTAGGCTGTGTTGGAGGTACACTGGTATGAGAAAGTGATAACAGAGCAGGCTGGGCTTTTTATCTTCCCCAGATCCTCTGGAACATCTCTTTGAAGGCCTTTTTACCTAGGTGCAATTTTGTCCCCCTTCCATTAAAGATTACTCAATTATCTCAATAGCTTCTACTAGGGATAAGTGAATTTACCTCAGCCTTCTAAAAGGAAACCAGACTCCTACAAGTTGCTAAAATACACTTGCTAACCCATGACCAGGTCACAAATAAACTTGCTTATAAAATTTATGTGGATTCTTCGCTTCACGTGTCGCTCCTCTA", "target_sequence_real": "TGCCCGTATACACAGAGCTCTTATTAGCAATGCAAAGAGTATGAAGACATGTAAAGAAACATGCACTTTCAGTAATACAGGATGGAAACCGAGAAGCACTGTTAATAATGAGTATGAGGGAGGAAGTTGATCCAAATTTCAGAGGCTTTGGAACTGCATAGGAATGAGTTTTCAGGTTATTAGTTTCATTGCTCACTAACTAGACAGCCTTGAGAGCTTAATAATTAACCAGAGTCTATTTATAGTATTTTTAAAACATGGTCATTCCTAGGAGTTCTGGGCTGTTTATCATACTGCTCTGAGTTGACAAGGTCATGCAGAATTTTCGTGTGAAGAGAGACTGTAACCTCAAGGTCCAAATTCCCTAGGCTGTGTTGGAGGTACACTGGTATGAGAAAGTGATAACAGAGCAGGCTGGGCTTTTTATCTTCCCCAGATCCTCTGGAACATCTCTTTGAAGGCCTTTTTACCTAGGTGCAATTTTGTCCCCCTTCCATTAAAGATTACTCAATTATCTCAATAGCTTCTACTAGGGATAAGTGAATTTACCTCAGCCTTCTAAAAGGAAACCAGACTCCTACAAGTTGCTAAAATACACTTGCTAACCCATGACCAGGTCACAAATAAACTTGCTTATAAAATTTATGTGGATTCTTCGCTTCACGTGTCGCTCCTCTA", "target_logfc": 0.585, "target_logfc_actual": 0.58, "motifs_hint": ["CRE"], "mpra_source": {"element_id": "DS0021-LID02-EID5938", "element_name": "21:29628609-29629287_long", "sample_name": "Klein_shortMedLong_HepG2", "dataset_name": "Klein_MPRA_HepG2", "pmid": "33046894", "geo_number": "GSE142696"}, "evaluation_config": {"tier": "enhancer", "tier_weights": [0.4, 0.4, 0.2], "is_negative": false, "metrics": ["edit_distance_to_real", "logfc_match_error", "tf_binding_specificity"]}, "system_instructions": "Design enhancer for FOXA2_pioneer. Target: 1.5\u00d7 activity. Output DNA sequence (800bp+)."}
|
| 15 |
+
{"id": "8b10bc74-dc97-4686-a300-94a2712a241e", "task_id": "enh_hepg2_nrf1_ubiquitous_up_v1", "context": "Design an enhancer element in HepG2 cells achieving ~1.5\u00d7 activity for NRF1_ubiquitous", "metadata": {"tier": "enhancer", "element": "NRF1_ubiquitous", "cell_line": "HepG2", "challenge_level": "medium", "direction": "up", "tags": ["enhancer", "nrf1_ubiquitous", "cre", "mpra"]}, "reference_sequence": "TGCCCGTATACACAGAGCTCTTATTAGCAATGCAAAGAGTATGAAGACATGTAAAGAAACATGCACTTTCAGTAATACAGGATGGAAACCGAGAAGCACTGTTAATAATGAGTATGAGGGAGGAAGTTGATCCAAATTTCAGAGGCTTTGGAACTGCATAGGAATGAGTTTTCAGGTTATTAGTTTCATTGCTCACTAACTAGACAGCCTTGAGAGCTTAATAATTAACCAGAGTCTATTTATAGTATTTTTAAAACATGGTCATTCCTAGGAGTTCTGGGCTGTTTATCATACTGCTCTGAGTTGACAAGGTCATGCAGAATTTTCGTGTGAAGAGAGACTGTAACCTCAAGGTCCAAATTCCCTAGGCTGTGTTGGAGGTACACTGGTATGAGAAAGTGATAACAGAGCAGGCTGGGCTTTTTATCTTCCCCAGATCCTCTGGAACATCTCTTTGAAGGCCTTTTTACCTAGGTGCAATTTTGTCCCCCTTCCATTAAAGATTACTCAATTATCTCAATAGCTTCTACTAGGGATAAGTGAATTTACCTCAGCCTTCTAAAAGGAAACCAGACTCCTACAAGTTGCTAAAATACACTTGCTAACCCATGACCAGGTCACAAATAAACTTGCTTATAAAATTTATGTGGATTCTTCGCTTCACGTGTCGCTCCTCTA", "target_sequence_real": "TGCCCGTATACACAGAGCTCTTATTAGCAATGCAAAGAGTATGAAGACATGTAAAGAAACATGCACTTTCAGTAATACAGGATGGAAACCGAGAAGCACTGTTAATAATGAGTATGAGGGAGGAAGTTGATCCAAATTTCAGAGGCTTTGGAACTGCATAGGAATGAGTTTTCAGGTTATTAGTTTCATTGCTCACTAACTAGACAGCCTTGAGAGCTTAATAATTAACCAGAGTCTATTTATAGTATTTTTAAAACATGGTCATTCCTAGGAGTTCTGGGCTGTTTATCATACTGCTCTGAGTTGACAAGGTCATGCAGAATTTTCGTGTGAAGAGAGACTGTAACCTCAAGGTCCAAATTCCCTAGGCTGTGTTGGAGGTACACTGGTATGAGAAAGTGATAACAGAGCAGGCTGGGCTTTTTATCTTCCCCAGATCCTCTGGAACATCTCTTTGAAGGCCTTTTTACCTAGGTGCAATTTTGTCCCCCTTCCATTAAAGATTACTCAATTATCTCAATAGCTTCTACTAGGGATAAGTGAATTTACCTCAGCCTTCTAAAAGGAAACCAGACTCCTACAAGTTGCTAAAATACACTTGCTAACCCATGACCAGGTCACAAATAAACTTGCTTATAAAATTTATGTGGATTCTTCGCTTCACGTGTCGCTCCTCTA", "target_logfc": 0.585, "target_logfc_actual": 0.58, "motifs_hint": ["CRE"], "mpra_source": {"element_id": "DS0021-LID02-EID5938", "element_name": "21:29628609-29629287_long", "sample_name": "Klein_shortMedLong_HepG2", "dataset_name": "Klein_MPRA_HepG2", "pmid": "33046894", "geo_number": "GSE142696"}, "evaluation_config": {"tier": "enhancer", "tier_weights": [0.4, 0.4, 0.2], "is_negative": false, "metrics": ["edit_distance_to_real", "logfc_match_error", "tf_binding_specificity"]}, "system_instructions": "Design enhancer for NRF1_ubiquitous. Target: 1.5\u00d7 activity. Output DNA sequence (800bp+)."}
|
| 16 |
+
{"id": "d40e716b-a69a-4125-afc6-f9fb18332832", "task_id": "enh_k562_stat3_immune_up_v1", "context": "Design an enhancer element in K562 cells achieving ~2.0\u00d7 activity for STAT3_immune", "metadata": {"tier": "enhancer", "element": "STAT3_immune", "cell_line": "K562", "challenge_level": "hard", "direction": "up", "tags": ["enhancer", "stat3_immune", "cre", "mpra"]}, "reference_sequence": "GTGCTACGTTTTGTCCACGATCAGGGCGGGGCAAGGGGAAGAAATCTCGCGATAGGAGAGGGGTCCGGGCGGGGGTGGCACCTCTCCCTCCTCCTGGCGTTAGTTCCGGTCGCAGAGGAGACACCGCCGCAGTTGCCGGTACATCGGGGATTTCTGGCTCTTTC", "target_sequence_real": "GTGCTACGTTTTGTCCACGATCAGGGCGGGGCAAGGGGAAGAAATCTCGCGATAGGAGAGGGGTCCGGGCGGGGGTGGCACCTCTCCCTCCTCCTGGCGTTAGTTCCGGTCGCAGAGGAGACACCGCCGCAGTTGCCGGTACATCGGGGATTTCTGGCTCTTTC", "target_logfc": 1.0, "target_logfc_actual": 0.93701, "motifs_hint": ["CRE"], "mpra_source": {"element_id": "DS0006-LID01-EID13396", "element_name": "13396", "sample_name": "Gabbay_MPRA_Promoters_K562", "dataset_name": "Gabbay_MPRA_ K562", "pmid": "30622120", "geo_number": "GSE118242"}, "evaluation_config": {"tier": "enhancer", "tier_weights": [0.4, 0.4, 0.2], "is_negative": false, "metrics": ["edit_distance_to_real", "logfc_match_error", "tf_binding_specificity"]}, "system_instructions": "Design enhancer for STAT3_immune. Target: 2.0\u00d7 activity. Output DNA sequence (800bp+)."}
|
| 17 |
+
{"id": "546ee0bd-05c6-450c-a948-d64f1be58352", "task_id": "enh_hepg2_silencer_composite_down_v1", "context": "Design an enhancer element in HepG2 cells achieving ~0.7\u00d7 activity for silencer_composite", "metadata": {"tier": "enhancer", "element": "silencer_composite", "cell_line": "HepG2", "challenge_level": "medium", "direction": "down", "tags": ["enhancer", "silencer_composite", "cre", "mpra"]}, "reference_sequence": "CTTTGACACCTTCCCAAATCACAAGAAACCTCTGACTGCCAACCAAAAAAAAAAAAAACCCAACCCCACAGCTAATTAATCTCTGCCAAGTCTCAGGCTACCAATTGTAGCCATAACTTTAAGCAACATCTAATTTGCTAAACAAAACACTGTTAACTTTGTTCAACAATTAAAGGAGTTAAAAACATAAAAGTAAATGAAAGAAGTGAAATCTCTTGGCCTGTTGGGAGATACAGTACCCCACATACCTTCTGCCACTGCTGCTACAGTTAAGCAAACTTTACAAGCTAGTCAAGCCATCATCCAATAGAGCCTATTTGCTGAGCAACAGTGGAGCTTTGTGGTTTGCCTCACAGTTGACAGTAAGTTATGAGCCCTTTGTGAGCACAGGGGAAGGAAAACAGAGATCGGAATTTGGCAGGAAAATATAATACAGAATTCTCCTGTCTATGGAACCTGAATTTTTGTGAAAACAATCAAGCATTGTTGAAAGAAAGAAAAGCAACTTTGACAGATGAAATATAGAGGGGCCCCTTTTAGGAAAACAGTAAACAAAGCGCCATTCAGGCCAGGTCCATTCTGTCATTTATAAAGATAGTTTCTTCTGTGTGGTGAGAGTTTACAGCAAAGAGTTCAGATTCAACAAATCAAGTGTAAAATCTCCCACAGTCCCCATTA", "target_sequence_real": "CTTTGACACCTTCCCAAATCACAAGAAACCTCTGACTGCCAACCAAAAAAAAAAAAAACCCAACCCCACAGCTAATTAATCTCTGCCAAGTCTCAGGCTACCAATTGTAGCCATAACTTTAAGCAACATCTAATTTGCTAAACAAAACACTGTTAACTTTGTTCAACAATTAAAGGAGTTAAAAACATAAAAGTAAATGAAAGAAGTGAAATCTCTTGGCCTGTTGGGAGATACAGTACCCCACATACCTTCTGCCACTGCTGCTACAGTTAAGCAAACTTTACAAGCTAGTCAAGCCATCATCCAATAGAGCCTATTTGCTGAGCAACAGTGGAGCTTTGTGGTTTGCCTCACAGTTGACAGTAAGTTATGAGCCCTTTGTGAGCACAGGGGAAGGAAAACAGAGATCGGAATTTGGCAGGAAAATATAATACAGAATTCTCCTGTCTATGGAACCTGAATTTTTGTGAAAACAATCAAGCATTGTTGAAAGAAAGAAAAGCAACTTTGACAGATGAAATATAGAGGGGCCCCTTTTAGGAAAACAGTAAACAAAGCGCCATTCAGGCCAGGTCCATTCTGTCATTTATAAAGATAGTTTCTTCTGTGTGGTGAGAGTTTACAGCAAAGAGTTCAGATTCAACAAATCAAGTGTAAAATCTCCCACAGTCCCCATTA", "target_logfc": -0.585, "target_logfc_actual": -0.586, "motifs_hint": ["CRE"], "mpra_source": {"element_id": "DS0021-LID02-EID6157", "element_name": "11:16377721-16378399_long", "sample_name": "Klein_shortMedLong_HepG2", "dataset_name": "Klein_MPRA_HepG2", "pmid": "33046894", "geo_number": "GSE142696"}, "evaluation_config": {"tier": "enhancer", "tier_weights": [0.4, 0.4, 0.2], "is_negative": false, "metrics": ["edit_distance_to_real", "logfc_match_error", "tf_binding_specificity"]}, "system_instructions": "Design enhancer for silencer_composite. Target: 0.7\u00d7 activity. Output DNA sequence (800bp+)."}
|
| 18 |
+
{"id": "9ce7d3a8-0acd-45f0-8333-cb1193059cee", "task_id": "enh_hepg2_bidirectional_alb_ttr_up_v1", "context": "Design an enhancer element in HepG2 cells achieving ~1.5\u00d7 activity for bidirectional_ALB_TTR", "metadata": {"tier": "enhancer", "element": "bidirectional_ALB_TTR", "cell_line": "HepG2", "challenge_level": "medium", "direction": "up", "tags": ["enhancer", "bidirectional_alb_ttr", "cre", "mpra"]}, "reference_sequence": "TGCCCGTATACACAGAGCTCTTATTAGCAATGCAAAGAGTATGAAGACATGTAAAGAAACATGCACTTTCAGTAATACAGGATGGAAACCGAGAAGCACTGTTAATAATGAGTATGAGGGAGGAAGTTGATCCAAATTTCAGAGGCTTTGGAACTGCATAGGAATGAGTTTTCAGGTTATTAGTTTCATTGCTCACTAACTAGACAGCCTTGAGAGCTTAATAATTAACCAGAGTCTATTTATAGTATTTTTAAAACATGGTCATTCCTAGGAGTTCTGGGCTGTTTATCATACTGCTCTGAGTTGACAAGGTCATGCAGAATTTTCGTGTGAAGAGAGACTGTAACCTCAAGGTCCAAATTCCCTAGGCTGTGTTGGAGGTACACTGGTATGAGAAAGTGATAACAGAGCAGGCTGGGCTTTTTATCTTCCCCAGATCCTCTGGAACATCTCTTTGAAGGCCTTTTTACCTAGGTGCAATTTTGTCCCCCTTCCATTAAAGATTACTCAATTATCTCAATAGCTTCTACTAGGGATAAGTGAATTTACCTCAGCCTTCTAAAAGGAAACCAGACTCCTACAAGTTGCTAAAATACACTTGCTAACCCATGACCAGGTCACAAATAAACTTGCTTATAAAATTTATGTGGATTCTTCGCTTCACGTGTCGCTCCTCTA", "target_sequence_real": "TGCCCGTATACACAGAGCTCTTATTAGCAATGCAAAGAGTATGAAGACATGTAAAGAAACATGCACTTTCAGTAATACAGGATGGAAACCGAGAAGCACTGTTAATAATGAGTATGAGGGAGGAAGTTGATCCAAATTTCAGAGGCTTTGGAACTGCATAGGAATGAGTTTTCAGGTTATTAGTTTCATTGCTCACTAACTAGACAGCCTTGAGAGCTTAATAATTAACCAGAGTCTATTTATAGTATTTTTAAAACATGGTCATTCCTAGGAGTTCTGGGCTGTTTATCATACTGCTCTGAGTTGACAAGGTCATGCAGAATTTTCGTGTGAAGAGAGACTGTAACCTCAAGGTCCAAATTCCCTAGGCTGTGTTGGAGGTACACTGGTATGAGAAAGTGATAACAGAGCAGGCTGGGCTTTTTATCTTCCCCAGATCCTCTGGAACATCTCTTTGAAGGCCTTTTTACCTAGGTGCAATTTTGTCCCCCTTCCATTAAAGATTACTCAATTATCTCAATAGCTTCTACTAGGGATAAGTGAATTTACCTCAGCCTTCTAAAAGGAAACCAGACTCCTACAAGTTGCTAAAATACACTTGCTAACCCATGACCAGGTCACAAATAAACTTGCTTATAAAATTTATGTGGATTCTTCGCTTCACGTGTCGCTCCTCTA", "target_logfc": 0.585, "target_logfc_actual": 0.58, "motifs_hint": ["CRE"], "mpra_source": {"element_id": "DS0021-LID02-EID5938", "element_name": "21:29628609-29629287_long", "sample_name": "Klein_shortMedLong_HepG2", "dataset_name": "Klein_MPRA_HepG2", "pmid": "33046894", "geo_number": "GSE142696"}, "evaluation_config": {"tier": "enhancer", "tier_weights": [0.4, 0.4, 0.2], "is_negative": false, "metrics": ["edit_distance_to_real", "logfc_match_error", "tf_binding_specificity"]}, "system_instructions": "Design enhancer for bidirectional_ALB_TTR. Target: 1.5\u00d7 activity. Output DNA sequence (800bp+)."}
|
| 19 |
+
{"id": "9c04a90c-781b-4645-81a2-38f65b71fd1d", "task_id": "enh_hepg2_distal_activator_5kb_up_v1", "context": "Design an enhancer element in HepG2 cells achieving ~1.5\u00d7 activity for distal_activator_5kb", "metadata": {"tier": "enhancer", "element": "distal_activator_5kb", "cell_line": "HepG2", "challenge_level": "medium", "direction": "up", "tags": ["enhancer", "distal_activator_5kb", "cre", "mpra"]}, "reference_sequence": "TGCCCGTATACACAGAGCTCTTATTAGCAATGCAAAGAGTATGAAGACATGTAAAGAAACATGCACTTTCAGTAATACAGGATGGAAACCGAGAAGCACTGTTAATAATGAGTATGAGGGAGGAAGTTGATCCAAATTTCAGAGGCTTTGGAACTGCATAGGAATGAGTTTTCAGGTTATTAGTTTCATTGCTCACTAACTAGACAGCCTTGAGAGCTTAATAATTAACCAGAGTCTATTTATAGTATTTTTAAAACATGGTCATTCCTAGGAGTTCTGGGCTGTTTATCATACTGCTCTGAGTTGACAAGGTCATGCAGAATTTTCGTGTGAAGAGAGACTGTAACCTCAAGGTCCAAATTCCCTAGGCTGTGTTGGAGGTACACTGGTATGAGAAAGTGATAACAGAGCAGGCTGGGCTTTTTATCTTCCCCAGATCCTCTGGAACATCTCTTTGAAGGCCTTTTTACCTAGGTGCAATTTTGTCCCCCTTCCATTAAAGATTACTCAATTATCTCAATAGCTTCTACTAGGGATAAGTGAATTTACCTCAGCCTTCTAAAAGGAAACCAGACTCCTACAAGTTGCTAAAATACACTTGCTAACCCATGACCAGGTCACAAATAAACTTGCTTATAAAATTTATGTGGATTCTTCGCTTCACGTGTCGCTCCTCTA", "target_sequence_real": "TGCCCGTATACACAGAGCTCTTATTAGCAATGCAAAGAGTATGAAGACATGTAAAGAAACATGCACTTTCAGTAATACAGGATGGAAACCGAGAAGCACTGTTAATAATGAGTATGAGGGAGGAAGTTGATCCAAATTTCAGAGGCTTTGGAACTGCATAGGAATGAGTTTTCAGGTTATTAGTTTCATTGCTCACTAACTAGACAGCCTTGAGAGCTTAATAATTAACCAGAGTCTATTTATAGTATTTTTAAAACATGGTCATTCCTAGGAGTTCTGGGCTGTTTATCATACTGCTCTGAGTTGACAAGGTCATGCAGAATTTTCGTGTGAAGAGAGACTGTAACCTCAAGGTCCAAATTCCCTAGGCTGTGTTGGAGGTACACTGGTATGAGAAAGTGATAACAGAGCAGGCTGGGCTTTTTATCTTCCCCAGATCCTCTGGAACATCTCTTTGAAGGCCTTTTTACCTAGGTGCAATTTTGTCCCCCTTCCATTAAAGATTACTCAATTATCTCAATAGCTTCTACTAGGGATAAGTGAATTTACCTCAGCCTTCTAAAAGGAAACCAGACTCCTACAAGTTGCTAAAATACACTTGCTAACCCATGACCAGGTCACAAATAAACTTGCTTATAAAATTTATGTGGATTCTTCGCTTCACGTGTCGCTCCTCTA", "target_logfc": 0.585, "target_logfc_actual": 0.58, "motifs_hint": ["CRE"], "mpra_source": {"element_id": "DS0021-LID02-EID5938", "element_name": "21:29628609-29629287_long", "sample_name": "Klein_shortMedLong_HepG2", "dataset_name": "Klein_MPRA_HepG2", "pmid": "33046894", "geo_number": "GSE142696"}, "evaluation_config": {"tier": "enhancer", "tier_weights": [0.4, 0.4, 0.2], "is_negative": false, "metrics": ["edit_distance_to_real", "logfc_match_error", "tf_binding_specificity"]}, "system_instructions": "Design enhancer for distal_activator_5kb. Target: 1.5\u00d7 activity. Output DNA sequence (800bp+)."}
|
| 20 |
+
{"id": "b3d349a3-07cf-4eba-89b6-88b27bbaa3ad", "task_id": "enh_hepg2_super_enhancer_up_v1", "context": "Design an enhancer element in HepG2 cells achieving ~2.0\u00d7 activity for super_enhancer", "metadata": {"tier": "enhancer", "element": "super_enhancer", "cell_line": "HepG2", "challenge_level": "hard", "direction": "up", "tags": ["enhancer", "super_enhancer", "cre", "mpra"]}, "reference_sequence": "TGGAACGTTCCGGATCCTGCCTTTGGGCCTACAGGGCTTTGGTGCCGGTGAGCAGGCCGCAGGTTCAGCTGGCTCAAGGAGCAGCTTCAGGGCTGCAGCCAGGCTGGGGGCTGGGCAGGTCTCAAACCCCTGGACCTGGGGAATCAGGGAGGTGTGAGCTGCATCTGAGGTCGGGTGTCTCTGTGACTCTGTCTCTGTCTCTCTACCTCTGATTCTCCCCAGGCTGCCTTGTCTCAGTCCCTGTCTATTCCCACCCCACCTCGCTCTCTCTCCCGGCCTTGCGAGTCTCCTCCCAGCCCCCCATCCCACCCAGTGGGCTGCCCGGAGGTGGCGGCAACGGGGCAGCTGAATGGGCCTCTTGTTCCTGGCCACACCCGCCCCTTGGGGTCACCCTGGGACATGCCCAGGCAGCGTGGCTACCTTAAAGGGCCAGTGCTCAGAAAGAATGTGAGCGGGGGAGGCTGCGTCCACTCCCAAATCCCACACCCTCCCCAAGGTGGACCACTCATGTGTCTGACGGGGGTGGGGAGCTGTGTACCTACACACCCTCGTGGCTTGGGGGAGGCCTGTCTGGAGCAGGAGATGTGATAGGGTTTGGGTTTGACCTTGGATAAATCCCTTCATCTCTCTGTGCCTCAGTTTCCCCATCTAGATCAGGGGGCTCCTTGGTGCCACCCC", "target_sequence_real": "TGGAACGTTCCGGATCCTGCCTTTGGGCCTACAGGGCTTTGGTGCCGGTGAGCAGGCCGCAGGTTCAGCTGGCTCAAGGAGCAGCTTCAGGGCTGCAGCCAGGCTGGGGGCTGGGCAGGTCTCAAACCCCTGGACCTGGGGAATCAGGGAGGTGTGAGCTGCATCTGAGGTCGGGTGTCTCTGTGACTCTGTCTCTGTCTCTCTACCTCTGATTCTCCCCAGGCTGCCTTGTCTCAGTCCCTGTCTATTCCCACCCCACCTCGCTCTCTCTCCCGGCCTTGCGAGTCTCCTCCCAGCCCCCCATCCCACCCAGTGGGCTGCCCGGAGGTGGCGGCAACGGGGCAGCTGAATGGGCCTCTTGTTCCTGGCCACACCCGCCCCTTGGGGTCACCCTGGGACATGCCCAGGCAGCGTGGCTACCTTAAAGGGCCAGTGCTCAGAAAGAATGTGAGCGGGGGAGGCTGCGTCCACTCCCAAATCCCACACCCTCCCCAAGGTGGACCACTCATGTGTCTGACGGGGGTGGGGAGCTGTGTACCTACACACCCTCGTGGCTTGGGGGAGGCCTGTCTGGAGCAGGAGATGTGATAGGGTTTGGGTTTGACCTTGGATAAATCCCTTCATCTCTCTGTGCCTCAGTTTCCCCATCTAGATCAGGGGGCTCCTTGGTGCCACCCC", "target_logfc": 1.0, "target_logfc_actual": 1.001, "motifs_hint": ["CRE"], "mpra_source": {"element_id": "DS0021-LID02-EID5278", "element_name": "19:3397342-3398020_long", "sample_name": "Klein_shortMedLong_HepG2", "dataset_name": "Klein_MPRA_HepG2", "pmid": "33046894", "geo_number": "GSE142696"}, "evaluation_config": {"tier": "enhancer", "tier_weights": [0.4, 0.4, 0.2], "is_negative": false, "metrics": ["edit_distance_to_real", "logfc_match_error", "tf_binding_specificity"]}, "system_instructions": "Design enhancer for super_enhancer. Target: 2.0\u00d7 activity. Output DNA sequence (800bp+)."}
|
| 21 |
+
{"id": "6685b9ef-73d9-424c-a81e-bdd25913a208", "task_id": "lr_50kb_alb_v1", "context": "Design a distal regulatory element for ALB, ~50kb from TSS, achieving ~1.5\u00d7 activity", "metadata": {"tier": "long_range", "gene": "ALB", "distance_kb": 50, "challenge_level": "hard", "tags": ["long_range", "distal", "alb", "3d_chromatin"]}, "reference_sequence": "<PLACEHOLDER>", "target_sequence_real": "AGGACCGGATCAACTTCATTTATTTTTAGAAAGGAAGCCGTATTGGTTCATATAAGCTGCTTTCCCAGCTGAAATAACATAGCAGATTGGTGCTGTTTGAACACTGCTAATTGCTGAACATTCTTAAACTAGTAAATAGGCCTGATTACCTGGACTCCAAACAGTAAGTC", "target_logfc": 0.585, "target_logfc_actual": 0.706855336, "motifs_hint": ["TATA-box", "HNF1", "HNF4A"], "mpra_source": {"element_id": "DS0001-LID01-EID00001627", "element_name": "R:FOXA1-NoMod_chr5:95325141-95325294_[chr5:95325132-95325303]", "sample_name": "Inoue_Wild-type_integrase_HepG2", "dataset_name": "Inoue_MPRA_HepG2", "pmid": "27831498", "geo_number": "GSE83894"}, "evaluation_config": {"tier": "long_range", "tier_weights": [0.3, 0.5, 0.2], "is_negative": false, "metrics": ["logfc_match_error", "coarse_sequence_similarity", "tf_binding_enrichment"]}, "system_instructions": "Design long-range element for ALB. Distance: ~50kb from TSS. Target: 1.5\u00d7 activity. Output DNA (1500bp+)."}
|
| 22 |
+
{"id": "e91dfa40-f09f-4d18-9246-86580b76c26a", "task_id": "lr_30kb_gapdh_v1", "context": "Design a distal regulatory element for GAPDH, ~30kb from TSS, achieving ~1.5\u00d7 activity", "metadata": {"tier": "long_range", "gene": "GAPDH", "distance_kb": 30, "challenge_level": "hard", "tags": ["long_range", "distal", "gapdh", "3d_chromatin"]}, "reference_sequence": "<PLACEHOLDER>", "target_sequence_real": "AGGACCGGATCAACTAATGGGACACGTCATCACTTGCCAGCTGGTGTAGAATGGGACACGTCATCACACTCTTCCGCCTGCTACTTTATTTTTCAGCACCACGGACAGCGCTTACAGGCATTTCACACATGGTAATTTAATAAGGTTAGTTCCCATGACAATGTACTAGATATTATCCCATTGAGGGTTAAAGTGGTTTTATAAGGTCTTGAGGGCATTGCGTGAACCGA", "target_logfc": 0.585, "target_logfc_actual": 0.372006, "motifs_hint": ["SP1", "NRF1", "CpG-rich"], "mpra_source": {"element_id": "DS0133-LID01-EID00101986", "element_name": "Construct2_PIONEER/REPRESSOR/ACTIVATOR_AND_CONSTANT_MOTIF_OF_TWO_COPIES_XBP1REST:Two_Motifs_Template:ATGGGACACGTCATCAC_Template:TCAGCACCACGGACAGCGC_Pos1:1_Pos2:35_Pos3:77", "sample_name": "Georgakopoulos_synthetic_Hepg2", "dataset_name": "Georgakopoulos_MPRA_Hepg2", "pmid": "37087538", "geo_number": "PRJNA854975"}, "evaluation_config": {"tier": "long_range", "tier_weights": [0.3, 0.5, 0.2], "is_negative": false, "metrics": ["logfc_match_error", "coarse_sequence_similarity", "tf_binding_enrichment"]}, "system_instructions": "Design long-range element for GAPDH. Distance: ~30kb from TSS. Target: 1.5\u00d7 activity. Output DNA (1500bp+)."}
|
| 23 |
+
{"id": "1003a50f-2f09-427d-9b43-8442cb2e9eb7", "task_id": "lr_40kb_ttr_v1", "context": "Design a distal regulatory element for TTR, ~40kb from TSS, achieving ~1.5\u00d7 activity", "metadata": {"tier": "long_range", "gene": "TTR", "distance_kb": 40, "challenge_level": "hard", "tags": ["long_range", "distal", "ttr", "3d_chromatin"]}, "reference_sequence": "<PLACEHOLDER>", "target_sequence_real": "AGGACCGGATCAACTGCAAGTCTGCCATCGTGTTCAGAAGGGCCAGAAATGCCAAGGACTCAGGGGAGGAGAATTAAGTCAGAGAGTTTCATTACTGCCGCCATCTTGACTTTGTGCCGCCATCTTGATTTAAGTTGCACAATACCATGGTAAAAATGTGTATCCTATGTCCAGTATGAAATAAAAACTGCCTCCTTCCAAATTAGAGGTGGCTGCATTGCGTGAACCGA", "target_logfc": 0.585, "target_logfc_actual": 0.59717, "motifs_hint": ["TATA", "HNF3", "C/EBP"], "mpra_source": {"element_id": "DS0133-LID01-EID00132771", "element_name": "Construct1_Three_Motifs_YY1YY1CEBPA_Template:GCCGCCATCTTG_Template:GCCGCCATCTTG_Non-Template:GTTGCACAATA_Pos1:81_Pos2:100_Pos3:118_Distance1:7_Distance2:6", "sample_name": "Georgakopoulos_synthetic_Hepg2", "dataset_name": "Georgakopoulos_MPRA_Hepg2", "pmid": "37087538", "geo_number": "PRJNA854975"}, "evaluation_config": {"tier": "long_range", "tier_weights": [0.3, 0.5, 0.2], "is_negative": false, "metrics": ["logfc_match_error", "coarse_sequence_similarity", "tf_binding_enrichment"]}, "system_instructions": "Design long-range element for TTR. Distance: ~40kb from TSS. Target: 1.5\u00d7 activity. Output DNA (1500bp+)."}
|
| 24 |
+
{"id": "6dfa99d8-e19e-47e4-9593-0b89a026c5f8", "task_id": "lr_60kb_actb_v1", "context": "Design a distal regulatory element for ACTB, ~60kb from TSS, achieving ~2.0\u00d7 activity", "metadata": {"tier": "long_range", "gene": "ACTB", "distance_kb": 60, "challenge_level": "hard", "tags": ["long_range", "distal", "actb", "3d_chromatin"]}, "reference_sequence": "<PLACEHOLDER>", "target_sequence_real": "AGGACCGGATCAACTATTAGGCACCTGTCATTTTTGCCAGCTGGTGTAAGTTAATGATTAACCAATCACTCTTCCGCCCAAAGCAAACATTTGCACCTGCTGTTACTTGAGTTACAGGCATTTCACACATGGTAATTTAATAAGGTTAGTTCCCATGACAATGTACTAGATATTATCCCATTGAGGGTTAAAGTGGTTTTATAAGGTCTTGAGGGCATTGCGTGAACCGA", "target_logfc": 1.0, "target_logfc_actual": 1.10648, "motifs_hint": ["SP1", "YY1", "CpG-island"], "mpra_source": {"element_id": "DS0133-LID01-EID00067742", "element_name": "Construct2_PIONEER/REPRESSOR/ACTIVATOR_AND_CONSTANT_MOTIF:Two_Motifs_HNF1AFOXA1_Non-Template:AGTTAATGATTAACCAA_Template:CAAAGCAAACA_Pos1:33_Pos2:63", "sample_name": "Georgakopoulos_synthetic_Hepg2", "dataset_name": "Georgakopoulos_MPRA_Hepg2", "pmid": "37087538", "geo_number": "PRJNA854975"}, "evaluation_config": {"tier": "long_range", "tier_weights": [0.3, 0.5, 0.2], "is_negative": false, "metrics": ["logfc_match_error", "coarse_sequence_similarity", "tf_binding_enrichment"]}, "system_instructions": "Design long-range element for ACTB. Distance: ~60kb from TSS. Target: 2.0\u00d7 activity. Output DNA (1500bp+)."}
|
| 25 |
+
{"id": "987b62a7-0fb7-4b7b-a02d-0855c21bfcce", "task_id": "neg_tata_less_v1", "context": "Design a sequence that SUPPRESSES expression due to: tata_less", "metadata": {"tier": "negative", "failure_mode": "tata_less", "challenge_level": "negative", "tags": ["negative", "failure_mode", "tata_less", "design_test"]}, "reference_sequence": "AATGAAATAGACCCCAACAATGTCTACTCTAGCAAATTTTCAAAGTCATAATAAAAATAAAATAGGATGACTCGGTGGTGTTTTAGCTGGTACTTTTCCAGTTTTCCTTTTACAACATAATCAACAATGACTTCAAAAGGATTTCCCCCTCCTTCATGGAATATTACTACCTTCAACACGGCCTTTCAGATCCGGAGTTCAAAGCATAGTTAGCATTATAATTTCAGCAGAGAATCCAGAATTGGCAGGATATCACCAGTAGGGTGACTTTTTTTCTTTTCCCTAGCAAACAGTAGAGCAGTATGTAGTTTCTCCCCCCGCCCAGACGGAGTTTCGCTCTTTCTCCCAGGCTGG", "target_sequence_real": "AATGAAATAGACCCCAACAATGTCTACTCTAGCAAATTTTCAAAGTCATAATAAAAATAAAATAGGATGACTCGGTGGTGTTTTAGCTGGTACTTTTCCAGTTTTCCTTTTACAACATAATCAACAATGACTTCAAAAGGATTTCCCCCTCCTTCATGGAATATTACTACCTTCAACACGGCCTTTCAGATCCGGAGTTCAAAGCATAGTTAGCATAGGTTCATCAGCAGAGAATCCAGAATTGGCAGGATATCACCAGTAGGGTGACTTTTTTTCTTTTCCCTAGCAAACAGTAGAGCAGTATGTAGTTTCTCCCCCCGCCCAGACGGAGTTTCGCTCTTTCTCCCAGGCTGG", "target_logfc": 0.2, "target_logfc_actual": 0.2, "motifs_hint": ["NO_TATA", "weak_promoter"], "mpra_source": {"element_id": "synthetic_negative", "element_name": "neg_tata_less", "sample_name": "synthetic_design", "dataset_name": "DNA-World-Tiny-Negative", "pmid": null, "geo_number": null}, "evaluation_config": {"tier": "negative", "tier_weights": null, "is_negative": true, "metrics": ["repression_strength", "off_target_binding", "absence_of_activators"]}, "system_instructions": "Design sequence with failure mode 'tata_less' to suppress expression. Target: 1.149\u00d7 (LOW)."}
|
| 26 |
+
{"id": "58b570c7-f430-444c-ab88-05084ea03979", "task_id": "neg_gc_extreme_v1", "context": "Design a sequence that SUPPRESSES expression due to: gc_extreme", "metadata": {"tier": "negative", "failure_mode": "gc_extreme", "challenge_level": "negative", "tags": ["negative", "failure_mode", "gc_extreme", "design_test"]}, "reference_sequence": "AATGAAATAGACCCCAACAATGTCTACTCTAGCAAATTTTCAAAGTCATAATAAAAATAAAATAGGATGACTCGGTGGTGTTTTAGCTGGTACTTTTCCAGTTTTCCTTTTACAACATAATCAACAATGACTTCAAAAGGATTTCCCCCTCCTTCATGGAATATTACTACCTTCAACACGGCCTTTCAGATCCGGAGTTCAAAGCATAGTTAGCATTATAATTTCAGCAGAGAATCCAGAATTGGCAGGATATCACCAGTAGGGTGACTTTTTTTCTTTTCCCTAGCAAACAGTAGAGCAGTATGTAGTTTCTCCCCCCGCCCAGACGGAGTTTCGCTCTTTCTCCCAGGCTGG", "target_sequence_real": "CGCGACGCGGGCCCCGACAATGGCGGCCCCAGCGACGGCGCGCGGTCGCGGGACCCGTAGCGCGGGGCGGCCCGGCGGCGTGGCGGCTGGCCCCCCCCCGGGTCGCCTGCGCCGCCCGAGCCGGCGCGGACGCCCGCAGGGGCCCCCCCCCCCTCCCGGAGTCTGGCGCCCCGCCGCACGGCCGGCCGGCTCCGGGGGGCCGGGCCGCGCCGGCCGCCCGCGTCCGGCCGAGCCGCCGGACCGGGCGGGGGCGCCCCGGCAGGGTGGCTGCCCTGCTCGGCCCGGGCCCGCCGTCGGGCAGCGGGGAGCTGCGCCCCCCGCCCGGGCGGCGCCCCGCCCCCCCGCCCGGGCGGG", "target_logfc": 0.3, "target_logfc_actual": 0.3, "motifs_hint": ["90pct_GC", "secondary_structure"], "mpra_source": {"element_id": "synthetic_negative", "element_name": "neg_gc_extreme", "sample_name": "synthetic_design", "dataset_name": "DNA-World-Tiny-Negative", "pmid": null, "geo_number": null}, "evaluation_config": {"tier": "negative", "tier_weights": null, "is_negative": true, "metrics": ["repression_strength", "off_target_binding", "absence_of_activators"]}, "system_instructions": "Design sequence with failure mode 'gc_extreme' to suppress expression. Target: 1.231\u00d7 (LOW)."}
|
| 27 |
+
{"id": "1dfce9e9-5cc7-4397-bc4f-d68478cc338d", "task_id": "neg_motif_scramble_v1", "context": "Design a sequence that SUPPRESSES expression due to: motif_scramble", "metadata": {"tier": "negative", "failure_mode": "motif_scramble", "challenge_level": "negative", "tags": ["negative", "failure_mode", "motif_scramble", "design_test"]}, "reference_sequence": "AATGAAATAGACCCCAACAATGTCTACTCTAGCAAATTTTCAAAGTCATAATAAAAATAAAATAGGATGACTCGGTGGTGTTTTAGCTGGTACTTTTCCAGTTTTCCTTTTACAACATAATCAACAATGACTTCAAAAGGATTTCCCCCTCCTTCATGGAATATTACTACCTTCAACACGGCCTTTCAGATCCGGAGTTCAAAGCATAGTTAGCATTATAATTTCAGCAGAGAATCCAGAATTGGCAGGATATCACCAGTAGGGTGACTTTTTTTCTTTTCCCTAGCAAACAGTAGAGCAGTATGTAGTTTCTCCCCCCGCCCAGACGGAGTTTCGCTCTTTCTCCCAGGCTGG", "target_sequence_real": "AATGAAATAGACCCCAACAATGTCTACTCTAGCAAATTTTCAAAGTCATAATAAAAATAAAATAGGATGACTCGGTGGTGTTTTAGCTGGTACTTTTCCAGTTTTCCTTTTACAACATAATCAACAATGACTTCAAAAGGATTTCCCCCTCCTTCATGGAATATTACTACCTTCAACACGGCCTTTCAGATCCGGAGTTCAAAGCATAGTTAGCATTATAATTTCAGCAGAGAATCCAGAATTGGCAGGATATCACCAGTAGGGTGACTTTTTTTCTTTTCCCTAGCAAACAGTAGAGCAGTATGTAGTTTCTCCCCCCGCCCAGACGGAGTTTCGCTCTTTCTCCCAGGCTGG", "target_logfc": 0.1, "target_logfc_actual": 0.1, "motifs_hint": ["disrupted_binding", "scrambled_motifs"], "mpra_source": {"element_id": "synthetic_negative", "element_name": "neg_motif_scramble", "sample_name": "synthetic_design", "dataset_name": "DNA-World-Tiny-Negative", "pmid": null, "geo_number": null}, "evaluation_config": {"tier": "negative", "tier_weights": null, "is_negative": true, "metrics": ["repression_strength", "off_target_binding", "absence_of_activators"]}, "system_instructions": "Design sequence with failure mode 'motif_scramble' to suppress expression. Target: 1.072\u00d7 (LOW)."}
|
| 28 |
+
{"id": "3f8b74e0-5484-459f-a488-4638b3a2c5fd", "task_id": "neg_repressor_heavy_v1", "context": "Design a sequence that SUPPRESSES expression due to: repressor_heavy", "metadata": {"tier": "negative", "failure_mode": "repressor_heavy", "challenge_level": "negative", "tags": ["negative", "failure_mode", "repressor_heavy", "design_test"]}, "reference_sequence": "AATGAAATAGACCCCAACAATGTCTACTCTAGCAAATTTTCAAAGTCATAATAAAAATAAAATAGGATGACTCGGTGGTGTTTTAGCTGGTACTTTTCCAGTTTTCCTTTTACAACATAATCAACAATGACTTCAAAAGGATTTCCCCCTCCTTCATGGAATATTACTACCTTCAACACGGCCTTTCAGATCCGGAGTTCAAAGCATAGTTAGCATTATAATTTCAGCAGAGAATCCAGAATTGGCAGGATATCACCAGTAGGGTGACTTTTTTTCTTTTCCCTAGCAAACAGTAGAGCAGTATGTAGTTTCTCCCCCCGCCCAGACGGAGTTTCGCTCTTTCTCCCAGGCTGG", "target_sequence_real": "ACACAGCGAGCCGCGGGGGGCCGCCGGCGGCCGCAGGAGGGCGCAGCGAGGGCGGGGCGCAGCGAGGGCGGGAGCCACCGCGAGCCACCGCGAGCCACCGCGGCGCAGCGAGAGCCACCGCGACACAGCGAGGCGCAGCGAGGCGCAGCGAGGGCGGGCCGCAGGAGGCCGCGGGGGGAGCCACCGCGGCGCAGCGAGCCGCGGGGGGAGCCACCGCGAGCCACCGCGGCGCAGCGAGCCGCAGGAGGGCGCAGCGAGGGCGGGCCGCTGGTGGGCGCAGCGAGACACAGCGAGAGCCACCGCGAGCCACCGCGAGCCACCGCGGGCGGGCCGCAGGAGGCCGCAGGAGGGGCG", "target_logfc": -5.0, "target_logfc_actual": -5.0, "motifs_hint": ["NRSF", "REST", "repressor_packed"], "mpra_source": {"element_id": "synthetic_negative", "element_name": "neg_repressor_heavy", "sample_name": "synthetic_design", "dataset_name": "DNA-World-Tiny-Negative", "pmid": null, "geo_number": null}, "evaluation_config": {"tier": "negative", "tier_weights": null, "is_negative": true, "metrics": ["repression_strength", "off_target_binding", "absence_of_activators"]}, "system_instructions": "Design sequence with failure mode 'repressor_heavy' to suppress expression. Target: 0.031\u00d7 (LOW)."}
|
| 29 |
+
{"id": "6947abab-7e38-4657-a399-d2d52fd456ae", "task_id": "grad_alb_subtle_boost_v1", "context": "Fine-tune ALB promoter for precise ~1.25\u00d7 expression adjustment", "metadata": {"tier": "gradient", "gene": "ALB", "challenge_level": "subtle_boost", "precision_required": true, "tags": ["gradient", "fine_tune", "alb", "subtle_boost"]}, "reference_sequence": "AGGACCGGATCAACTTCAGCACCACGGACAGCGCTGCCAGCTGGTGTAGATGTTAAAAATTACTGTCACTCTTCCGCCTGCTACTTTATTTTGCACCTGCTGTTACTTGAGTTACAGGCATTTCACACATGGTAATTTAATAAGGTTAGTTCCCATGCCCCCTGACCTTTGCCCCCTGCCTTGAGGGTTAACCCCCTGACCTTTGCCCCCTGCCGCATTGCGTGAACCGA", "target_sequence_real": "AGGACCGGATCAACTTCAGCACCACGGACAGCGCTGCCAGCTGGTGTAGATGTTAAAAATTACTGTCACTCTTCCGCCTGCTACTTTATTTTGCACCTGCTGTTACTTGAGTTACAGGCATTTCACACATGGTAATTTAATAAGGTTAGTTCCCATGCCCCCTGACCTTTGCCCCCTGCCTTGAGGGTTAACCCCCTGACCTTTGCCCCCTGCCGCATTGCGTGAACCGA", "target_logfc": 0.322, "target_logfc_actual": 0.363994, "motifs_hint": ["TATA-box", "HNF1", "HNF4A"], "mpra_source": {"element_id": "DS0133-LID01-EID00121432", "element_name": "Construct2_PIONEER/REPRESSOR/ACTIVATOR_AND_CONSTANT_MOTIF_OF_TWO_COPIES_RESTNR2F2:Two_Motifs_Template:TCAGCACCACGGACAGCGC_Non-Template:CCCCCTGACCTTTGCCCCCTGCC_Pos1:0_Pos2:142_Pos3:176", "sample_name": "Georgakopoulos_synthetic_Hepg2", "dataset_name": "Georgakopoulos_MPRA_Hepg2", "pmid": "37087538", "geo_number": "PRJNA854975"}, "evaluation_config": {"tier": "gradient", "tier_weights": [0.7, 0.25, 0.05], "is_negative": false, "metrics": ["edit_distance_to_real", "logfc_precision", "subtle_motif_changes"]}, "system_instructions": "Fine-tune ALB for 1.25\u00d7 (logFC 0.322). Precision critical. Output DNA."}
|
| 30 |
+
{"id": "b3d10953-cb4f-457a-8102-2f4227f5853f", "task_id": "grad_gapdh_strong_repression_v1", "context": "Fine-tune GAPDH promoter for precise ~0.40\u00d7 expression adjustment", "metadata": {"tier": "gradient", "gene": "GAPDH", "challenge_level": "strong_repression", "precision_required": true, "tags": ["gradient", "fine_tune", "gapdh", "strong_repression"]}, "reference_sequence": "TGTTTCAGGACCTTCTGGACCTTGGACATTCTCTTTATGAACAACACTATATGGTAATTATTTATGTACACTTGTCTCCCATATCAGACTGAGCACCCAGACTCTGTTGGGACTGTGTAAACTAAACCCAAGGCCCAAGTCTAGTGCCAGAAACACAAGAGAAGGTGTTTA", "target_sequence_real": "TGTTTCAGGACCTTCTGGACCTTGGACATTCTCTTTATGAACAACACTATATGGTAATTATTTATGTACACTTGTCTCCCATATCAGACTGAGCACCCAGACTCTGTTGGGACTGTGTAAACTAAACCCAAGGCCCAAGTCTAGTGCCAGAAACACAAGAGAAGGTGTTTA", "target_logfc": -1.32, "target_logfc_actual": -1.291, "motifs_hint": ["SP1", "NRF1", "CpG-rich"], "mpra_source": {"element_id": "DS0021-LID01-EID1669", "element_name": "R:FOXA1-NoMod_chr9:36401973-36402126_[chr9:36401964-36402135]:088", "sample_name": "Klein_pGL4_HepG2", "dataset_name": "Klein_MPRA_HepG2", "pmid": "33046894", "geo_number": "GSE142696"}, "evaluation_config": {"tier": "gradient", "tier_weights": [0.7, 0.25, 0.05], "is_negative": false, "metrics": ["edit_distance_to_real", "logfc_precision", "subtle_motif_changes"]}, "system_instructions": "Fine-tune GAPDH for 0.40\u00d7 (logFC -1.320). Precision critical. Output DNA."}
|
scripts/build_benchmark.py
ADDED
|
@@ -0,0 +1,521 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env python3
|
| 2 |
+
"""
|
| 3 |
+
build_benchmark.py: Assemble DNA-World-Tiny benchmark (30 tasks, 5 tiers).
|
| 4 |
+
|
| 5 |
+
This is the main orchestrator for building the complete benchmark. It queries the
|
| 6 |
+
MPRAbase database for diverse regulatory elements and assembles them into a 30-task
|
| 7 |
+
benchmark across 5 element types with tier-specific complexity levels.
|
| 8 |
+
|
| 9 |
+
Benchmark Composition (30 tasks):
|
| 10 |
+
1. Promoters (12 tasks): 1.1×–3.0× fold-change, HepG2/K562
|
| 11 |
+
- 10 standard promoters (v1.0 baseline)
|
| 12 |
+
- 2 new ultra-hard/easy tasks (v1.1 expansion)
|
| 13 |
+
|
| 14 |
+
2. Enhancers (8 tasks): Distal CRE elements, 1.5×–2.0×
|
| 15 |
+
- HNF4A, FOXA2, NRF1, STAT3 with tissue-specific variants
|
| 16 |
+
|
| 17 |
+
3. Long-Range (4 tasks): 3D chromatin, 30–60kb distances
|
| 18 |
+
- Distal regulatory elements with function-focused scoring
|
| 19 |
+
|
| 20 |
+
4. Negative Cases (4 tasks): Intentional failure modes
|
| 21 |
+
- TATA-less, GC-extreme, motif-scrambled, repressor-heavy
|
| 22 |
+
|
| 23 |
+
5. Gradient (2 tasks): Fine-tuning/precision required
|
| 24 |
+
- 1.25× subtle boost, 0.4× strong repression
|
| 25 |
+
|
| 26 |
+
Dependencies:
|
| 27 |
+
- mpra_queries.py: Unified MPRA database queries (base + v1.1 extended)
|
| 28 |
+
- design_negative_cases.py: Synthetic failure mode generation
|
| 29 |
+
- Output: bench_dna_tiny_v1_1/dna_world_tiny_v1_1.jsonl (OSWorld-aligned JSONL)
|
| 30 |
+
|
| 31 |
+
Usage:
|
| 32 |
+
builder = BenchmarkBuilderV11()
|
| 33 |
+
builder.build() # Build all 30 tasks
|
| 34 |
+
builder.save() # Save to JSONL
|
| 35 |
+
builder.close() # Close DB connection
|
| 36 |
+
"""
|
| 37 |
+
|
| 38 |
+
import json
|
| 39 |
+
import uuid
|
| 40 |
+
from pathlib import Path
|
| 41 |
+
from typing import Dict, Any, List
|
| 42 |
+
|
| 43 |
+
from mpra_queries import MPRAQueries
|
| 44 |
+
from design_negative_cases import NegativeCaseDesigner, create_negative_task
|
| 45 |
+
|
| 46 |
+
|
| 47 |
+
class BenchmarkBuilderV11:
|
| 48 |
+
def __init__(self, output_dir: Path = None):
|
| 49 |
+
self.output_dir = output_dir or Path(__file__).parent.parent / "bench_dna_tiny_v1_1"
|
| 50 |
+
self.output_dir.mkdir(exist_ok=True)
|
| 51 |
+
self.mpra = MPRAQueries()
|
| 52 |
+
self.mpra_ext = MPRAQueries()
|
| 53 |
+
self.neg_designer = NegativeCaseDesigner()
|
| 54 |
+
self.tasks = []
|
| 55 |
+
|
| 56 |
+
def _get_sequence(self, elem: Dict) -> str:
|
| 57 |
+
"""Get sequence from element, handling both extractors"""
|
| 58 |
+
if "sequence" in elem:
|
| 59 |
+
return elem["sequence"]
|
| 60 |
+
elif "tile_sequence" in elem:
|
| 61 |
+
return elem["tile_sequence"]
|
| 62 |
+
return None
|
| 63 |
+
|
| 64 |
+
def build_promoter_task(
|
| 65 |
+
self, gene: str, direction: str, cell_line: str, target_logfc: float,
|
| 66 |
+
challenge_level: str, is_new: bool = False
|
| 67 |
+
) -> Dict[str, Any]:
|
| 68 |
+
"""Build a promoter task (12 total: 10 from v1.0 + 2 new)"""
|
| 69 |
+
|
| 70 |
+
if direction == "up":
|
| 71 |
+
tolerance = 0.1 if target_logfc < 1.0 else 0.2
|
| 72 |
+
else:
|
| 73 |
+
tolerance = 0.1
|
| 74 |
+
|
| 75 |
+
elements = self.mpra_ext.find_best_elements_for_target(
|
| 76 |
+
target_logfc=target_logfc,
|
| 77 |
+
cell_line=cell_line,
|
| 78 |
+
tolerance=tolerance,
|
| 79 |
+
limit=20,
|
| 80 |
+
)
|
| 81 |
+
|
| 82 |
+
if not elements:
|
| 83 |
+
elements = self.mpra.find_best_elements_for_target(
|
| 84 |
+
target_logfc=target_logfc,
|
| 85 |
+
cell_line=cell_line,
|
| 86 |
+
tolerance=tolerance,
|
| 87 |
+
limit=20,
|
| 88 |
+
)
|
| 89 |
+
|
| 90 |
+
if not elements:
|
| 91 |
+
print(f"WARNING: No MPRA match for {gene} {direction} {target_logfc:.2f}")
|
| 92 |
+
target_elem = None
|
| 93 |
+
else:
|
| 94 |
+
target_elem = elements[0]
|
| 95 |
+
|
| 96 |
+
task_id = f"promo_{cell_line.lower()}_{gene.lower()}_{direction}_{challenge_level}_v1"
|
| 97 |
+
|
| 98 |
+
tier_weights = [0.6, 0.3, 0.1] # Edit dist, logFC, motif
|
| 99 |
+
|
| 100 |
+
task = {
|
| 101 |
+
"id": str(uuid.uuid4()),
|
| 102 |
+
"task_id": task_id,
|
| 103 |
+
"context": f"Design a {cell_line} promoter achieving ~{2**target_logfc:.1f}× expression boost for {gene}",
|
| 104 |
+
"metadata": {
|
| 105 |
+
"tier": "promoter",
|
| 106 |
+
"gene": gene,
|
| 107 |
+
"cell_line": cell_line,
|
| 108 |
+
"challenge_level": challenge_level,
|
| 109 |
+
"direction": direction,
|
| 110 |
+
"is_new_v1_1": is_new,
|
| 111 |
+
"tags": ["promoter", gene.lower(), challenge_level, "mpra"]
|
| 112 |
+
},
|
| 113 |
+
"reference_sequence": self._get_sequence(target_elem) if target_elem else "<NO_MPRA_MATCH>",
|
| 114 |
+
"target_sequence_real": self._get_sequence(target_elem) if target_elem else "<NO_MPRA_MATCH>",
|
| 115 |
+
"target_logfc": target_logfc,
|
| 116 |
+
"target_logfc_actual": target_elem["logfc"] if target_elem else None,
|
| 117 |
+
"motifs_hint": self._get_motifs_for_gene(gene),
|
| 118 |
+
"mpra_source": {
|
| 119 |
+
"element_id": target_elem["element_id"] if target_elem else None,
|
| 120 |
+
"element_name": target_elem["element_name"] if target_elem else None,
|
| 121 |
+
"sample_name": target_elem["sample_name"] if target_elem else None,
|
| 122 |
+
"dataset_name": target_elem["dataset_name"] if target_elem else None,
|
| 123 |
+
"pmid": target_elem["pmid"] if target_elem else None,
|
| 124 |
+
"geo_number": target_elem["geo_number"] if target_elem else None,
|
| 125 |
+
},
|
| 126 |
+
"evaluation_config": {
|
| 127 |
+
"tier": "promoter",
|
| 128 |
+
"tier_weights": tier_weights,
|
| 129 |
+
"is_negative": False,
|
| 130 |
+
"metrics": ["edit_distance_to_real", "logfc_match_error", "validity_dna", "motif_enrichment"]
|
| 131 |
+
},
|
| 132 |
+
"system_instructions": f"Task: Optimize {gene} promoter in {cell_line} cells. Target: {2**target_logfc:.1f}× expression. Output uppercase DNA sequence only."
|
| 133 |
+
}
|
| 134 |
+
|
| 135 |
+
return task
|
| 136 |
+
|
| 137 |
+
def build_enhancer_task(self, element: str, target_logfc: float, cell_line: str = "HepG2", direction: str = "up") -> Dict[str, Any]:
|
| 138 |
+
"""Build an enhancer task (8 total)"""
|
| 139 |
+
|
| 140 |
+
# For enhancers, use larger sequences (500bp+ if available, fallback to any)
|
| 141 |
+
elements = self.mpra_ext.find_large_sequences(
|
| 142 |
+
cell_line=cell_line,
|
| 143 |
+
min_length=500,
|
| 144 |
+
target_logfc=target_logfc,
|
| 145 |
+
tolerance=0.2,
|
| 146 |
+
limit=20,
|
| 147 |
+
)
|
| 148 |
+
|
| 149 |
+
if not elements:
|
| 150 |
+
# Fallback: any sequence at target logFC
|
| 151 |
+
elements = self.mpra_ext.find_by_logfc_range(
|
| 152 |
+
cell_line=cell_line,
|
| 153 |
+
min_logfc=target_logfc - 0.2,
|
| 154 |
+
max_logfc=target_logfc + 0.2,
|
| 155 |
+
limit=20,
|
| 156 |
+
)
|
| 157 |
+
|
| 158 |
+
if not elements:
|
| 159 |
+
print(f"WARNING: No enhancer match for {element}")
|
| 160 |
+
return None
|
| 161 |
+
|
| 162 |
+
target_elem = elements[0]
|
| 163 |
+
task_id = f"enh_{cell_line.lower()}_{element.lower()}_{direction}_v1"
|
| 164 |
+
|
| 165 |
+
task = {
|
| 166 |
+
"id": str(uuid.uuid4()),
|
| 167 |
+
"task_id": task_id,
|
| 168 |
+
"context": f"Design an enhancer element in {cell_line} cells achieving ~{2**target_logfc:.1f}× activity for {element}",
|
| 169 |
+
"metadata": {
|
| 170 |
+
"tier": "enhancer",
|
| 171 |
+
"element": element,
|
| 172 |
+
"cell_line": cell_line,
|
| 173 |
+
"challenge_level": "medium" if abs(target_logfc) < 1.0 else "hard",
|
| 174 |
+
"direction": direction,
|
| 175 |
+
"tags": ["enhancer", element.lower(), "cre", "mpra"]
|
| 176 |
+
},
|
| 177 |
+
"reference_sequence": self._get_sequence(target_elem) if target_elem else "<NO_MPRA>",
|
| 178 |
+
"target_sequence_real": self._get_sequence(target_elem) if target_elem else "<NO_MPRA>",
|
| 179 |
+
"target_logfc": target_logfc,
|
| 180 |
+
"target_logfc_actual": target_elem["logfc"],
|
| 181 |
+
"motifs_hint": self._get_motifs_for_element(element),
|
| 182 |
+
"mpra_source": {
|
| 183 |
+
"element_id": target_elem["element_id"],
|
| 184 |
+
"element_name": target_elem["element_name"],
|
| 185 |
+
"sample_name": target_elem["sample_name"],
|
| 186 |
+
"dataset_name": target_elem["dataset_name"],
|
| 187 |
+
"pmid": target_elem["pmid"],
|
| 188 |
+
"geo_number": target_elem["geo_number"],
|
| 189 |
+
},
|
| 190 |
+
"evaluation_config": {
|
| 191 |
+
"tier": "enhancer",
|
| 192 |
+
"tier_weights": [0.4, 0.4, 0.2], # Looser edit dist for enhancers
|
| 193 |
+
"is_negative": False,
|
| 194 |
+
"metrics": ["edit_distance_to_real", "logfc_match_error", "tf_binding_specificity"]
|
| 195 |
+
},
|
| 196 |
+
"system_instructions": f"Design enhancer for {element}. Target: {2**target_logfc:.1f}× activity. Output DNA sequence (800bp+)."
|
| 197 |
+
}
|
| 198 |
+
|
| 199 |
+
return task
|
| 200 |
+
|
| 201 |
+
def build_longrange_task(self, gene: str, distance_kb: int, target_logfc: float = 0.585) -> Dict[str, Any]:
|
| 202 |
+
"""Build a long-range/distal element task (4 total)"""
|
| 203 |
+
|
| 204 |
+
# Use large sequences (1000bp+ for distal elements)
|
| 205 |
+
elements = self.mpra_ext.find_large_sequences(
|
| 206 |
+
cell_line="HepG2",
|
| 207 |
+
min_length=1000,
|
| 208 |
+
target_logfc=target_logfc,
|
| 209 |
+
tolerance=0.25,
|
| 210 |
+
limit=20,
|
| 211 |
+
)
|
| 212 |
+
|
| 213 |
+
if not elements:
|
| 214 |
+
# Fallback: any sequence at target logFC
|
| 215 |
+
elements = self.mpra_ext.find_by_logfc_range(
|
| 216 |
+
cell_line="HepG2",
|
| 217 |
+
min_logfc=target_logfc - 0.25,
|
| 218 |
+
max_logfc=target_logfc + 0.25,
|
| 219 |
+
limit=20,
|
| 220 |
+
)
|
| 221 |
+
|
| 222 |
+
if not elements:
|
| 223 |
+
print(f"WARNING: No long-range match for {gene}")
|
| 224 |
+
return None
|
| 225 |
+
|
| 226 |
+
target_elem = elements[0]
|
| 227 |
+
task_id = f"lr_{distance_kb}kb_{gene.lower()}_v1"
|
| 228 |
+
|
| 229 |
+
task = {
|
| 230 |
+
"id": str(uuid.uuid4()),
|
| 231 |
+
"task_id": task_id,
|
| 232 |
+
"context": f"Design a distal regulatory element for {gene}, ~{distance_kb}kb from TSS, achieving ~{2**target_logfc:.1f}× activity",
|
| 233 |
+
"metadata": {
|
| 234 |
+
"tier": "long_range",
|
| 235 |
+
"gene": gene,
|
| 236 |
+
"distance_kb": distance_kb,
|
| 237 |
+
"challenge_level": "hard",
|
| 238 |
+
"tags": ["long_range", "distal", gene.lower(), "3d_chromatin"]
|
| 239 |
+
},
|
| 240 |
+
"reference_sequence": "<PLACEHOLDER>",
|
| 241 |
+
"target_sequence_real": self._get_sequence(target_elem) if target_elem else "<NO_MPRA>",
|
| 242 |
+
"target_logfc": target_logfc,
|
| 243 |
+
"target_logfc_actual": target_elem["logfc"],
|
| 244 |
+
"motifs_hint": self._get_motifs_for_gene(gene),
|
| 245 |
+
"mpra_source": {
|
| 246 |
+
"element_id": target_elem["element_id"],
|
| 247 |
+
"element_name": target_elem["element_name"],
|
| 248 |
+
"sample_name": target_elem["sample_name"],
|
| 249 |
+
"dataset_name": target_elem["dataset_name"],
|
| 250 |
+
"pmid": target_elem["pmid"],
|
| 251 |
+
"geo_number": target_elem["geo_number"],
|
| 252 |
+
},
|
| 253 |
+
"evaluation_config": {
|
| 254 |
+
"tier": "long_range",
|
| 255 |
+
"tier_weights": [0.3, 0.5, 0.2], # Function-focused: logFC is most important
|
| 256 |
+
"is_negative": False,
|
| 257 |
+
"metrics": ["logfc_match_error", "coarse_sequence_similarity", "tf_binding_enrichment"]
|
| 258 |
+
},
|
| 259 |
+
"system_instructions": f"Design long-range element for {gene}. Distance: ~{distance_kb}kb from TSS. Target: {2**target_logfc:.1f}× activity. Output DNA (1500bp+)."
|
| 260 |
+
}
|
| 261 |
+
|
| 262 |
+
return task
|
| 263 |
+
|
| 264 |
+
def build_negative_task(self, failure_mode: str) -> Dict[str, Any]:
|
| 265 |
+
"""Build a negative/failure case task (4 total)"""
|
| 266 |
+
|
| 267 |
+
# Use a real reference from v1.0
|
| 268 |
+
ref_task = self.mpra.find_best_elements_for_target(
|
| 269 |
+
target_logfc=0.585, cell_line="HepG2", tolerance=0.1, limit=1
|
| 270 |
+
)
|
| 271 |
+
ref_seq = self._get_sequence(ref_task[0]) if ref_task else "AAGCTAGCCCCGCGGTGTGGATTATATAATCGTAGCTAGCTAGCTAGCGCGCGCGCGCGC" * 3
|
| 272 |
+
|
| 273 |
+
# Generate negative case
|
| 274 |
+
neg_spec = create_negative_task(failure_mode, ref_seq)
|
| 275 |
+
|
| 276 |
+
task_id = f"neg_{failure_mode}_v1"
|
| 277 |
+
|
| 278 |
+
task = {
|
| 279 |
+
"id": str(uuid.uuid4()),
|
| 280 |
+
"task_id": task_id,
|
| 281 |
+
"context": f"Design a sequence that SUPPRESSES expression due to: {failure_mode}",
|
| 282 |
+
"metadata": {
|
| 283 |
+
"tier": "negative",
|
| 284 |
+
"failure_mode": failure_mode,
|
| 285 |
+
"challenge_level": "negative",
|
| 286 |
+
"tags": ["negative", "failure_mode", failure_mode, "design_test"]
|
| 287 |
+
},
|
| 288 |
+
"reference_sequence": ref_seq,
|
| 289 |
+
"target_sequence_real": neg_spec["target_sequence_negative"],
|
| 290 |
+
"target_logfc": neg_spec["expected_logfc"],
|
| 291 |
+
"target_logfc_actual": neg_spec["expected_logfc"],
|
| 292 |
+
"motifs_hint": self._get_motifs_for_failure(failure_mode),
|
| 293 |
+
"mpra_source": {
|
| 294 |
+
"element_id": "synthetic_negative",
|
| 295 |
+
"element_name": f"neg_{failure_mode}",
|
| 296 |
+
"sample_name": "synthetic_design",
|
| 297 |
+
"dataset_name": "DNA-World-Tiny-Negative",
|
| 298 |
+
"pmid": None,
|
| 299 |
+
"geo_number": None,
|
| 300 |
+
},
|
| 301 |
+
"evaluation_config": {
|
| 302 |
+
"tier": "negative",
|
| 303 |
+
"tier_weights": None, # INVERSE scoring
|
| 304 |
+
"is_negative": True,
|
| 305 |
+
"metrics": ["repression_strength", "off_target_binding", "absence_of_activators"]
|
| 306 |
+
},
|
| 307 |
+
"system_instructions": f"Design sequence with failure mode '{failure_mode}' to suppress expression. Target: {neg_spec['expected_multiplier']:.3f}× (LOW)."
|
| 308 |
+
}
|
| 309 |
+
|
| 310 |
+
return task
|
| 311 |
+
|
| 312 |
+
def build_gradient_task(self, gene: str, target_logfc: float) -> Dict[str, Any]:
|
| 313 |
+
"""Build a fine-tuning/gradient task (2 total)"""
|
| 314 |
+
|
| 315 |
+
# Use precise logFC range queries
|
| 316 |
+
elements = self.mpra_ext.find_by_logfc_range(
|
| 317 |
+
cell_line="HepG2",
|
| 318 |
+
min_logfc=target_logfc - 0.05,
|
| 319 |
+
max_logfc=target_logfc + 0.05,
|
| 320 |
+
limit=20,
|
| 321 |
+
)
|
| 322 |
+
|
| 323 |
+
if not elements:
|
| 324 |
+
print(f"WARNING: No gradient match for {gene} {target_logfc:.2f}")
|
| 325 |
+
return None
|
| 326 |
+
|
| 327 |
+
target_elem = elements[0]
|
| 328 |
+
multiplier = 2 ** target_logfc
|
| 329 |
+
|
| 330 |
+
if target_logfc > 0:
|
| 331 |
+
challenge = "subtle_boost"
|
| 332 |
+
else:
|
| 333 |
+
challenge = "strong_repression"
|
| 334 |
+
|
| 335 |
+
task_id = f"grad_{gene.lower()}_{challenge}_v1"
|
| 336 |
+
|
| 337 |
+
task = {
|
| 338 |
+
"id": str(uuid.uuid4()),
|
| 339 |
+
"task_id": task_id,
|
| 340 |
+
"context": f"Fine-tune {gene} promoter for precise ~{multiplier:.2f}× expression adjustment",
|
| 341 |
+
"metadata": {
|
| 342 |
+
"tier": "gradient",
|
| 343 |
+
"gene": gene,
|
| 344 |
+
"challenge_level": challenge,
|
| 345 |
+
"precision_required": True,
|
| 346 |
+
"tags": ["gradient", "fine_tune", gene.lower(), challenge]
|
| 347 |
+
},
|
| 348 |
+
"reference_sequence": self._get_sequence(target_elem),
|
| 349 |
+
"target_sequence_real": self._get_sequence(target_elem),
|
| 350 |
+
"target_logfc": target_logfc,
|
| 351 |
+
"target_logfc_actual": target_elem["logfc"],
|
| 352 |
+
"motifs_hint": self._get_motifs_for_gene(gene),
|
| 353 |
+
"mpra_source": {
|
| 354 |
+
"element_id": target_elem["element_id"],
|
| 355 |
+
"element_name": target_elem["element_name"],
|
| 356 |
+
"sample_name": target_elem["sample_name"],
|
| 357 |
+
"dataset_name": target_elem["dataset_name"],
|
| 358 |
+
"pmid": target_elem["pmid"],
|
| 359 |
+
"geo_number": target_elem["geo_number"],
|
| 360 |
+
},
|
| 361 |
+
"evaluation_config": {
|
| 362 |
+
"tier": "gradient",
|
| 363 |
+
"tier_weights": [0.7, 0.25, 0.05], # Tight tolerances: ED primary
|
| 364 |
+
"is_negative": False,
|
| 365 |
+
"metrics": ["edit_distance_to_real", "logfc_precision", "subtle_motif_changes"]
|
| 366 |
+
},
|
| 367 |
+
"system_instructions": f"Fine-tune {gene} for {multiplier:.2f}× (logFC {target_logfc:.3f}). Precision critical. Output DNA."
|
| 368 |
+
}
|
| 369 |
+
|
| 370 |
+
return task
|
| 371 |
+
|
| 372 |
+
def _get_motifs_for_gene(self, gene: str) -> List[str]:
|
| 373 |
+
"""Get tissue/gene-specific TF motifs"""
|
| 374 |
+
motifs = {
|
| 375 |
+
"ALB": ["TATA-box", "HNF1", "HNF4A"],
|
| 376 |
+
"TTR": ["TATA", "HNF3", "C/EBP"],
|
| 377 |
+
"GAPDH": ["SP1", "NRF1", "CpG-rich"],
|
| 378 |
+
"ACTB": ["SP1", "YY1", "CpG-island"],
|
| 379 |
+
"GFAP": ["NFIA", "STAT3", "CpG-medium"],
|
| 380 |
+
"MBP": ["SOX10", "MYT1", "CpG-rich"],
|
| 381 |
+
}
|
| 382 |
+
return motifs.get(gene, ["generic_TF"])
|
| 383 |
+
|
| 384 |
+
def _get_motifs_for_element(self, element: str) -> List[str]:
|
| 385 |
+
"""Get CRE-specific motifs"""
|
| 386 |
+
motifs = {
|
| 387 |
+
"HNF4A": ["HNF4A", "DR1"],
|
| 388 |
+
"FOXA2": ["FOXA2", "pioneer"],
|
| 389 |
+
"NRF1": ["NRF1", "GABP"],
|
| 390 |
+
"STAT3": ["STAT3", "GAS"],
|
| 391 |
+
}
|
| 392 |
+
return motifs.get(element, ["CRE"])
|
| 393 |
+
|
| 394 |
+
def _get_motifs_for_failure(self, failure_mode: str) -> List[str]:
|
| 395 |
+
"""Get anti-motifs for failure modes"""
|
| 396 |
+
motifs = {
|
| 397 |
+
"tata_less": ["NO_TATA", "weak_promoter"],
|
| 398 |
+
"gc_extreme": ["90pct_GC", "secondary_structure"],
|
| 399 |
+
"motif_scramble": ["disrupted_binding", "scrambled_motifs"],
|
| 400 |
+
"repressor_heavy": ["NRSF", "REST", "repressor_packed"],
|
| 401 |
+
}
|
| 402 |
+
return motifs.get(failure_mode, ["failure"])
|
| 403 |
+
|
| 404 |
+
def build(self):
|
| 405 |
+
"""Build all 30 tasks"""
|
| 406 |
+
print("Building DNA-World-Tiny (30 tasks)...")
|
| 407 |
+
|
| 408 |
+
# TIER 1: Promoters (12)
|
| 409 |
+
print("\n[TIER 1] Building 12 promoter tasks...")
|
| 410 |
+
promoter_specs = [
|
| 411 |
+
# Keep v1.0 (10 tasks)
|
| 412 |
+
("ALB", "up", "HepG2", 0.585, "medium"),
|
| 413 |
+
("TTR", "up", "HepG2", 0.585, "medium"),
|
| 414 |
+
("GAPDH", "up", "HepG2", 0.585, "medium"),
|
| 415 |
+
("ACTB", "up", "HepG2", 0.585, "medium"),
|
| 416 |
+
("GAPDH", "down", "HepG2", -0.585, "medium"),
|
| 417 |
+
("TTR", "down", "HepG2", -0.585, "medium"),
|
| 418 |
+
("ALB", "up", "HepG2", 1.0, "hard"),
|
| 419 |
+
("GFAP", "up", "K562", 0.585, "medium"),
|
| 420 |
+
("MBP", "up", "K562", 0.585, "medium"),
|
| 421 |
+
("ACTB", "shift_up", "K562", 0.585, "medium"),
|
| 422 |
+
# New for v1.1 (2 tasks)
|
| 423 |
+
("ALB", "up", "HepG2", 1.585, "ultra_hard"), # 3×
|
| 424 |
+
("TTR", "up", "HepG2", 0.138, "ultra_easy"), # 1.1×
|
| 425 |
+
]
|
| 426 |
+
|
| 427 |
+
for i, (gene, direction, cell, target_fc, challenge) in enumerate(promoter_specs, 1):
|
| 428 |
+
is_new = i > 10
|
| 429 |
+
task = self.build_promoter_task(gene, direction, cell, target_fc, challenge, is_new)
|
| 430 |
+
if task:
|
| 431 |
+
self.tasks.append(task)
|
| 432 |
+
print(f" ✓ {i}/12: {gene} {direction} {challenge}")
|
| 433 |
+
|
| 434 |
+
# TIER 2: Enhancers (8)
|
| 435 |
+
print("\n[TIER 2] Building 8 enhancer tasks...")
|
| 436 |
+
enhancer_specs = [
|
| 437 |
+
("HNF4A_CRE", 0.585, "HepG2", "up"),
|
| 438 |
+
("FOXA2_pioneer", 0.585, "HepG2", "up"),
|
| 439 |
+
("NRF1_ubiquitous", 0.585, "HepG2", "up"),
|
| 440 |
+
("STAT3_immune", 1.0, "K562", "up"),
|
| 441 |
+
("silencer_composite", -0.585, "HepG2", "down"),
|
| 442 |
+
("bidirectional_ALB_TTR", 0.585, "HepG2", "up"),
|
| 443 |
+
("distal_activator_5kb", 0.585, "HepG2", "up"),
|
| 444 |
+
("super_enhancer", 1.0, "HepG2", "up"),
|
| 445 |
+
]
|
| 446 |
+
|
| 447 |
+
for i, (elem, target_fc, cell, direction) in enumerate(enhancer_specs, 1):
|
| 448 |
+
task = self.build_enhancer_task(elem, target_fc, cell, direction)
|
| 449 |
+
if task:
|
| 450 |
+
self.tasks.append(task)
|
| 451 |
+
print(f" ✓ {i}/8: {elem}")
|
| 452 |
+
|
| 453 |
+
# TIER 3: Long-range (4)
|
| 454 |
+
print("\n[TIER 3] Building 4 long-range tasks...")
|
| 455 |
+
longrange_specs = [
|
| 456 |
+
("ALB", 50, 0.585),
|
| 457 |
+
("GAPDH", 30, 0.585),
|
| 458 |
+
("TTR", 40, 0.585),
|
| 459 |
+
("ACTB", 60, 1.0),
|
| 460 |
+
]
|
| 461 |
+
|
| 462 |
+
for i, (gene, dist_kb, target_fc) in enumerate(longrange_specs, 1):
|
| 463 |
+
task = self.build_longrange_task(gene, dist_kb, target_fc)
|
| 464 |
+
if task:
|
| 465 |
+
self.tasks.append(task)
|
| 466 |
+
print(f" ✓ {i}/4: {gene} +{dist_kb}kb")
|
| 467 |
+
|
| 468 |
+
# TIER 4: Negatives (4)
|
| 469 |
+
print("\n[TIER 4] Building 4 negative tasks...")
|
| 470 |
+
negative_specs = [
|
| 471 |
+
"tata_less",
|
| 472 |
+
"gc_extreme",
|
| 473 |
+
"motif_scramble",
|
| 474 |
+
"repressor_heavy",
|
| 475 |
+
]
|
| 476 |
+
|
| 477 |
+
for i, failure_mode in enumerate(negative_specs, 1):
|
| 478 |
+
task = self.build_negative_task(failure_mode)
|
| 479 |
+
if task:
|
| 480 |
+
self.tasks.append(task)
|
| 481 |
+
print(f" ✓ {i}/4: {failure_mode}")
|
| 482 |
+
|
| 483 |
+
# TIER 5: Gradient (2)
|
| 484 |
+
print("\n[TIER 5] Building 2 gradient tasks...")
|
| 485 |
+
gradient_specs = [
|
| 486 |
+
("ALB", 0.322), # 1.25×
|
| 487 |
+
("GAPDH", -1.32), # 0.4× (strong repression)
|
| 488 |
+
]
|
| 489 |
+
|
| 490 |
+
for i, (gene, target_fc) in enumerate(gradient_specs, 1):
|
| 491 |
+
task = self.build_gradient_task(gene, target_fc)
|
| 492 |
+
if task:
|
| 493 |
+
self.tasks.append(task)
|
| 494 |
+
print(f" ✓ {i}/2: {gene} gradient")
|
| 495 |
+
|
| 496 |
+
return self.tasks
|
| 497 |
+
|
| 498 |
+
def save(self, filename: str = "dna_world_tiny_v1_1.jsonl"):
|
| 499 |
+
"""Save tasks to JSONL"""
|
| 500 |
+
output_path = self.output_dir / filename
|
| 501 |
+
with open(output_path, "w") as f:
|
| 502 |
+
for task in self.tasks:
|
| 503 |
+
f.write(json.dumps(task) + "\n")
|
| 504 |
+
|
| 505 |
+
print(f"\n✅ Saved {len(self.tasks)} tasks to {output_path}")
|
| 506 |
+
return output_path
|
| 507 |
+
|
| 508 |
+
def close(self):
|
| 509 |
+
self.mpra.close()
|
| 510 |
+
self.mpra_ext.close()
|
| 511 |
+
|
| 512 |
+
|
| 513 |
+
if __name__ == "__main__":
|
| 514 |
+
builder = BenchmarkBuilderV11()
|
| 515 |
+
builder.build()
|
| 516 |
+
builder.save()
|
| 517 |
+
builder.close()
|
| 518 |
+
|
| 519 |
+
print("\n" + "="*60)
|
| 520 |
+
print("✨ DNA-World-Tiny BUILT SUCCESSFULLY!")
|
| 521 |
+
print("="*60)
|
scripts/design_negative_cases.py
ADDED
|
@@ -0,0 +1,285 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env python3
|
| 2 |
+
"""
|
| 3 |
+
design_negative_cases.py: Synthetic failure mode sequence generation for benchmark.
|
| 4 |
+
|
| 5 |
+
This module generates intentional failure cases for the negative tasks tier (4 tasks).
|
| 6 |
+
These sequences test model robustness by introducing known defects that should reduce
|
| 7 |
+
expression, allowing evaluation of whether models correctly predict repression.
|
| 8 |
+
|
| 9 |
+
Failure Modes Implemented:
|
| 10 |
+
|
| 11 |
+
1. TATA-less variant (expected: ~0.2× repression, logFC 0.2)
|
| 12 |
+
- Remove TATA-box patterns (TATAAA, TATAWAW, etc.)
|
| 13 |
+
- Tests dependency on core promoter elements
|
| 14 |
+
|
| 15 |
+
2. GC-extreme (expected: ~0.3× repression, logFC 0.3)
|
| 16 |
+
- Create extreme GC content (90%) in promoter region
|
| 17 |
+
- Tests secondary structure and binding accessibility issues
|
| 18 |
+
|
| 19 |
+
3. Motif-scrambled (expected: ~0.1× repression, logFC 0.1)
|
| 20 |
+
- Shuffle transcription factor binding sites relative to each other
|
| 21 |
+
- Tests importance of spatial organization of regulatory motifs
|
| 22 |
+
|
| 23 |
+
4. Repressor-heavy (expected: ~0.05× repression, logFC -5.0)
|
| 24 |
+
- Pack sequence with known repressor binding sites (NRSF, REST)
|
| 25 |
+
- Tests model's understanding of active repression mechanisms
|
| 26 |
+
|
| 27 |
+
5. Strong repression composite (expected: ~0.4× repression, logFC -1.32)
|
| 28 |
+
- Combine multiple failure modes (TATA-less + GC-extreme + motif-scramble)
|
| 29 |
+
- Tests cumulative effects of multiple defects
|
| 30 |
+
|
| 31 |
+
Classes:
|
| 32 |
+
NegativeCaseDesigner: Static methods for generating failure modes
|
| 33 |
+
|
| 34 |
+
Usage:
|
| 35 |
+
from design_negative_cases import NegativeCaseDesigner, create_negative_task
|
| 36 |
+
|
| 37 |
+
designer = NegativeCaseDesigner()
|
| 38 |
+
|
| 39 |
+
# Individual failure modes
|
| 40 |
+
tata_less = designer.create_tata_less_variant(ref_seq)
|
| 41 |
+
gc_extreme = designer.create_gc_extreme(ref_seq, gc_target=0.9)
|
| 42 |
+
scrambled = designer.scramble_motifs(ref_seq)
|
| 43 |
+
repressor_rich = designer.create_repressor_rich()
|
| 44 |
+
|
| 45 |
+
# Complete negative task
|
| 46 |
+
task = create_negative_task("tata_less", ref_seq)
|
| 47 |
+
|
| 48 |
+
Used by: build_benchmark.py for generating 4 negative control tasks
|
| 49 |
+
"""
|
| 50 |
+
|
| 51 |
+
import random
|
| 52 |
+
from typing import Tuple, List, Dict, Any
|
| 53 |
+
import re
|
| 54 |
+
|
| 55 |
+
|
| 56 |
+
class NegativeCaseDesigner:
|
| 57 |
+
"""Design sequences that are expected to FAIL (low expression)"""
|
| 58 |
+
|
| 59 |
+
@staticmethod
|
| 60 |
+
def create_tata_less_variant(ref_seq: str) -> str:
|
| 61 |
+
"""
|
| 62 |
+
Remove TATA-box pattern (TATAAA or similar) from sequence
|
| 63 |
+
Expected: logFC ~0.2× (strong repression)
|
| 64 |
+
"""
|
| 65 |
+
# Common TATA patterns
|
| 66 |
+
tata_patterns = [
|
| 67 |
+
r'TATAAA',
|
| 68 |
+
r'TATAWAW', # W = A or T
|
| 69 |
+
r'TATA[AT][AT][AT]',
|
| 70 |
+
]
|
| 71 |
+
|
| 72 |
+
result = ref_seq
|
| 73 |
+
for pattern in tata_patterns:
|
| 74 |
+
match = re.search(pattern, result, re.IGNORECASE)
|
| 75 |
+
if match:
|
| 76 |
+
# Replace with random non-TATA sequence
|
| 77 |
+
replacement = ''.join(random.choice('ACGT') for _ in range(len(match.group())))
|
| 78 |
+
# Make sure it's not TATA
|
| 79 |
+
while replacement.upper().startswith('TATA'):
|
| 80 |
+
replacement = ''.join(random.choice('ACGT') for _ in range(len(match.group())))
|
| 81 |
+
result = result[:match.start()] + replacement + result[match.end():]
|
| 82 |
+
break
|
| 83 |
+
|
| 84 |
+
return result
|
| 85 |
+
|
| 86 |
+
@staticmethod
|
| 87 |
+
def create_gc_extreme(ref_seq: str, gc_target: float = 0.9) -> str:
|
| 88 |
+
"""
|
| 89 |
+
Create sequence with extreme GC content (e.g., 90% GC)
|
| 90 |
+
Expected: logFC ~0.3× (structural issues, secondary structure)
|
| 91 |
+
"""
|
| 92 |
+
current_seq = list(ref_seq)
|
| 93 |
+
gc_count = sum(1 for c in current_seq if c.upper() in 'GC')
|
| 94 |
+
gc_current = gc_count / len(current_seq)
|
| 95 |
+
|
| 96 |
+
# Mutate towards target GC
|
| 97 |
+
target_gc_count = int(len(current_seq) * gc_target)
|
| 98 |
+
mutations_needed = target_gc_count - gc_count
|
| 99 |
+
|
| 100 |
+
if mutations_needed > 0:
|
| 101 |
+
# Need more GC
|
| 102 |
+
indices = [i for i, c in enumerate(current_seq) if c.upper() in 'AT']
|
| 103 |
+
random.shuffle(indices)
|
| 104 |
+
for i in indices[:mutations_needed]:
|
| 105 |
+
current_seq[i] = random.choice('GC')
|
| 106 |
+
elif mutations_needed < 0:
|
| 107 |
+
# Need less GC
|
| 108 |
+
indices = [i for i, c in enumerate(current_seq) if c.upper() in 'GC']
|
| 109 |
+
random.shuffle(indices)
|
| 110 |
+
for i in indices[:abs(mutations_needed)]:
|
| 111 |
+
current_seq[i] = random.choice('AT')
|
| 112 |
+
|
| 113 |
+
return ''.join(current_seq)
|
| 114 |
+
|
| 115 |
+
@staticmethod
|
| 116 |
+
def scramble_motifs(ref_seq: str, motif_patterns: List[str] = None) -> str:
|
| 117 |
+
"""
|
| 118 |
+
Find known TF binding motifs and scramble their order
|
| 119 |
+
Expected: logFC ~0.1× (binding disrupted but sequence intact)
|
| 120 |
+
"""
|
| 121 |
+
if motif_patterns is None:
|
| 122 |
+
# Common liver TF binding sites
|
| 123 |
+
motif_patterns = [
|
| 124 |
+
'TATA',
|
| 125 |
+
'CGCCCCGC', # SP1
|
| 126 |
+
'GGTGTGTG', # FOXA
|
| 127 |
+
'GGCNNNNNNGC', # HNF4A (loose)
|
| 128 |
+
]
|
| 129 |
+
|
| 130 |
+
result = list(ref_seq)
|
| 131 |
+
motif_positions = []
|
| 132 |
+
|
| 133 |
+
# Find all motif occurrences
|
| 134 |
+
for pattern in motif_patterns:
|
| 135 |
+
for match in re.finditer(pattern, ref_seq, re.IGNORECASE):
|
| 136 |
+
motif_positions.append((match.start(), match.end(), match.group()))
|
| 137 |
+
|
| 138 |
+
if len(motif_positions) >= 2:
|
| 139 |
+
# Shuffle motif order by swapping their sequences
|
| 140 |
+
motif_positions.sort(key=lambda x: x[0])
|
| 141 |
+
random.shuffle(motif_positions)
|
| 142 |
+
|
| 143 |
+
# Reconstruct with shuffled motifs
|
| 144 |
+
result = list(ref_seq)
|
| 145 |
+
for i, (start, end, _) in enumerate(motif_positions):
|
| 146 |
+
if i < len(motif_positions) - 1:
|
| 147 |
+
next_start, next_end, next_motif = motif_positions[i + 1]
|
| 148 |
+
# Swap if non-overlapping
|
| 149 |
+
if end <= next_start:
|
| 150 |
+
for j, char in enumerate(next_motif):
|
| 151 |
+
if start + j < len(result):
|
| 152 |
+
result[start + j] = char
|
| 153 |
+
|
| 154 |
+
return ''.join(result)
|
| 155 |
+
|
| 156 |
+
@staticmethod
|
| 157 |
+
def create_repressor_rich(cell_line: str = "HepG2", length: int = 300) -> str:
|
| 158 |
+
"""
|
| 159 |
+
Pack sequence with known repressor motifs
|
| 160 |
+
Expected: logFC ~0.05× (ultra-strong repression)
|
| 161 |
+
|
| 162 |
+
Repressor motifs:
|
| 163 |
+
- NRSF (neuron-restrictive silencing factor): RCRCAGCGAG (R = A or G)
|
| 164 |
+
- REST (RE1/NRSE): similar to NRSF
|
| 165 |
+
- ZNF274 binding sites: scattered throughout
|
| 166 |
+
- GC-boxes that can recruit corepressors
|
| 167 |
+
"""
|
| 168 |
+
repressor_motifs = {
|
| 169 |
+
"NRSF": "RCRCAGCGAG", # R = A/G
|
| 170 |
+
"REST": "AGCCACCGCG",
|
| 171 |
+
"CTCF": "CCGCNGGNGG",
|
| 172 |
+
"ZNF274": "GGCGGG",
|
| 173 |
+
}
|
| 174 |
+
|
| 175 |
+
# Build sequence by tiling repressor motifs
|
| 176 |
+
sequence = []
|
| 177 |
+
while len(sequence) < length:
|
| 178 |
+
motif = random.choice(list(repressor_motifs.values()))
|
| 179 |
+
# Substitute R with A or G
|
| 180 |
+
motif = motif.replace('R', random.choice('AG')).replace('N', random.choice('ACGT'))
|
| 181 |
+
sequence.append(motif)
|
| 182 |
+
|
| 183 |
+
return ''.join(sequence)[:length]
|
| 184 |
+
|
| 185 |
+
@staticmethod
|
| 186 |
+
def create_strong_repression(ref_seq: str, target_repression: float = 0.4) -> str:
|
| 187 |
+
"""
|
| 188 |
+
Create variant with strong repression (~40% of WT, logFC ~-1.32)
|
| 189 |
+
Combination: TATA-less + GC-extreme + motif-scramble
|
| 190 |
+
"""
|
| 191 |
+
# Apply multiple failure modes
|
| 192 |
+
result = ref_seq
|
| 193 |
+
|
| 194 |
+
# 1. Remove TATA (stronger repression)
|
| 195 |
+
result = NegativeCaseDesigner.create_tata_less_variant(result)
|
| 196 |
+
|
| 197 |
+
# 2. Add moderate GC shift (secondary structure)
|
| 198 |
+
result = NegativeCaseDesigner.create_gc_extreme(result, gc_target=0.7)
|
| 199 |
+
|
| 200 |
+
# 3. Scramble major motifs
|
| 201 |
+
result = NegativeCaseDesigner.scramble_motifs(result)
|
| 202 |
+
|
| 203 |
+
return result
|
| 204 |
+
|
| 205 |
+
|
| 206 |
+
def create_negative_task(failure_mode: str, ref_seq: str = None) -> dict:
|
| 207 |
+
"""
|
| 208 |
+
Create a complete negative task specification
|
| 209 |
+
"""
|
| 210 |
+
|
| 211 |
+
if ref_seq is None:
|
| 212 |
+
# Default ref (simple promoter-like sequence)
|
| 213 |
+
ref_seq = "AAGCTAGCCCCGCGGTGTGGATTATATAATCGTAGCTAGCTAGCTAGCGCGCGCGCGCGC"
|
| 214 |
+
ref_seq = ref_seq * 3 # ~180bp
|
| 215 |
+
|
| 216 |
+
designer = NegativeCaseDesigner()
|
| 217 |
+
|
| 218 |
+
if failure_mode == "tata_less":
|
| 219 |
+
target_seq = designer.create_tata_less_variant(ref_seq)
|
| 220 |
+
expected_logfc = 0.2 # ~0.2× expression
|
| 221 |
+
expected_multiplier = 2 ** expected_logfc
|
| 222 |
+
|
| 223 |
+
elif failure_mode == "gc_extreme":
|
| 224 |
+
target_seq = designer.create_gc_extreme(ref_seq, gc_target=0.9)
|
| 225 |
+
expected_logfc = 0.3
|
| 226 |
+
expected_multiplier = 2 ** expected_logfc
|
| 227 |
+
|
| 228 |
+
elif failure_mode == "motif_scramble":
|
| 229 |
+
target_seq = designer.scramble_motifs(ref_seq)
|
| 230 |
+
expected_logfc = 0.1
|
| 231 |
+
expected_multiplier = 2 ** expected_logfc
|
| 232 |
+
|
| 233 |
+
elif failure_mode == "repressor_heavy":
|
| 234 |
+
target_seq = designer.create_repressor_rich(length=len(ref_seq))
|
| 235 |
+
expected_logfc = -5.0 # Ultra-repression
|
| 236 |
+
expected_multiplier = 2 ** expected_logfc
|
| 237 |
+
|
| 238 |
+
elif failure_mode == "strong_repression":
|
| 239 |
+
target_seq = designer.create_strong_repression(ref_seq)
|
| 240 |
+
expected_logfc = -1.32
|
| 241 |
+
expected_multiplier = 2 ** expected_logfc
|
| 242 |
+
|
| 243 |
+
else:
|
| 244 |
+
raise ValueError(f"Unknown failure mode: {failure_mode}")
|
| 245 |
+
|
| 246 |
+
return {
|
| 247 |
+
"failure_mode": failure_mode,
|
| 248 |
+
"reference_sequence": ref_seq,
|
| 249 |
+
"target_sequence_negative": target_seq,
|
| 250 |
+
"expected_logfc": expected_logfc,
|
| 251 |
+
"expected_multiplier": expected_multiplier,
|
| 252 |
+
"design_logic": f"Sequence designed to FAIL expression: {failure_mode}",
|
| 253 |
+
}
|
| 254 |
+
|
| 255 |
+
|
| 256 |
+
if __name__ == "__main__":
|
| 257 |
+
designer = NegativeCaseDesigner()
|
| 258 |
+
|
| 259 |
+
print("=== TATA-less Variant ===")
|
| 260 |
+
ref = "GAATTCTAGCTAGCTAGGTAGCCCCGCGGTGTGGATTATATAATCGTAGCT"
|
| 261 |
+
tata_less = designer.create_tata_less_variant(ref)
|
| 262 |
+
print(f"Ref: {ref}")
|
| 263 |
+
print(f"Mut: {tata_less}")
|
| 264 |
+
print(f"TATA removed: {ref.count('TATA')} ��� {tata_less.upper().count('TATA')}")
|
| 265 |
+
|
| 266 |
+
print("\n=== GC-Extreme (90%) ===")
|
| 267 |
+
gc_extreme = designer.create_gc_extreme(ref, gc_target=0.9)
|
| 268 |
+
gc_pct = sum(1 for c in gc_extreme if c.upper() in 'GC') / len(gc_extreme) * 100
|
| 269 |
+
print(f"Ref GC%: {sum(1 for c in ref if c.upper() in 'GC') / len(ref) * 100:.1f}%")
|
| 270 |
+
print(f"Mut GC%: {gc_pct:.1f}%")
|
| 271 |
+
|
| 272 |
+
print("\n=== Motif-Scrambled ===")
|
| 273 |
+
scrambled = designer.scramble_motifs(ref)
|
| 274 |
+
print(f"Ref: {ref}")
|
| 275 |
+
print(f"Mut: {scrambled}")
|
| 276 |
+
|
| 277 |
+
print("\n=== Repressor-Heavy ===")
|
| 278 |
+
repressor = designer.create_repressor_rich(length=150)
|
| 279 |
+
print(f"Seq: {repressor}")
|
| 280 |
+
print(f"GC%: {sum(1 for c in repressor if c.upper() in 'GC') / len(repressor) * 100:.1f}%")
|
| 281 |
+
|
| 282 |
+
print("\n=== Negative Task Example ===")
|
| 283 |
+
task = create_negative_task("tata_less", ref)
|
| 284 |
+
print(f"Task: {task['failure_mode']}")
|
| 285 |
+
print(f"Expected logFC: {task['expected_logfc']:.2f} (multiplier: {task['expected_multiplier']:.3f}×)")
|
scripts/mpra_queries.py
ADDED
|
@@ -0,0 +1,456 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env python3
|
| 2 |
+
"""
|
| 3 |
+
mpra_queries.py: Unified MPRA database query interface for DNA-World-Tiny.
|
| 4 |
+
|
| 5 |
+
Consolidated module combining all MPRA database functionality:
|
| 6 |
+
- Base queries: Find elements by fold-change, genomic regions, data stats
|
| 7 |
+
- Extended queries: Specialized methods for benchmark v1.1 task types
|
| 8 |
+
|
| 9 |
+
This is the single query interface used by build_benchmark.py to retrieve diverse
|
| 10 |
+
MPRA elements for assembling the DNA-World-Tiny benchmark across 5 element types
|
| 11 |
+
and 30 tasks.
|
| 12 |
+
|
| 13 |
+
Query Categories:
|
| 14 |
+
1. Base Queries (standard)
|
| 15 |
+
- find_best_elements_for_target(): Elements by fold-change
|
| 16 |
+
- find_elements_by_region(): Elements by genomic region
|
| 17 |
+
|
| 18 |
+
2. Extended Queries (benchmark tasks)
|
| 19 |
+
- find_extreme_logfc(): Ultra-hard 3× tasks
|
| 20 |
+
- find_strong_repressors(): Negative case elements
|
| 21 |
+
- find_by_logfc_range(): Gradient/fine-tune tasks
|
| 22 |
+
- find_large_sequences(): Enhancer/long-range tasks
|
| 23 |
+
|
| 24 |
+
3. Utilities
|
| 25 |
+
- get_score_extremes(): Data quality metrics
|
| 26 |
+
- _parse_coordinates_from_name(): Coordinate parsing helper
|
| 27 |
+
|
| 28 |
+
Classes:
|
| 29 |
+
MPRAQueries: Complete MPRA query interface
|
| 30 |
+
|
| 31 |
+
Usage:
|
| 32 |
+
from mpra_queries import MPRAQueries
|
| 33 |
+
|
| 34 |
+
queries = MPRAQueries()
|
| 35 |
+
|
| 36 |
+
# Base: standard promoter queries
|
| 37 |
+
elements = queries.find_best_elements_for_target(0.585, "HepG2", limit=50)
|
| 38 |
+
|
| 39 |
+
# Extended: v1.1 benchmark tasks
|
| 40 |
+
extreme = queries.find_extreme_logfc("HepG2", 1.585, limit=20)
|
| 41 |
+
repressors = queries.find_strong_repressors("HepG2", -1.0, limit=20)
|
| 42 |
+
enhancers = queries.find_large_sequences("HepG2", 500, 0.585, limit=20)
|
| 43 |
+
|
| 44 |
+
queries.close()
|
| 45 |
+
|
| 46 |
+
Note: This module consolidates functionality from extract_mpra_sqlite (v1.0) and
|
| 47 |
+
expand_mpra_queries (v1.1 extensions) into a single unified interface.
|
| 48 |
+
"""
|
| 49 |
+
|
| 50 |
+
import sqlite3
|
| 51 |
+
import re
|
| 52 |
+
from typing import List, Dict, Any, Optional
|
| 53 |
+
from pathlib import Path
|
| 54 |
+
|
| 55 |
+
MPRA_DB = Path(__file__).parent.parent / "mprabase_v4_9.3.db"
|
| 56 |
+
CACHE_DIR = Path(__file__).parent.parent / "mpra_cache"
|
| 57 |
+
CACHE_DIR.mkdir(exist_ok=True)
|
| 58 |
+
|
| 59 |
+
# Base query template for all element retrievals
|
| 60 |
+
_BASE_ELEMENT_QUERY = """
|
| 61 |
+
SELECT
|
| 62 |
+
ls.library_element_id,
|
| 63 |
+
ls.library_element_name,
|
| 64 |
+
ls.sequence,
|
| 65 |
+
LENGTH(ls.sequence) as tile_length,
|
| 66 |
+
es.score,
|
| 67 |
+
s.sample_name,
|
| 68 |
+
s.Cell_line_tissue,
|
| 69 |
+
dl.library_name,
|
| 70 |
+
d.datasets_name,
|
| 71 |
+
d.PMID,
|
| 72 |
+
d.GEO_number
|
| 73 |
+
FROM library_sequence ls
|
| 74 |
+
JOIN designed_library dl ON ls.library_id = dl.library_id
|
| 75 |
+
JOIN sample s ON dl.library_id = s.library_id
|
| 76 |
+
JOIN element_score es ON ls.library_element_id = es.library_element_id
|
| 77 |
+
AND s.sample_id = es.sample_id
|
| 78 |
+
JOIN datasets d ON dl.datasets_id = d.datasets_id
|
| 79 |
+
{where_clause}
|
| 80 |
+
ORDER BY {order_by}
|
| 81 |
+
LIMIT {limit}
|
| 82 |
+
"""
|
| 83 |
+
|
| 84 |
+
|
| 85 |
+
class MPRAQueries:
|
| 86 |
+
"""
|
| 87 |
+
Unified query interface for MPRAbase v4.9.3 SQLite database.
|
| 88 |
+
|
| 89 |
+
Provides both base functionality and v1.1-specific queries:
|
| 90 |
+
- Target fold-change queries
|
| 91 |
+
- Genomic region queries
|
| 92 |
+
- Extreme expression levels
|
| 93 |
+
- Strong repression queries
|
| 94 |
+
- Fine-grained logFC ranges
|
| 95 |
+
- Sequence length filtering
|
| 96 |
+
|
| 97 |
+
Attributes:
|
| 98 |
+
db_path (str): Path to MPRAbase SQLite database
|
| 99 |
+
conn (sqlite3.Connection): Active database connection
|
| 100 |
+
cursor (sqlite3.Cursor): Database cursor for queries
|
| 101 |
+
"""
|
| 102 |
+
|
| 103 |
+
def __init__(self, db_path: str = str(MPRA_DB)):
|
| 104 |
+
"""
|
| 105 |
+
Initialize MPRAQueries with database connection.
|
| 106 |
+
|
| 107 |
+
Args:
|
| 108 |
+
db_path (str): Path to mprabase_v4_9.3.db file
|
| 109 |
+
"""
|
| 110 |
+
self.db_path = db_path
|
| 111 |
+
self.conn = sqlite3.connect(db_path)
|
| 112 |
+
self.conn.row_factory = sqlite3.Row
|
| 113 |
+
self.cursor = self.conn.cursor()
|
| 114 |
+
|
| 115 |
+
def _execute_query(
|
| 116 |
+
self,
|
| 117 |
+
where_clause: str,
|
| 118 |
+
order_by: str = "ABS(es.score - 0.585) ASC",
|
| 119 |
+
limit: int = 50,
|
| 120 |
+
params: tuple = (),
|
| 121 |
+
) -> List[Dict[str, Any]]:
|
| 122 |
+
"""
|
| 123 |
+
DRY helper: Execute parameterized query and return results as dicts.
|
| 124 |
+
|
| 125 |
+
Args:
|
| 126 |
+
where_clause (str): SQL WHERE clause
|
| 127 |
+
order_by (str): SQL ORDER BY clause
|
| 128 |
+
limit (int): Maximum number of results
|
| 129 |
+
params (tuple): Parameters for parameterized query
|
| 130 |
+
|
| 131 |
+
Returns:
|
| 132 |
+
List[Dict[str, Any]]: Query results as dictionaries
|
| 133 |
+
"""
|
| 134 |
+
query = _BASE_ELEMENT_QUERY.format(
|
| 135 |
+
where_clause=where_clause,
|
| 136 |
+
order_by=order_by,
|
| 137 |
+
limit=limit,
|
| 138 |
+
)
|
| 139 |
+
self.cursor.execute(query, params)
|
| 140 |
+
return [dict(row) for row in self.cursor.fetchall()]
|
| 141 |
+
|
| 142 |
+
# ─────────────────────────────────────────────────────────────────
|
| 143 |
+
# BASE QUERIES (v1.0 compatibility)
|
| 144 |
+
# ─────────────────────────────────────────────────────────────────
|
| 145 |
+
|
| 146 |
+
def find_best_elements_for_target(
|
| 147 |
+
self,
|
| 148 |
+
target_logfc: float = 0.585,
|
| 149 |
+
cell_line: str = "HepG2",
|
| 150 |
+
tolerance: float = 0.1,
|
| 151 |
+
limit: int = 50,
|
| 152 |
+
) -> List[Dict[str, Any]]:
|
| 153 |
+
"""
|
| 154 |
+
Find MPRA elements with logFC closest to target within tolerance.
|
| 155 |
+
|
| 156 |
+
Core base query used for standard benchmark tasks (promoters, etc.).
|
| 157 |
+
|
| 158 |
+
Args:
|
| 159 |
+
target_logfc (float): Target log fold-change (e.g., 0.585 for 1.5×)
|
| 160 |
+
cell_line (str): Cell line/tissue (e.g., "HepG2", "K562")
|
| 161 |
+
tolerance (float): Acceptable deviation from target logFC
|
| 162 |
+
limit (int): Maximum number of results
|
| 163 |
+
|
| 164 |
+
Returns:
|
| 165 |
+
List[Dict[str, Any]]: Elements sorted by proximity to target logFC
|
| 166 |
+
|
| 167 |
+
Example:
|
| 168 |
+
>>> queries = MPRAQueries()
|
| 169 |
+
>>> elements = queries.find_best_elements_for_target(0.585, "HepG2", 0.1, 50)
|
| 170 |
+
"""
|
| 171 |
+
min_score = target_logfc - tolerance
|
| 172 |
+
max_score = target_logfc + tolerance
|
| 173 |
+
|
| 174 |
+
where_clause = (
|
| 175 |
+
"WHERE s.Cell_line_tissue = ? "
|
| 176 |
+
"AND es.score BETWEEN ? AND ?"
|
| 177 |
+
)
|
| 178 |
+
|
| 179 |
+
return self._execute_query(
|
| 180 |
+
where_clause=where_clause,
|
| 181 |
+
order_by=f"ABS(es.score - {target_logfc}) ASC",
|
| 182 |
+
limit=limit,
|
| 183 |
+
params=(cell_line, min_score, max_score),
|
| 184 |
+
)
|
| 185 |
+
|
| 186 |
+
def find_elements_by_region(
|
| 187 |
+
self,
|
| 188 |
+
chrom: str,
|
| 189 |
+
start: int,
|
| 190 |
+
end: int,
|
| 191 |
+
cell_line: str = "HepG2",
|
| 192 |
+
window_bp: int = 800,
|
| 193 |
+
) -> List[Dict[str, Any]]:
|
| 194 |
+
"""
|
| 195 |
+
Find MPRA elements overlapping a genomic region.
|
| 196 |
+
|
| 197 |
+
Note: element_coordinate field is often empty, so coordinates are
|
| 198 |
+
parsed from library_element_name using regex patterns.
|
| 199 |
+
|
| 200 |
+
Args:
|
| 201 |
+
chrom (str): Chromosome (e.g., "1", "X", "chrX")
|
| 202 |
+
start (int): Start position (bp)
|
| 203 |
+
end (int): End position (bp)
|
| 204 |
+
cell_line (str): Cell line (default: HepG2)
|
| 205 |
+
window_bp (int): Flanking window (default: 800)
|
| 206 |
+
|
| 207 |
+
Returns:
|
| 208 |
+
List[Dict[str, Any]]: Elements in genomic region
|
| 209 |
+
"""
|
| 210 |
+
chrom = str(chrom).lstrip("chr")
|
| 211 |
+
region_start = max(0, start - window_bp)
|
| 212 |
+
region_end = end + window_bp
|
| 213 |
+
|
| 214 |
+
where_clause = "WHERE s.Cell_line_tissue = ?"
|
| 215 |
+
|
| 216 |
+
results = self._execute_query(
|
| 217 |
+
where_clause=where_clause,
|
| 218 |
+
order_by="ABS(es.score - 0.585) ASC",
|
| 219 |
+
limit=500,
|
| 220 |
+
params=(cell_line,),
|
| 221 |
+
)
|
| 222 |
+
|
| 223 |
+
# Filter by parsed coordinates from library_element_name
|
| 224 |
+
filtered = []
|
| 225 |
+
for elem in results:
|
| 226 |
+
name = elem.get("library_element_name", "")
|
| 227 |
+
coords = self._parse_coordinates_from_name(name)
|
| 228 |
+
if coords:
|
| 229 |
+
elem_chrom, elem_start, elem_end = coords
|
| 230 |
+
if (str(elem_chrom).lstrip("chr") == chrom and
|
| 231 |
+
elem_start <= region_end and elem_end >= region_start):
|
| 232 |
+
filtered.append(elem)
|
| 233 |
+
|
| 234 |
+
return filtered
|
| 235 |
+
|
| 236 |
+
# ─────────────────────────────────────────────────────────────────
|
| 237 |
+
# EXTENDED QUERIES (v1.1 benchmark)
|
| 238 |
+
# ─────────────────────────────────────────────────────────────────
|
| 239 |
+
|
| 240 |
+
def find_extreme_logfc(
|
| 241 |
+
self,
|
| 242 |
+
cell_line: str = "HepG2",
|
| 243 |
+
target_logfc: float = 1.585,
|
| 244 |
+
tolerance: float = 0.2,
|
| 245 |
+
limit: int = 20,
|
| 246 |
+
) -> List[Dict[str, Any]]:
|
| 247 |
+
"""
|
| 248 |
+
Find elements with extreme fold-changes (ultra-hard 3× tasks).
|
| 249 |
+
|
| 250 |
+
Args:
|
| 251 |
+
cell_line (str): Cell line (default: HepG2)
|
| 252 |
+
target_logfc (float): Target logFC (1.585 ≈ 3×), default: 1.585
|
| 253 |
+
tolerance (float): Allowed deviation, default: 0.2
|
| 254 |
+
limit (int): Max results, default: 20
|
| 255 |
+
|
| 256 |
+
Returns:
|
| 257 |
+
List[Dict[str, Any]]: Elements with high fold-changes, sorted desc by logFC
|
| 258 |
+
"""
|
| 259 |
+
min_score = target_logfc - tolerance
|
| 260 |
+
where_clause = "WHERE s.Cell_line_tissue = ? AND es.score >= ?"
|
| 261 |
+
|
| 262 |
+
return self._execute_query(
|
| 263 |
+
where_clause=where_clause,
|
| 264 |
+
order_by="es.score DESC",
|
| 265 |
+
limit=limit,
|
| 266 |
+
params=(cell_line, min_score),
|
| 267 |
+
)
|
| 268 |
+
|
| 269 |
+
def find_strong_repressors(
|
| 270 |
+
self,
|
| 271 |
+
cell_line: str = "HepG2",
|
| 272 |
+
target_logfc: float = -1.0,
|
| 273 |
+
tolerance: float = 0.3,
|
| 274 |
+
limit: int = 20,
|
| 275 |
+
) -> List[Dict[str, Any]]:
|
| 276 |
+
"""
|
| 277 |
+
Find strongly repressive elements (negative case tasks).
|
| 278 |
+
|
| 279 |
+
Args:
|
| 280 |
+
cell_line (str): Cell line (default: HepG2)
|
| 281 |
+
target_logfc (float): Target logFC (-1.0 ≈ 0.5×), default: -1.0
|
| 282 |
+
tolerance (float): Allowed deviation, default: 0.3
|
| 283 |
+
limit (int): Max results, default: 20
|
| 284 |
+
|
| 285 |
+
Returns:
|
| 286 |
+
List[Dict[str, Any]]: Repressive elements, sorted asc by logFC
|
| 287 |
+
"""
|
| 288 |
+
max_score = target_logfc + tolerance
|
| 289 |
+
where_clause = "WHERE s.Cell_line_tissue = ? AND es.score <= ?"
|
| 290 |
+
|
| 291 |
+
return self._execute_query(
|
| 292 |
+
where_clause=where_clause,
|
| 293 |
+
order_by="es.score ASC",
|
| 294 |
+
limit=limit,
|
| 295 |
+
params=(cell_line, max_score),
|
| 296 |
+
)
|
| 297 |
+
|
| 298 |
+
def find_by_logfc_range(
|
| 299 |
+
self,
|
| 300 |
+
cell_line: str = "HepG2",
|
| 301 |
+
min_logfc: float = -0.5,
|
| 302 |
+
max_logfc: float = 0.3,
|
| 303 |
+
limit: int = 20,
|
| 304 |
+
) -> List[Dict[str, Any]]:
|
| 305 |
+
"""
|
| 306 |
+
Find elements in specific logFC range (gradient/fine-tune tasks).
|
| 307 |
+
|
| 308 |
+
Args:
|
| 309 |
+
cell_line (str): Cell line (default: HepG2)
|
| 310 |
+
min_logfc (float): Minimum logFC, default: -0.5
|
| 311 |
+
max_logfc (float): Maximum logFC, default: 0.3
|
| 312 |
+
limit (int): Max results, default: 20
|
| 313 |
+
|
| 314 |
+
Returns:
|
| 315 |
+
List[Dict[str, Any]]: Elements in range, randomly ordered
|
| 316 |
+
"""
|
| 317 |
+
where_clause = "WHERE s.Cell_line_tissue = ? AND es.score BETWEEN ? AND ?"
|
| 318 |
+
|
| 319 |
+
return self._execute_query(
|
| 320 |
+
where_clause=where_clause,
|
| 321 |
+
order_by="RANDOM()",
|
| 322 |
+
limit=limit,
|
| 323 |
+
params=(cell_line, min_logfc, max_logfc),
|
| 324 |
+
)
|
| 325 |
+
|
| 326 |
+
def find_large_sequences(
|
| 327 |
+
self,
|
| 328 |
+
cell_line: str = "HepG2",
|
| 329 |
+
min_length: int = 800,
|
| 330 |
+
target_logfc: float = 0.585,
|
| 331 |
+
tolerance: float = 0.1,
|
| 332 |
+
limit: int = 20,
|
| 333 |
+
) -> List[Dict[str, Any]]:
|
| 334 |
+
"""
|
| 335 |
+
Find larger sequences for enhancer/long-range tasks.
|
| 336 |
+
|
| 337 |
+
Args:
|
| 338 |
+
cell_line (str): Cell line (default: HepG2)
|
| 339 |
+
min_length (int): Minimum sequence length in bp, default: 800
|
| 340 |
+
target_logfc (float): Target logFC, default: 0.585
|
| 341 |
+
tolerance (float): Allowed logFC deviation, default: 0.1
|
| 342 |
+
limit (int): Max results, default: 20
|
| 343 |
+
|
| 344 |
+
Returns:
|
| 345 |
+
List[Dict[str, Any]]: Large sequences close to target logFC
|
| 346 |
+
"""
|
| 347 |
+
min_logfc = target_logfc - tolerance
|
| 348 |
+
max_logfc = target_logfc + tolerance
|
| 349 |
+
|
| 350 |
+
where_clause = (
|
| 351 |
+
"WHERE s.Cell_line_tissue = ? "
|
| 352 |
+
"AND LENGTH(ls.sequence) >= ? "
|
| 353 |
+
"AND es.score BETWEEN ? AND ?"
|
| 354 |
+
)
|
| 355 |
+
|
| 356 |
+
return self._execute_query(
|
| 357 |
+
where_clause=where_clause,
|
| 358 |
+
order_by=f"ABS(es.score - {target_logfc}) ASC",
|
| 359 |
+
limit=limit,
|
| 360 |
+
params=(cell_line, min_length, min_logfc, max_logfc),
|
| 361 |
+
)
|
| 362 |
+
|
| 363 |
+
def get_score_extremes(self, cell_line: str = "HepG2") -> Dict[str, Any]:
|
| 364 |
+
"""
|
| 365 |
+
Get min/max/mean of logFC for data quality sanity checks.
|
| 366 |
+
|
| 367 |
+
Args:
|
| 368 |
+
cell_line (str): Cell line (default: HepG2)
|
| 369 |
+
|
| 370 |
+
Returns:
|
| 371 |
+
Dict: min_score, max_score, mean_score, total count
|
| 372 |
+
"""
|
| 373 |
+
query = """
|
| 374 |
+
SELECT
|
| 375 |
+
MIN(es.score) as min_score,
|
| 376 |
+
MAX(es.score) as max_score,
|
| 377 |
+
AVG(es.score) as mean_score,
|
| 378 |
+
COUNT(*) as total
|
| 379 |
+
FROM element_score es
|
| 380 |
+
JOIN sample s ON es.sample_id = s.sample_id
|
| 381 |
+
WHERE s.Cell_line_tissue = ?
|
| 382 |
+
"""
|
| 383 |
+
|
| 384 |
+
self.cursor.execute(query, (cell_line,))
|
| 385 |
+
row = self.cursor.fetchone()
|
| 386 |
+
|
| 387 |
+
return {
|
| 388 |
+
"min": row["min_score"],
|
| 389 |
+
"max": row["max_score"],
|
| 390 |
+
"mean": row["mean_score"],
|
| 391 |
+
"count": row["total"],
|
| 392 |
+
}
|
| 393 |
+
|
| 394 |
+
# ─────────────────────────────────────────────────────────────────
|
| 395 |
+
# UTILITY METHODS
|
| 396 |
+
# ─────────────────────────────────────────────────────────────────
|
| 397 |
+
|
| 398 |
+
@staticmethod
|
| 399 |
+
def _parse_coordinates_from_name(element_name: str) -> Optional[tuple]:
|
| 400 |
+
"""
|
| 401 |
+
Parse genomic coordinates from library_element_name.
|
| 402 |
+
|
| 403 |
+
Handles patterns:
|
| 404 |
+
- "hg19:chr1:123456-789012:..."
|
| 405 |
+
- "A:promoter_chr2:456789-567890_..."
|
| 406 |
+
|
| 407 |
+
Args:
|
| 408 |
+
element_name (str): Element name from MPRA database
|
| 409 |
+
|
| 410 |
+
Returns:
|
| 411 |
+
tuple: (chrom, start, end) or None if unparseable
|
| 412 |
+
"""
|
| 413 |
+
if not element_name:
|
| 414 |
+
return None
|
| 415 |
+
|
| 416 |
+
# Try pattern: "hg##:chr#:start-end..."
|
| 417 |
+
match = re.search(r'hg\d+:chr(\d+|\w+):(\d+)-(\d+)', element_name)
|
| 418 |
+
if match:
|
| 419 |
+
return match.group(1), int(match.group(2)), int(match.group(3))
|
| 420 |
+
|
| 421 |
+
# Try pattern: "_chr#:start-end_"
|
| 422 |
+
match = re.search(r'_chr(\d+|\w+):(\d+)-(\d+)_', element_name)
|
| 423 |
+
if match:
|
| 424 |
+
return match.group(1), int(match.group(2)), int(match.group(3))
|
| 425 |
+
|
| 426 |
+
return None
|
| 427 |
+
|
| 428 |
+
def close(self):
|
| 429 |
+
"""Close database connection."""
|
| 430 |
+
self.conn.close()
|
| 431 |
+
|
| 432 |
+
|
| 433 |
+
if __name__ == "__main__":
|
| 434 |
+
# Quick tests
|
| 435 |
+
queries = MPRAQueries()
|
| 436 |
+
|
| 437 |
+
print("=== Score Distribution (HepG2) ===")
|
| 438 |
+
stats = queries.get_score_extremes("HepG2")
|
| 439 |
+
print(f"Range: {stats['min']:.2f} to {stats['max']:.2f}, Mean: {stats['mean']:.2f}, Count: {stats['count']}")
|
| 440 |
+
|
| 441 |
+
print("\n=== Ultra-hard 3× (logFC ~1.585) ===")
|
| 442 |
+
extreme = queries.find_extreme_logfc("HepG2", 1.585, limit=3)
|
| 443 |
+
for e in extreme:
|
| 444 |
+
print(f" {e['sample_name']}: logFC={e['logfc']:.3f}, len={e['tile_length']}bp")
|
| 445 |
+
|
| 446 |
+
print("\n=== Strong Repressors (<-1.0) ===")
|
| 447 |
+
repressors = queries.find_strong_repressors("HepG2", -1.0, limit=3)
|
| 448 |
+
for r in repressors:
|
| 449 |
+
print(f" {r['sample_name']}: logFC={r['logfc']:.3f}")
|
| 450 |
+
|
| 451 |
+
print("\n=== Large Sequences (>800bp) ===")
|
| 452 |
+
large = queries.find_large_sequences("HepG2", 800, 0.585, limit=3)
|
| 453 |
+
for l in large:
|
| 454 |
+
print(f" {l['sample_name']}: len={l['tile_length']}bp")
|
| 455 |
+
|
| 456 |
+
queries.close()
|
scripts/score.py
ADDED
|
@@ -0,0 +1,505 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env python3
|
| 2 |
+
"""
|
| 3 |
+
score.py: Tier-aware scoring engine for DNA-World-Tiny benchmark.
|
| 4 |
+
|
| 5 |
+
Implements specialized scoring systems for 5 regulatory element types, each with
|
| 6 |
+
different metric weights optimized for element characteristics:
|
| 7 |
+
|
| 8 |
+
Scoring by Tier:
|
| 9 |
+
1. Promoter (0.6 ED + 0.3 logFC + 0.1 Motif)
|
| 10 |
+
- Sequence-critical: Tight edit distance requirements
|
| 11 |
+
- Standard baseline metrics for core regulatory elements
|
| 12 |
+
|
| 13 |
+
2. Enhancer (0.4 ED + 0.4 logFC + 0.2 Motif)
|
| 14 |
+
- Balanced function: Both sequence and expression equally weighted
|
| 15 |
+
- More lenient on sequence variation than promoters
|
| 16 |
+
|
| 17 |
+
3. Long-Range (0.3 ED + 0.5 logFC + 0.2 Motif)
|
| 18 |
+
- Function-primary: logFC is the dominant metric
|
| 19 |
+
- Allows more sequence flexibility for distal elements
|
| 20 |
+
|
| 21 |
+
4. Negative (0.33 ED + 0.33 logFC + 0.33 Motif) — INVERTED
|
| 22 |
+
- Opposite goal: Want REPRESSION, not activation
|
| 23 |
+
- Penalizes incorrect high expression predictions
|
| 24 |
+
|
| 25 |
+
5. Gradient (0.7 ED + 0.25 logFC + 0.05 Motif)
|
| 26 |
+
- Precision-critical: Very tight edit distance tolerances
|
| 27 |
+
- For fine-tuning and subtle expression adjustments
|
| 28 |
+
|
| 29 |
+
Metrics Used:
|
| 30 |
+
- Edit Distance: Normalized Levenshtein distance to target sequence
|
| 31 |
+
- logFC Match: Absolute error in log fold-change prediction
|
| 32 |
+
- Motif Enrichment: Fraction of expected TF binding sites found
|
| 33 |
+
- Validity: DNA sequence must be valid ACGT
|
| 34 |
+
|
| 35 |
+
Usage:
|
| 36 |
+
from score import score_benchmark, print_results
|
| 37 |
+
|
| 38 |
+
results = score_benchmark(
|
| 39 |
+
Path("bench_dna_tiny_v1_1/dna_world_tiny_v1_1.jsonl"),
|
| 40 |
+
Path("predictions.jsonl")
|
| 41 |
+
)
|
| 42 |
+
|
| 43 |
+
print_results(results) # Display per-tier, per-challenge stats
|
| 44 |
+
|
| 45 |
+
Output: Per-tier metrics, per-challenge breakdown, overall score (0.0–1.0)
|
| 46 |
+
"""
|
| 47 |
+
|
| 48 |
+
import json
|
| 49 |
+
from pathlib import Path
|
| 50 |
+
from typing import Dict, Any, List, Tuple
|
| 51 |
+
import re
|
| 52 |
+
from collections import defaultdict
|
| 53 |
+
|
| 54 |
+
|
| 55 |
+
def normalize_dna(seq: str) -> str:
|
| 56 |
+
"""Normalize DNA sequence (uppercase, remove whitespace)"""
|
| 57 |
+
return ''.join(seq.upper().split())
|
| 58 |
+
|
| 59 |
+
|
| 60 |
+
def edit_distance(s1: str, s2: str) -> int:
|
| 61 |
+
"""Calculate Levenshtein edit distance"""
|
| 62 |
+
s1, s2 = normalize_dna(s1), normalize_dna(s2)
|
| 63 |
+
|
| 64 |
+
if len(s1) < len(s2):
|
| 65 |
+
return edit_distance(s2, s1)
|
| 66 |
+
|
| 67 |
+
if len(s2) == 0:
|
| 68 |
+
return len(s1)
|
| 69 |
+
|
| 70 |
+
prev_row = range(len(s2) + 1)
|
| 71 |
+
for i, c1 in enumerate(s1):
|
| 72 |
+
curr_row = [i + 1]
|
| 73 |
+
for j, c2 in enumerate(s2):
|
| 74 |
+
insertions = prev_row[j + 1] + 1
|
| 75 |
+
deletions = curr_row[j] + 1
|
| 76 |
+
substitutions = prev_row[j] + (c1 != c2)
|
| 77 |
+
curr_row.append(min(insertions, deletions, substitutions))
|
| 78 |
+
prev_row = curr_row
|
| 79 |
+
|
| 80 |
+
return prev_row[-1]
|
| 81 |
+
|
| 82 |
+
|
| 83 |
+
def normalized_edit_distance(seq_pred: str, seq_real: str) -> float:
|
| 84 |
+
"""Edit distance normalized by length (0-1)"""
|
| 85 |
+
seq_pred = normalize_dna(seq_pred)
|
| 86 |
+
seq_real = normalize_dna(seq_real)
|
| 87 |
+
|
| 88 |
+
max_len = max(len(seq_pred), len(seq_real))
|
| 89 |
+
if max_len == 0:
|
| 90 |
+
return 0.0
|
| 91 |
+
|
| 92 |
+
ed = edit_distance(seq_pred, seq_real)
|
| 93 |
+
return min(1.0, ed / max_len)
|
| 94 |
+
|
| 95 |
+
|
| 96 |
+
def logfc_match_error(logfc_pred: float, logfc_real: float) -> float:
|
| 97 |
+
"""logFC prediction error (0-1, lower is better)"""
|
| 98 |
+
diff = abs(logfc_pred - logfc_real)
|
| 99 |
+
# Scale: 0.1 error = 0.1, 0.5 error = 0.5, >1.0 = 1.0
|
| 100 |
+
return min(1.0, diff)
|
| 101 |
+
|
| 102 |
+
|
| 103 |
+
def is_valid_dna(seq: str) -> bool:
|
| 104 |
+
"""Check if sequence is valid DNA"""
|
| 105 |
+
seq = normalize_dna(seq)
|
| 106 |
+
valid_bases = set('ACGT')
|
| 107 |
+
return all(base in valid_bases for base in seq) and len(seq) > 0
|
| 108 |
+
|
| 109 |
+
|
| 110 |
+
def motif_enrichment(seq: str, expected_motifs: List[str]) -> float:
|
| 111 |
+
"""Fraction of expected motifs found (0-1)"""
|
| 112 |
+
seq = normalize_dna(seq)
|
| 113 |
+
|
| 114 |
+
if not expected_motifs:
|
| 115 |
+
return 1.0
|
| 116 |
+
|
| 117 |
+
found = 0
|
| 118 |
+
for motif in expected_motifs:
|
| 119 |
+
if motif in seq or motif.upper() in seq:
|
| 120 |
+
found += 1
|
| 121 |
+
|
| 122 |
+
return found / len(expected_motifs)
|
| 123 |
+
|
| 124 |
+
|
| 125 |
+
def score_promoter_tier(task: Dict, prediction: Dict) -> Dict[str, Any]:
|
| 126 |
+
"""
|
| 127 |
+
Score promoter tasks: Standard 0.6 edit + 0.3 logFC + 0.1 motif
|
| 128 |
+
"""
|
| 129 |
+
pred_seq = prediction.get("sequence", "")
|
| 130 |
+
real_seq = task.get("target_sequence_real", "")
|
| 131 |
+
pred_logfc = prediction.get("logfc", 0.0)
|
| 132 |
+
real_logfc = task.get("target_logfc_actual", task.get("target_logfc", 0.585))
|
| 133 |
+
|
| 134 |
+
# Validity check
|
| 135 |
+
valid = is_valid_dna(pred_seq)
|
| 136 |
+
if not valid:
|
| 137 |
+
return {"score": 0.0, "valid": False, "reason": "Invalid DNA sequence"}
|
| 138 |
+
|
| 139 |
+
# Edit distance component
|
| 140 |
+
ed_norm = normalized_edit_distance(pred_seq, real_seq)
|
| 141 |
+
ed_score = 1.0 - ed_norm # Inverted: lower ED = higher score
|
| 142 |
+
|
| 143 |
+
# logFC match component
|
| 144 |
+
logfc_err = logfc_match_error(pred_logfc, real_logfc)
|
| 145 |
+
logfc_score = max(0.0, 1.0 - logfc_err * 2) # More lenient tolerance
|
| 146 |
+
|
| 147 |
+
# Motif enrichment component
|
| 148 |
+
motifs = task.get("motifs_hint", [])
|
| 149 |
+
motif_score = motif_enrichment(pred_seq, motifs)
|
| 150 |
+
|
| 151 |
+
# Weighted combination
|
| 152 |
+
tier_weights = task.get("evaluation_config", {}).get("tier_weights", [0.6, 0.3, 0.1])
|
| 153 |
+
w_ed, w_logfc, w_motif = tier_weights
|
| 154 |
+
|
| 155 |
+
composite_score = w_ed * ed_score + w_logfc * logfc_score + w_motif * motif_score
|
| 156 |
+
|
| 157 |
+
return {
|
| 158 |
+
"score": composite_score,
|
| 159 |
+
"valid": valid,
|
| 160 |
+
"components": {
|
| 161 |
+
"edit_distance": ed_score,
|
| 162 |
+
"logfc_match": logfc_score,
|
| 163 |
+
"motif_enrichment": motif_score,
|
| 164 |
+
},
|
| 165 |
+
"metrics": {
|
| 166 |
+
"edit_distance_normalized": ed_norm,
|
| 167 |
+
"logfc_error": logfc_err,
|
| 168 |
+
"motif_fraction": motif_score,
|
| 169 |
+
}
|
| 170 |
+
}
|
| 171 |
+
|
| 172 |
+
|
| 173 |
+
def score_enhancer_tier(task: Dict, prediction: Dict) -> Dict[str, Any]:
|
| 174 |
+
"""
|
| 175 |
+
Score enhancer tasks: Looser 0.4 edit + 0.4 logFC + 0.2 motif
|
| 176 |
+
Enhancers are larger and more flexible in sequence
|
| 177 |
+
"""
|
| 178 |
+
pred_seq = prediction.get("sequence", "")
|
| 179 |
+
real_seq = task.get("target_sequence_real", "")
|
| 180 |
+
pred_logfc = prediction.get("logfc", 0.0)
|
| 181 |
+
real_logfc = task.get("target_logfc_actual", task.get("target_logfc", 0.585))
|
| 182 |
+
|
| 183 |
+
valid = is_valid_dna(pred_seq)
|
| 184 |
+
if not valid:
|
| 185 |
+
return {"score": 0.0, "valid": False, "reason": "Invalid DNA sequence"}
|
| 186 |
+
|
| 187 |
+
# More lenient edit distance (only ~40% contribution)
|
| 188 |
+
ed_norm = normalized_edit_distance(pred_seq, real_seq)
|
| 189 |
+
ed_score = 1.0 - (ed_norm * 0.5) # Accept up to 50% edit distance
|
| 190 |
+
|
| 191 |
+
# logFC is equally important
|
| 192 |
+
logfc_err = logfc_match_error(pred_logfc, real_logfc)
|
| 193 |
+
logfc_score = max(0.0, 1.0 - logfc_err * 1.5)
|
| 194 |
+
|
| 195 |
+
# Motif enrichment
|
| 196 |
+
motifs = task.get("motifs_hint", [])
|
| 197 |
+
motif_score = motif_enrichment(pred_seq, motifs)
|
| 198 |
+
|
| 199 |
+
tier_weights = [0.4, 0.4, 0.2]
|
| 200 |
+
w_ed, w_logfc, w_motif = tier_weights
|
| 201 |
+
|
| 202 |
+
composite_score = w_ed * ed_score + w_logfc * logfc_score + w_motif * motif_score
|
| 203 |
+
|
| 204 |
+
return {
|
| 205 |
+
"score": composite_score,
|
| 206 |
+
"valid": valid,
|
| 207 |
+
"components": {
|
| 208 |
+
"edit_distance": ed_score,
|
| 209 |
+
"logfc_match": logfc_score,
|
| 210 |
+
"motif_enrichment": motif_score,
|
| 211 |
+
},
|
| 212 |
+
"metrics": {
|
| 213 |
+
"edit_distance_normalized": ed_norm,
|
| 214 |
+
"logfc_error": logfc_err,
|
| 215 |
+
"motif_fraction": motif_score,
|
| 216 |
+
}
|
| 217 |
+
}
|
| 218 |
+
|
| 219 |
+
|
| 220 |
+
def score_longrange_tier(task: Dict, prediction: Dict) -> Dict[str, Any]:
|
| 221 |
+
"""
|
| 222 |
+
Score long-range tasks: Function-focused 0.3 coarse + 0.5 logFC + 0.2 motif
|
| 223 |
+
Long-range elements are evaluated more on function than sequence identity
|
| 224 |
+
"""
|
| 225 |
+
pred_seq = prediction.get("sequence", "")
|
| 226 |
+
real_seq = task.get("target_sequence_real", "")
|
| 227 |
+
pred_logfc = prediction.get("logfc", 0.0)
|
| 228 |
+
real_logfc = task.get("target_logfc_actual", task.get("target_logfc", 0.585))
|
| 229 |
+
|
| 230 |
+
valid = is_valid_dna(pred_seq)
|
| 231 |
+
if not valid:
|
| 232 |
+
return {"score": 0.0, "valid": False, "reason": "Invalid DNA sequence"}
|
| 233 |
+
|
| 234 |
+
# Coarse sequence similarity (only 30% contribution)
|
| 235 |
+
# For long-range, sequence can vary more, just check broad regions
|
| 236 |
+
ed_norm = normalized_edit_distance(pred_seq, real_seq)
|
| 237 |
+
ed_score = 1.0 - (ed_norm * 0.3) # Very lenient
|
| 238 |
+
|
| 239 |
+
# logFC is primary metric (50% contribution)
|
| 240 |
+
logfc_err = logfc_match_error(pred_logfc, real_logfc)
|
| 241 |
+
logfc_score = max(0.0, 1.0 - logfc_err) # Strict on function
|
| 242 |
+
|
| 243 |
+
# Motif enrichment
|
| 244 |
+
motifs = task.get("motifs_hint", [])
|
| 245 |
+
motif_score = motif_enrichment(pred_seq, motifs)
|
| 246 |
+
|
| 247 |
+
tier_weights = [0.3, 0.5, 0.2]
|
| 248 |
+
w_ed, w_logfc, w_motif = tier_weights
|
| 249 |
+
|
| 250 |
+
composite_score = w_ed * ed_score + w_logfc * logfc_score + w_motif * motif_score
|
| 251 |
+
|
| 252 |
+
return {
|
| 253 |
+
"score": composite_score,
|
| 254 |
+
"valid": valid,
|
| 255 |
+
"components": {
|
| 256 |
+
"coarse_sequence_sim": ed_score,
|
| 257 |
+
"logfc_match": logfc_score,
|
| 258 |
+
"motif_enrichment": motif_score,
|
| 259 |
+
},
|
| 260 |
+
"metrics": {
|
| 261 |
+
"edit_distance_normalized": ed_norm,
|
| 262 |
+
"logfc_error": logfc_err,
|
| 263 |
+
"motif_fraction": motif_score,
|
| 264 |
+
}
|
| 265 |
+
}
|
| 266 |
+
|
| 267 |
+
|
| 268 |
+
def score_negative_tier(task: Dict, prediction: Dict) -> Dict[str, Any]:
|
| 269 |
+
"""
|
| 270 |
+
Score negative tasks: INVERSE scoring (want REPRESSION, not activation)
|
| 271 |
+
logFC should be negative/low, NOT high
|
| 272 |
+
"""
|
| 273 |
+
pred_seq = prediction.get("sequence", "")
|
| 274 |
+
real_seq = task.get("target_sequence_real", "")
|
| 275 |
+
pred_logfc = prediction.get("logfc", 0.0)
|
| 276 |
+
real_logfc = task.get("target_logfc", -1.0) # Negative = repressed
|
| 277 |
+
|
| 278 |
+
valid = is_valid_dna(pred_seq)
|
| 279 |
+
if not valid:
|
| 280 |
+
return {"score": 0.0, "valid": False, "reason": "Invalid DNA sequence"}
|
| 281 |
+
|
| 282 |
+
# For negatives, sequence matching matters (preserve failure mode)
|
| 283 |
+
ed_norm = normalized_edit_distance(pred_seq, real_seq)
|
| 284 |
+
ed_score = 1.0 - ed_norm
|
| 285 |
+
|
| 286 |
+
# INVERSE logFC: We WANT repression (negative or low values)
|
| 287 |
+
# Penalize if model predicts high activation
|
| 288 |
+
logfc_err = logfc_match_error(pred_logfc, real_logfc)
|
| 289 |
+
# Invert: if pred is too high (activation), low score
|
| 290 |
+
logfc_score = max(0.0, 1.0 - abs(pred_logfc - real_logfc) * 0.5)
|
| 291 |
+
if pred_logfc > 0.5: # Model predicts activation when we want repression
|
| 292 |
+
logfc_score *= 0.5
|
| 293 |
+
|
| 294 |
+
# Motif component (check absence of activators)
|
| 295 |
+
motifs = task.get("motifs_hint", [])
|
| 296 |
+
motif_score = 1.0 - motif_enrichment(pred_seq, motifs) # INVERSE
|
| 297 |
+
|
| 298 |
+
# Simple average for negatives
|
| 299 |
+
composite_score = (ed_score + logfc_score + motif_score) / 3.0
|
| 300 |
+
|
| 301 |
+
return {
|
| 302 |
+
"score": composite_score,
|
| 303 |
+
"valid": valid,
|
| 304 |
+
"negative": True,
|
| 305 |
+
"components": {
|
| 306 |
+
"failure_mode_preserved": ed_score,
|
| 307 |
+
"repression_achieved": logfc_score,
|
| 308 |
+
"activator_absence": motif_score,
|
| 309 |
+
},
|
| 310 |
+
"metrics": {
|
| 311 |
+
"edit_distance_normalized": ed_norm,
|
| 312 |
+
"logfc_repression": pred_logfc,
|
| 313 |
+
"activator_fraction": 1.0 - motif_score,
|
| 314 |
+
}
|
| 315 |
+
}
|
| 316 |
+
|
| 317 |
+
|
| 318 |
+
def score_gradient_tier(task: Dict, prediction: Dict) -> Dict[str, Any]:
|
| 319 |
+
"""
|
| 320 |
+
Score gradient/fine-tuning tasks: Tight tolerances 0.7 edit + 0.25 logFC + 0.05 motif
|
| 321 |
+
These require precise adjustments
|
| 322 |
+
"""
|
| 323 |
+
pred_seq = prediction.get("sequence", "")
|
| 324 |
+
real_seq = task.get("target_sequence_real", "")
|
| 325 |
+
pred_logfc = prediction.get("logfc", 0.0)
|
| 326 |
+
real_logfc = task.get("target_logfc_actual", task.get("target_logfc", 0.322))
|
| 327 |
+
|
| 328 |
+
valid = is_valid_dna(pred_seq)
|
| 329 |
+
if not valid:
|
| 330 |
+
return {"score": 0.0, "valid": False, "reason": "Invalid DNA sequence"}
|
| 331 |
+
|
| 332 |
+
# Edit distance is primary (70% - precision is key)
|
| 333 |
+
ed_norm = normalized_edit_distance(pred_seq, real_seq)
|
| 334 |
+
ed_score = 1.0 - ed_norm
|
| 335 |
+
|
| 336 |
+
# logFC precision (25% - but strict tolerance)
|
| 337 |
+
logfc_err = logfc_match_error(pred_logfc, real_logfc)
|
| 338 |
+
logfc_score = max(0.0, 1.0 - logfc_err * 3) # 3x penalty for error
|
| 339 |
+
|
| 340 |
+
# Motif conservation (5%)
|
| 341 |
+
motifs = task.get("motifs_hint", [])
|
| 342 |
+
motif_score = motif_enrichment(pred_seq, motifs)
|
| 343 |
+
|
| 344 |
+
tier_weights = [0.7, 0.25, 0.05]
|
| 345 |
+
w_ed, w_logfc, w_motif = tier_weights
|
| 346 |
+
|
| 347 |
+
composite_score = w_ed * ed_score + w_logfc * logfc_score + w_motif * motif_score
|
| 348 |
+
|
| 349 |
+
return {
|
| 350 |
+
"score": composite_score,
|
| 351 |
+
"valid": valid,
|
| 352 |
+
"precision_required": True,
|
| 353 |
+
"components": {
|
| 354 |
+
"sequence_precision": ed_score,
|
| 355 |
+
"logfc_precision": logfc_score,
|
| 356 |
+
"motif_conservation": motif_score,
|
| 357 |
+
},
|
| 358 |
+
"metrics": {
|
| 359 |
+
"edit_distance_normalized": ed_norm,
|
| 360 |
+
"logfc_error": logfc_err,
|
| 361 |
+
"motif_fraction": motif_score,
|
| 362 |
+
}
|
| 363 |
+
}
|
| 364 |
+
|
| 365 |
+
|
| 366 |
+
def score_task(task: Dict, prediction: Dict) -> Dict[str, Any]:
|
| 367 |
+
"""
|
| 368 |
+
Route to appropriate scorer based on tier
|
| 369 |
+
"""
|
| 370 |
+
tier = task.get("metadata", {}).get("tier", "promoter")
|
| 371 |
+
|
| 372 |
+
if tier == "promoter":
|
| 373 |
+
return score_promoter_tier(task, prediction)
|
| 374 |
+
elif tier == "enhancer":
|
| 375 |
+
return score_enhancer_tier(task, prediction)
|
| 376 |
+
elif tier == "long_range":
|
| 377 |
+
return score_longrange_tier(task, prediction)
|
| 378 |
+
elif tier == "negative":
|
| 379 |
+
return score_negative_tier(task, prediction)
|
| 380 |
+
elif tier == "gradient":
|
| 381 |
+
return score_gradient_tier(task, prediction)
|
| 382 |
+
else:
|
| 383 |
+
# Default to promoter scoring
|
| 384 |
+
return score_promoter_tier(task, prediction)
|
| 385 |
+
|
| 386 |
+
|
| 387 |
+
def score_benchmark(tasks_path: Path, predictions_path: Path) -> Dict[str, Any]:
|
| 388 |
+
"""
|
| 389 |
+
Score all predictions against benchmark
|
| 390 |
+
Returns: per-task scores, per-tier stats, overall metrics
|
| 391 |
+
"""
|
| 392 |
+
|
| 393 |
+
# Load tasks
|
| 394 |
+
tasks = {}
|
| 395 |
+
with open(tasks_path) as f:
|
| 396 |
+
for line in f:
|
| 397 |
+
task = json.loads(line)
|
| 398 |
+
tasks[task["id"]] = task
|
| 399 |
+
|
| 400 |
+
# Load predictions - can be keyed by id OR task_id
|
| 401 |
+
predictions_by_id = {}
|
| 402 |
+
predictions_by_task_id = {}
|
| 403 |
+
with open(predictions_path) as f:
|
| 404 |
+
for line in f:
|
| 405 |
+
pred = json.loads(line)
|
| 406 |
+
pred_id = pred.get("id", pred.get("task_id"))
|
| 407 |
+
predictions_by_id[pred_id] = pred
|
| 408 |
+
if "task_id" in pred:
|
| 409 |
+
predictions_by_task_id[pred["task_id"]] = pred
|
| 410 |
+
|
| 411 |
+
# Score
|
| 412 |
+
results = {
|
| 413 |
+
"overall": {"total": 0, "valid": 0, "mean_score": 0.0, "std_score": 0.0},
|
| 414 |
+
"by_tier": defaultdict(lambda: {"count": 0, "total_score": 0.0, "mean": 0.0, "valid": 0}),
|
| 415 |
+
"by_challenge": defaultdict(lambda: {"count": 0, "total_score": 0.0, "mean": 0.0}),
|
| 416 |
+
"tasks": {}
|
| 417 |
+
}
|
| 418 |
+
|
| 419 |
+
scores = []
|
| 420 |
+
|
| 421 |
+
for task_id, task in tasks.items():
|
| 422 |
+
# Try to find prediction - first by UUID, then by semantic task_id
|
| 423 |
+
pred = predictions_by_id.get(task_id) or predictions_by_task_id.get(task.get("task_id"))
|
| 424 |
+
|
| 425 |
+
if not pred:
|
| 426 |
+
pred = {} # Empty prediction = 0 score
|
| 427 |
+
|
| 428 |
+
score_result = score_task(task, pred)
|
| 429 |
+
score_result["task_id"] = task_id
|
| 430 |
+
score_result["task_name"] = task.get("task_id", "unknown")
|
| 431 |
+
score_result["tier"] = task.get("metadata", {}).get("tier", "unknown")
|
| 432 |
+
score_result["challenge"] = task.get("metadata", {}).get("challenge_level", "unknown")
|
| 433 |
+
|
| 434 |
+
results["tasks"][task_id] = score_result
|
| 435 |
+
|
| 436 |
+
# Aggregate stats
|
| 437 |
+
score = score_result.get("score", 0.0)
|
| 438 |
+
scores.append(score)
|
| 439 |
+
|
| 440 |
+
tier = score_result["tier"]
|
| 441 |
+
results["by_tier"][tier]["count"] += 1
|
| 442 |
+
results["by_tier"][tier]["total_score"] += score
|
| 443 |
+
if score_result.get("valid", False):
|
| 444 |
+
results["by_tier"][tier]["valid"] += 1
|
| 445 |
+
|
| 446 |
+
challenge = score_result["challenge"]
|
| 447 |
+
results["by_challenge"][challenge]["count"] += 1
|
| 448 |
+
results["by_challenge"][challenge]["total_score"] += score
|
| 449 |
+
|
| 450 |
+
# Calculate aggregates
|
| 451 |
+
results["overall"]["total"] = len(scores)
|
| 452 |
+
if scores:
|
| 453 |
+
results["overall"]["mean_score"] = sum(scores) / len(scores)
|
| 454 |
+
|
| 455 |
+
# Std dev
|
| 456 |
+
if len(scores) > 1:
|
| 457 |
+
mean = results["overall"]["mean_score"]
|
| 458 |
+
variance = sum((s - mean) ** 2 for s in scores) / len(scores)
|
| 459 |
+
results["overall"]["std_score"] = variance ** 0.5
|
| 460 |
+
|
| 461 |
+
# Per-tier means
|
| 462 |
+
for tier, stats in results["by_tier"].items():
|
| 463 |
+
if stats["count"] > 0:
|
| 464 |
+
stats["mean"] = stats["total_score"] / stats["count"]
|
| 465 |
+
|
| 466 |
+
# Per-challenge means
|
| 467 |
+
for challenge, stats in results["by_challenge"].items():
|
| 468 |
+
if stats["count"] > 0:
|
| 469 |
+
stats["mean"] = stats["total_score"] / stats["count"]
|
| 470 |
+
|
| 471 |
+
return results
|
| 472 |
+
|
| 473 |
+
|
| 474 |
+
def print_results(results: Dict) -> None:
|
| 475 |
+
"""Pretty-print scoring results"""
|
| 476 |
+
print("\n" + "="*70)
|
| 477 |
+
print("DNA-World-Tiny SCORING RESULTS")
|
| 478 |
+
print("="*70)
|
| 479 |
+
|
| 480 |
+
overall = results["overall"]
|
| 481 |
+
print(f"\nOVERALL STATS:")
|
| 482 |
+
print(f" Total tasks scored: {overall['total']}")
|
| 483 |
+
print(f" Mean score: {overall['mean_score']:.4f}")
|
| 484 |
+
print(f" Std dev: {overall['std_score']:.4f}")
|
| 485 |
+
|
| 486 |
+
print(f"\nBY TIER:")
|
| 487 |
+
for tier in ["promoter", "enhancer", "long_range", "negative", "gradient"]:
|
| 488 |
+
stats = results["by_tier"].get(tier, {})
|
| 489 |
+
if stats["count"] > 0:
|
| 490 |
+
print(f" {tier:12} | count={stats['count']:2} | valid={stats['valid']:2} | mean_score={stats['mean']:.4f}")
|
| 491 |
+
|
| 492 |
+
print(f"\nBY CHALLENGE:")
|
| 493 |
+
for challenge, stats in sorted(results["by_challenge"].items()):
|
| 494 |
+
print(f" {challenge:15} | count={stats['count']:2} | mean_score={stats['mean']:.4f}")
|
| 495 |
+
|
| 496 |
+
print("\n" + "="*70)
|
| 497 |
+
|
| 498 |
+
|
| 499 |
+
if __name__ == "__main__":
|
| 500 |
+
# Example: score benchmark
|
| 501 |
+
bench_path = Path(__file__).parent.parent / "bench_dna_tiny_v1_1" / "dna_world_tiny_v1_1.jsonl"
|
| 502 |
+
pred_path = Path(__file__).parent.parent / "predictions_dummy.jsonl"
|
| 503 |
+
|
| 504 |
+
print(f"Benchmark: {bench_path.exists() and 'FOUND' or 'NOT FOUND'}")
|
| 505 |
+
print(f"Predictions: {pred_path.exists() and 'FOUND' or 'NOT FOUND'}")
|