|
| 1 | +# BioLab |
| 2 | + |
| 3 | +Unified bioinformatics platform for gene analysis, evidence synthesis, and whole-cell simulation. |
| 4 | + |
| 5 | +BioLab combines genomic data ingestion, LLM-powered functional prediction, and multi-scale cell simulation into a single interactive environment. Load a genome, analyze genes against public databases, synthesize function hypotheses with AI, and simulate cellular behavior — all from one interface. |
| 6 | + |
| 7 | +## Features |
| 8 | + |
| 9 | +- **Multi-genome management** — load genomes from GenBank, NCBI accessions, Ensembl, or FASTA files |
| 10 | +- **Gene analysis & evidence synthesis** — aggregate functional evidence from BRENDA, SABIO-RK, KEGG, and Datanator |
| 11 | +- **LLM-powered predictions** — synthesize gene function hypotheses using Claude, OpenAI, or local Ollama models |
| 12 | +- **Cell simulation** — multi-timescale ODE engine covering metabolism, gene expression, growth, mutation, and epigenetics |
| 13 | +- **CellForge** — advanced whole-cell simulation with thermodynamic constraints, stochastic processes (Gillespie SSA), and FBA |
| 14 | +- **Population dynamics** — population-level growth, division, and genetic drift simulation |
| 15 | +- **Interactive frontend** — React/TypeScript UI with genome browser, petri dish visualization, knockout lab, and real-time charts |
| 16 | +- **CLI & API** — full Typer CLI and FastAPI REST/WebSocket API |
| 17 | + |
| 18 | +## Requirements |
| 19 | + |
| 20 | +- Python 3.11+ |
| 21 | +- Node.js 18+ (for frontend) |
| 22 | +- Rust toolchain (optional, for native CellForge engine) |
| 23 | + |
| 24 | +## Quick Start |
| 25 | + |
| 26 | +```bash |
| 27 | +# Clone |
| 28 | +git clone https://github.com/SimplyLiz/BioLab.git |
| 29 | +cd BioLab |
| 30 | + |
| 31 | +# Python setup |
| 32 | +python -m venv .venv |
| 33 | +source .venv/bin/activate # Linux/macOS |
| 34 | +# .venv\Scripts\activate # Windows |
| 35 | +pip install -e ".[dev,llm]" |
| 36 | + |
| 37 | +# Frontend setup |
| 38 | +cd frontend && npm install && cd .. |
| 39 | + |
| 40 | +# Initialize database |
| 41 | +biolab init |
| 42 | + |
| 43 | +# Launch both backend and frontend |
| 44 | +python launch.py |
| 45 | +``` |
| 46 | + |
| 47 | +Backend runs on `http://localhost:8000`, frontend on `http://localhost:5173`. |
| 48 | + |
| 49 | +## Configuration |
| 50 | + |
| 51 | +Set via environment variables or a `.env` file: |
| 52 | + |
| 53 | +| Variable | Description | Default | |
| 54 | +|---|---|---| |
| 55 | +| `ANTHROPIC_API_KEY` | Claude API key for LLM synthesis | — | |
| 56 | +| `OPENAI_API_KEY` | OpenAI API key (alternative provider) | — | |
| 57 | +| `LLM_PROVIDER` | `anthropic`, `openai`, or `ollama` | `anthropic` | |
| 58 | +| `LLM_MODEL` | Model name | `claude-sonnet-4-5-20250929` | |
| 59 | +| `DATABASE_URL` | SQLAlchemy database URL | `sqlite:///biolab.db` | |
| 60 | +| `NCBI_API_KEY` | NCBI E-utilities key (10 req/s vs 3) | — | |
| 61 | +| `NCBI_EMAIL` | Required by NCBI for identification | — | |
| 62 | +| `BIOLAB_BACKEND_PORT` | Backend port | `8000` | |
| 63 | +| `BIOLAB_FRONTEND_PORT` | Frontend port | `5173` | |
| 64 | + |
| 65 | +## CLI |
| 66 | + |
| 67 | +``` |
| 68 | +biolab genes Gene operations (list, import, search) |
| 69 | +biolab analyze Deep gene analysis & LLM synthesis |
| 70 | +biolab evidence Evidence source management |
| 71 | +biolab synthesize LLM function synthesis |
| 72 | +biolab pipeline Multi-phase evidence pipeline |
| 73 | +biolab validate Validation and quality checks |
| 74 | +biolab cellforge CellForge whole-cell simulation engine |
| 75 | +biolab init Initialize database |
| 76 | +``` |
| 77 | + |
| 78 | +### CellForge subcommands |
| 79 | + |
| 80 | +``` |
| 81 | +biolab cellforge annotate <fasta> Run genome annotation pipeline |
| 82 | +biolab cellforge run <config.json> Run a whole-cell simulation |
| 83 | +biolab cellforge serve Start the CellForge API server |
| 84 | +biolab cellforge benchmark Run performance benchmarks |
| 85 | +biolab cellforge info Show version and dependency info |
| 86 | +``` |
| 87 | + |
| 88 | +## Docker |
| 89 | + |
| 90 | +```bash |
| 91 | +docker-compose up |
| 92 | +``` |
| 93 | + |
| 94 | +This starts the backend (port 8000) and Redis cache (port 6379). |
| 95 | + |
| 96 | +For GPU-accelerated workloads: |
| 97 | + |
| 98 | +```bash |
| 99 | +docker build -f docker/Dockerfile.gpu -t biolab-gpu . |
| 100 | +``` |
| 101 | + |
| 102 | +## Project Structure |
| 103 | + |
| 104 | +``` |
| 105 | +src/biolab/ |
| 106 | + api/ REST API (FastAPI) |
| 107 | + cli/ CLI commands (Typer) |
| 108 | + services/ Business logic (LLM, ETL, import) |
| 109 | + ingestion/ GenBank/FASTA parsing |
| 110 | + simulation/ Core simulation engine |
| 111 | + cellforge/ Advanced whole-cell simulation |
| 112 | + core/ Simulation kernel |
| 113 | + processes/ Biological processes (transcription, translation, etc.) |
| 114 | + constraints/ Thermodynamic & energy constraints |
| 115 | + annotation/ Genome annotation pipeline |
| 116 | + api/ CellForge REST API |
| 117 | + contrib/ Plugin modules (DNASyn evidence pipeline) |
| 118 | + db/ Database models & migrations |
| 119 | +
|
| 120 | +frontend/ |
| 121 | + src/pages/ React page components |
| 122 | + src/components/ UI components (genome browser, petri dish, charts) |
| 123 | + src/hooks/ Data fetching & state hooks |
| 124 | + src/stores/ Zustand state management |
| 125 | +
|
| 126 | +crates/ |
| 127 | + cellforge-engine/ Rust native simulation engine (optional) |
| 128 | +``` |
| 129 | + |
| 130 | +## Optional Dependencies |
| 131 | + |
| 132 | +Install extras for additional capabilities: |
| 133 | + |
| 134 | +```bash |
| 135 | +pip install -e ".[cellforge]" # CellForge (COBRApy, GillesPy2, Redis, Zarr) |
| 136 | +pip install -e ".[ml]" # ML models (PyTorch, Transformers) |
| 137 | +pip install -e ".[validation]" # Validation (libRoadRunner, matplotlib) |
| 138 | +pip install -e ".[dashboard]" # Streamlit dashboard |
| 139 | +pip install -e ".[postgres]" # PostgreSQL support |
| 140 | +``` |
| 141 | + |
| 142 | +## Development |
| 143 | + |
| 144 | +```bash |
| 145 | +pip install -e ".[dev]" |
| 146 | +pytest # Run tests |
| 147 | +ruff check src/ # Lint |
| 148 | +mypy src/ # Type check |
| 149 | +``` |
| 150 | + |
| 151 | +## License |
| 152 | + |
| 153 | +All rights reserved. |
0 commit comments