Skip to content

Electronic Lab Notebook (ELN)

github-actions[bot] edited this page Nov 12, 2026 · 2 revisions

Electronic Lab Notebook (ELN) & Multi-Modal LIMS

The BioLabCalc Electronic Lab Notebook (ELN) and Multi-Modal Laboratory Information Management System (LIMS) is an enterprise-grade digital laboratory platform engineered specifically for biochemistry, molecular biology, structural biology, and bioprocess laboratories. It seamlessly bridges benchtop mathematical calculations with regulatory record-keeping, cold-chain freezer management, analytical instrument parsing, and local retrieval-augmented intelligence.


πŸ›οΈ System Architecture

The ELN is designed around a modular, multi-tier architecture capable of running as a lightweight, zero-dependency benchtop server on a personal laptop or as a horizontally scalable, containerized multi-user deployment backed by PostgreSQL 16+ with pgvector.

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                               Modern Web SPA Frontend                                  β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚ Notebook Tab  β”‚ FPLC Canvas    β”‚ Gel Annotator β”‚ NanoDrop Plot  β”‚ Freezer 2D Gridβ”‚  β”‚
β”‚  β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€  β”‚
β”‚  β”‚ Kinetic Timers β€’ HITL OCR Corrector β€’ Sequence Viewer β€’ Global RAG Assistant (⌘K)β”‚  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                            β”‚ HTTP / JSON REST & WebSockets
                                            β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                            Dual-Engine Server Runtime                                  β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚ Primary Engine: FastAPI / Uvicorn (ASGI)       β”‚ Fallback Engine: Pure-Python    β”‚  β”‚
β”‚  β”‚ β€’ High-concurrency async request pipeline      β”‚   Multi-threaded HTTP Server    β”‚  β”‚
β”‚  β”‚ β€’ Real-time WebSocket broadcasting             β”‚ β€’ Zero third-party dependencies β”‚  β”‚
β”‚  β”‚ β€’ Automated OpenAPI / Swagger documentation    β”‚ β€’ In-process synchronous routingβ”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                            β”‚
                                            β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                              Application Service Layer                                 β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚  β”‚ CampaignService      β”‚ SOPService           β”‚ InventoryService                    β”‚ β”‚
β”‚  β”‚ β€’ Multi-day studies  β”‚ β€’ Semantic versioningβ”‚ β€’ 6-tier cold-chain spatial hierarchyβ”‚ β”‚
β”‚  β”‚ β€’ Yield aggregation  β”‚ β€’ GxP execution fork β”‚ β€’ 2D slot collision validation      β”‚ β”‚
β”‚  β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ β”‚
β”‚  β”‚ FPLCService          β”‚ GelService           β”‚ AuditService                        β”‚ β”‚
β”‚  β”‚ β€’ Peak integration   β”‚ β€’ Lane densitometry  β”‚ β€’ SHA-256 hash-chained ledger       β”‚ β”‚
β”‚  β”‚ β€’ Fraction pooling   β”‚ β€’ MW Rf calibration  β”‚ β€’ 21 CFR Part 11 tamper-evidence    β”‚ β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                              β”‚                                     β”‚
                              β–Ό                                     β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚            Dual Database Abstraction          β”‚ β”‚ Content-Addressed Storage (CAS) Blob β”‚
β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ β”‚ β€’ SHA-256 deduplicated file store   β”‚
β”‚ β”‚ SQLite Engine     β”‚ PostgreSQL 16+ Engine β”‚ β”‚ β”‚ β€’ Two-tier directory sharding        β”‚
β”‚ β”‚ β€’ Embedded local  β”‚ β€’ Multi-user cluster  β”‚ β”‚ β”‚   ({base}/{sha256[:2]}/{sha256}.blob)β”‚
β”‚ β”‚ β€’ Pure-Python ORM β”‚ β€’ pgvector (HNSW)     β”‚ β”‚ β”‚ β€’ Atomic staging via temp files      β”‚
β”‚ β”‚ β€’ Custom vector   β”‚ β€’ JSONB + tsvector    β”‚ β”‚ β”‚ β€’ Local filesystem & S3/MinIO driversβ”‚
β”‚ β”‚   scalar function β”‚ β€’ 21 relational tablesβ”‚ β”‚ β”‚ β€’ Full binary reproducibility        β”‚
β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ—„οΈ Dual-Engine Database Abstraction

The persistence layer (biolabcalc.eln.schema.database) implements an abstraction pattern allowing seamless switching between local SQLite storage and high-concurrency PostgreSQL clusters without altering service logic.

1. Zero-Dependency Pure-Python SQLite Engine

For single-investigator workstations, field expeditions, or air-gapped environments where external database packages or compiled C-extensions are unavailable, BioLabCalc incorporates an in-house declarative ORM:

  • Custom Metaclass ORM (BaseModel, Field, Relationship): Provides model registration, foreign-key resolution, cascading deletions, automatic JSON serialization, and entity tracking without requiring SQLAlchemy.
  • In-Database Vector Cosine Similarity: SQLite does not natively support vector datatypes. BioLabCalc injects a compiled C-level scalar function directly into the SQLite connection:
    conn.create_function("COSINE_SIMILARITY", 2, _sqlite_cosine_similarity)
    This enables nearest-neighbor hybrid search directly inside SQLite SQL queries without external vector libraries.
  • Transactional Identity Map: The custom Session maintains an identity map and tracks _new and _dirty object sets, guaranteeing atomic commits and rollback capabilities.
  • Concurrency Locking: When using in-memory SQLite (:memory:), Engine protects the shared connection with a threading.Lock() so concurrent multi-threaded operations do not collide or corrupt state.
  • Write-Ahead Logging (WAL) Mode: For file-based SQLite databases, connections automatically execute PRAGMA journal_mode = WAL; and configure timeout=30.0 to eliminate database locks under concurrent access.

2. Enterprise PostgreSQL 16+ with pgvector

For multi-user research institutions, core facilities, and regulated biopharma deployments, the ELN connects to PostgreSQL via SQLAlchemy and psycopg2-binary (installable via pip install "biolabcalc[eln]"). If a postgresql:// or postgres:// URI is specified without required dependencies, the engine raises an explicit ValueError rather than silently falling back to SQLite in-memory storage. The production DDL (biolabcalc.eln.schema.ddl.sql) provisions:

  • 21 Relational Tables: Covering users, audit logs, storage blobs, SOP templates, experimental campaigns, daily entries, kinetic timepoint logs, biological sequences, PCR assays, NanoDrop measurements, FPLC columns, FPLC runs, FPLC fractions, gel records, gel lanes, electrophysiology recordings, code analysis runs, storage hierarchy nodes, freezer boxes, inventory tubes, and RAG document chunks.
  • Vector Cosine Indexing (HNSW): 1536-dimensional embeddings indexed via Hierarchical Navigable Small World graphs:
    CREATE INDEX idx_rag_document_chunks_embedding_hnsw
        ON rag_document_chunks
        USING hnsw (embedding vector_cosine_ops)
        WITH (m = 16, ef_construction = 64);
  • Hybrid Search Indexes: Generalized Inverted Indexes (GIN) on generated tsvector columns for full-text lexical search, GIN trigram indexes (pg_trgm) for fuzzy keyword matching, and GIN JSONB indexes for experimental parameter queries.

πŸ“¦ Content-Addressed Storage (CAS) Engine

All raw instrument outputs, gel micrographs, chromatograms, and spectrophotometer runs are ingested through the Content-Addressed Storage subsystem (biolabcalc.eln.storage.blob_store).

Core Features:

  1. Cryptographic Deduplication: Every file is indexed strictly by the hexadecimal digest of its SHA-256 hash. If two researchers upload identical 500 MB FPLC run files, only one physical blob is written to disk.
  2. Two-Tier Directory Sharding: To prevent filesystem performance degradation when storing tens of thousands of raw analytical files, blobs are sharded across subdirectories using the first two hex characters of their hash:
    .biolabcalc_data/blobs/
    β”œβ”€β”€ 3a/
    β”‚   β”œβ”€β”€ 3a8f9c10...blob        <- Raw immutable binary payload
    β”‚   └── 3a8f9c10...meta.json   <- Ingestion metadata, MIME type, size, attributes
    β”œβ”€β”€ d4/
    β”‚   β”œβ”€β”€ d41d8cd9...blob
    β”‚   └── d41d8cd9...meta.json
    
  3. Atomic Writes: Blobs are written to a temporary staging file and atomically renamed to their final sharded path, preventing corrupt reads during concurrent multi-threaded uploads.
  4. Storage Backend Flexibility: The storage layer is governed by the StorageBackend abstract interface, allowing effortless switching between local storage (LocalStorageBackend) and enterprise cloud buckets (S3StorageBackend / MinIO).

πŸ–₯️ Web Interface Walkthrough

The BioLabCalc ELN user interface is delivered as a modern Single-Page Application (SPA) located in eln/web/templates/index.html and styled via eln/web/static/styles.css.

Tab / Module Primary Purpose Key Features
πŸ“– Notebook Multi-day campaign execution Daily bench entries, carry-forward buffer/plasmid state, protocol deviation tracking, cumulative protein yield calculations.
⏱️ Kinetic Timepoints In-run incubation & growth monitoring Live multi-timer countdown/countup, optical density ($OD_{600}$) tracking, temperature/RPM logs, audio alerts on milestone completion.
πŸ“ˆ FPLC Chromatogram Chromatography trace inspection Γ„KTA UNICORN interactive multi-trace canvas ($UV_{280}$, $UV_{260}$, $UV_{215}$, Conductivity, %B, Pressure), fraction tube mapping, peak integration.
🧬 Gel Canvas Electrophoresis densitometry Bio-Rad ChemiDoc & 16-bit TIFF rendering, lane profiling, molecular weight ($R_f$) logarithmic calibration, automated purity percentage calculation.
πŸ”¬ NanoDrop Spectra Microvolume UV-Vis quantification 220–350 nm spectral overlay, pathlength normalization, $A_{260}/A_{280}$ and $A_{260}/A_{230}$ purity diagnostics, phenol/guanidine contaminant detection.
❄️ Freezer LIMS Cold-chain sample management Multi-tier spatial tree (Room $\rightarrow$ Unit $\rightarrow$ Rack $\rightarrow$ Box), interactive 2D box grid (9x9, 10x10), slot collision prevention, upstream sample lineage graph.
πŸ“ OCR Digitizer Scanned bench notes digitization Human-in-the-Loop (HITL) OCR corrector, confidence scoring, ambiguous biochemical character disambiguation, side-by-side interactive correction.
🧬 Sequences & SOPs Master molecular registries Plasmid construct repository, translated ORF biophysics (MW, pI, $\varepsilon_{280}$), master SOP catalog, and PI sign-off lifecycle.
πŸ” Assistant (⌘K) Context-aware RAG knowledge search Hybrid BM25 + dense vector semantic search across all historical notebook entries, FPLC runs, and freezer tubes with citation provenance.

πŸš€ Server Launch Options

The ELN server can be launched directly from the terminal or initialized programmatically within Python.

Terminal CLI Execution

# Launch server with default settings (127.0.0.1:8080, local SQLite)
biolabcalc eln

# Bind to custom port and network interface
biolabcalc eln --host 0.0.0.0 --port 9000

# Connect to production PostgreSQL instance
biolabcalc eln --db "postgresql://lims_user:secret@db.lab.internal:5432/eln_production"

# Headless server launch (disable automatic browser pop-up)
biolabcalc eln --no-browser --port 8080

# Specify custom storage directory for database, audit ledger, and CAS blobs
biolabcalc eln --storage-dir /var/data/biolabcalc_storage

Server Command-Line Arguments Reference

Option Flag Default Description
--host -H 127.0.0.1 Network interface IP address to bind. Use 0.0.0.0 for LAN access.
--port -p 8080 TCP port for incoming HTTP/WebSocket connections.
--db -d Local SQLite Database connection URL (sqlite:///path/to/db.sqlite or postgresql://...).
--no-browser False Disables launching the default operating system web browser on startup.
--storage-dir ~/.biolabcalc_eln Root directory for SQLite database, CAS blobs, and audit trails.

Environment Variables

  • BIOLABCALC_STORAGE_DIR: Overrides the default base directory for all databases, audit files, and CAS blobs.
  • BIOLABCALC_AUDIT_LOG: Explicit path to the append-only JSONL audit ledger.
  • DATABASE_URL: Connection string for PostgreSQL or custom database path.

πŸ”— Related Documentation

Clone this wiki locally