Agentic Reconciliation of Biological Literature and High-Throughput Data
An autonomous AI-powered system that reconciles curated literature knowledge (RegulonDB) with high-throughput expression data (M3D) to validate, contradict, or discover gene regulatory relationships in E. coli.
The transcriptional regulatory network of E. coli K-12 is the most well-characterized biological network, yet knowledge is fragmented between:
- Literature Prior (RegulonDB): Curated assertions from decades of molecular biology
- Data Landscape (M3D): High-throughput expression measurements across 1000+ conditions
This system bridges these worlds using a LangGraph cyclic workflow with LLM-powered reasoning (ALCF/Argonne) for nuanced biological interpretation.
┌──────────────────────────────────────────────────────────────────────┐ │ LangGraph Workflow │ ├──────────────────────────────────────────────────────────────────────┤ │ │ │ ┌──────────┐ ┌─────────────┐ ┌──────────────────────────┐ │ │ │ Loader │───▶│Batch Manager│───▶│Research Agent │ │ │ │(ingest) │ │ (queue) │ │(Context Filter + RAG) │ │ │ └──────────┘ └─────────────┘ └────────┬─────────────────┘ │ │ ▲ │ Active Samples │ │ │ ▼ │ │ │ ┌────────────────┐ │ │ │ │Analysis Agent │ │ │ │ │ (CLR/MI) │ │ │ │ └────────┬───────┘ │ │ │ │ Stats │ │ │ ▼ │ │ │ ┌────────────────┐ │ │ └────────────│ Reviewer │ │ │ │ (🤖 LLM) │ │ │ └────────────────┘ │ │ │ │ │ ▼ │ │ [END] │ └──────────────────────────────────────────────────────────────────────┘
| Node | LLM | Description |
|---|---|---|
| Loader | ❌ | Ingests RegulonDB network, gene mappings, M3D expression matrix & metadata |
| Batch Manager | ❌ | Manages TF processing queue, prevents memory overflow |
| Research Agent | ✅ | Dual-Mode: 1. Filters M3D samples based on biological context. 2. Runs internal RAG workflow to retrieve & contextualize literature. |
| Analysis Agent | ❌ | Computes Mutual Information & CLR z-scores on filtered samples (deterministic statistics) |
| Reviewer | ✅ | Integrates RegulonDB, Analysis stats, and Context to classify edges into 4 categories using ALCF LLMs |
# From Batch Manager
batch__current_tfs: List[str] # TFs to process (e.g., ["b1334"])
# From Research Agent
research__literature_edges: Dict[str, Dict[str, Dict]]
# Structure: {tf_bnumber: {target_bnumber: {exists, effect, evidence_strength, ...}}}DREAMingAgent/ ├── main.py # CLI entry point ├── requirements.txt # Dependencies ├── src/ │ ├── workflow.py # LangGraph StateGraph orchestration │ ├── state.py # AgentState schema & data classes │ ├── config.py # System configuration (LLM toggle, thresholds) │ ├── nodes/ │ │ ├── loader.py # Data ingestion (RegulonDB + M3D) │ │ ├── batch_manager.py # TF queue management │ │ ├── research_agent.py # Context filtering + Literature RAG loop │ │ ├── analysis_agent.py # CLR/MI statistical engine │ │ └── reviewer_agent.py # AI-powered reconciliation logic │ ├── llm/ │ │ ├── client.py # Google Gemini API wrapper │ │ └── prompts.py # System prompts for AI reasoning │ └── utils/ │ ├── parsers.py # File parsers & synthetic data generator │ └── statistics.py # MI, CLR, correlation functions ├── examples/ │ └── demo_analysis_agent.py # Standalone CLR/MI demonstration └── tests/ └── test_analysis_agent.py # Unit tests
# From Analysis Agent
analysis__statistical_results: Dict[str, Dict[str, Dict]]
# Structure: {tf_bnumber: {target_bnumber: {clr_zscore, mi, correlation, pvalue}}}
## Installation
```bash
# Clone the repository
git clone https://github.com/yourusername/DREAMingAgent.git
cd DREAMingAgent
# Create virtual environment
python -m venv AgentVenv
source AgentVenv/bin/activate # On Windows: AgentVenv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
The system uses ALCF (Argonne Leadership Computing Facility) for LLM-powered reasoning. Configure access to the ALCF API according to your institution's setup.
To run the system with your own data files (or the provided RegulonDB files in data/):
# Using only RegulonDB Network and Gene Mappings (Rule-based, no LLM)
# M3D expression data is optional; if omitted, statistical analysis checks are skipped.
python main.py \
--network data/NetworkRegulatorGene.tsv \
--genes data/GeneProductAllIdentifiersSet.tsv \
--no-llm
# Using Full Dataset (RegulonDB + M3D)
# (Requires M3D files at specified paths)
python main.py \
--network data/NetworkRegulatorGene.tsv \
--genes data/GeneProductAllIdentifiersSet.tsv \
--expression data/E_coli_v4_Build_6_exps.tab \
--metadata data/E_coli_v4_Build_6_meta.tab \
--output results/| Flag | Description |
|---|
| --no-llm | Disable LLM reasoning (use rule-based fallbacks) |
| --llm-model MODEL | LLM model to use (default: argonne-llama3) |
| --output, -o | Output directory (default: output/) |
| --verbose, -v | Enable debug logging |
| --max-iterations | Max processing iterations (default: 100) |
The Analysis Agent implements the Context Likelihood of Relatedness (CLR) algorithm:
-
Mutual Information (MI): Captures non-linear dependencies between TF and target gene expression
[I(X;Y) = \sum_{x,y} p(x,y) \log \frac{p(x,y)}{p(x)p(y)}]
-
CLR Z-score Normalization: Distinguishes direct from indirect regulation
[z = \max\left(0, \frac{\text{MI} - \mu}{\sigma}\right)]
-
Significance Thresholds:
- High: z ≥ 4.0
- Moderate: z ≥ 2.0
- Low: z < 1.0
The system classifies each TF→Gene edge into four categories:
| Status | Literature | Data | Interpretation |
|---|---|---|---|
| Validated | Strong | High z-score | Confirmed active regulation |
| Condition-Silent | Strong | Low z-score | Real binding, but TF inactive in sampled conditions |
| Probable False Positive | Weak | Low z-score | Candidate for database pruning |
| Novel Hypothesis | None | High z-score | New discovery for experimental validation |
When LLM is enabled, the Reconciler provides nuanced biological interpretation:
{
"status": "ConditionSilent",
"confidence": 0.85,
"reasoning": "FNR→narG has strong physical evidence (DNA footprinting), but
the M3D compendium is dominated by aerobic conditions where FNR
is inactive. The low z-score reflects TF inactivity, not absence
of regulation.",
"recommendation": "Re-analyze using only anaerobic samples."
}| Column | Description |
|---|---|
| Source_TF | Transcription factor ID |
| Target_Gene | Target gene ID |
| RegulonDB_Evidence | Literature evidence level (Strong/Weak/Unknown) |
| RegulonDB_Effect | Regulation type (+/-/+-/?) |
| M3D_Z_Score | CLR-corrected z-score |
| M3D_MI | Raw mutual information |
| Reconciliation_Status | Validated/ConditionSilent/ProbableFalsePos/NovelHypothesis |
| Context_Tags | Experimental context used |
| Notes | AI reasoning or rule-based explanation |
{
"reconciliation_log": [...],
"novel_hypotheses": [...],
"false_positive_candidates": [...],
"summary": {
"total_edges": 113,
"novel_count": 1,
"false_positive_count": 28
}
}# Run all unit tests
pytest -v
# Run specific test class
pytest tests/test_analysis_agent.py::TestCLRCalculation -v
# Demo the Analysis Agent in isolation
python examples/demo_analysis_agent.py- Version: v13.5+ recommended
- Files:
network_tf_gene.txt,gene_product.txt - URL: https://regulondb.ccg.unam.mx/
- Version: E. coli Build 6 (v4)
- Files:
E_coli_v4_Build_6_exps.tab,E_coli_v4_Build_6_meta.tab - URL: http://m3d.mssm.edu/
Environment variables:
| Variable | Description |
|---|---|
DREAMING_USE_LLM |
Enable/disable LLM (true/false) |
DREAMING_LLM_MODEL |
Model name (default: argonne-llama3) |
Edit CLR z-score thresholds in src/nodes/reviewer_agent.py:
HIGH_DATA = 4.0 # Strong data support threshold
MODERATE_DATA = 2.0 # Moderate data support threshold
LOW_DATA = 1.0 # Low data support thresholdThe Research Agent uses a vector store for literature retrieval. To add new literature:
- Add documents to the vector store via src/utils/vector_store.py
- Documents are embedded using BAAI/bge-small-en-v1.5
- Include metadata with experimental conditions for better context matching
MIT License
If you use this tool in your research, please cite:
@software{dreaming_agent,
title = {DREAMing Agent: Agentic Reconciliation of Biological Literature and High-Throughput Data},
author = {Chandra, Marcus},
year = {2024},
url = {https://github.com/yourusername/DREAMingAgent}
}Marcus Chandra - DREAMing Agent Team