Skip to content

SOP & Protocol Management

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

Standard Operating Procedure (SOP) & Protocol Management

In regulated wet-lab and bioprocessing environments (GLP, GMP, ISO 17025), experimental reproducibility requires strict separation between Master Protocol Blueprints and Executed Experimental Instances. The BioLabCalc SOP subsystem (biolabcalc.eln.services.sop_service, biolabcalc.eln.api.routes.sops) enforces GxP compliance through formal semantic versioning, electronic Principal Investigator (PI) sign-offs, immutable execution forking, interactive step checkoffs, and kinetic timer integration.


πŸ“‹ Master SOP Architecture & Markdown Authoring

Master SOPs represent approved, standard protocols maintained in the master catalog. Each SOP combines high-level Markdown procedural documentation with machine-readable parameter definitions and sequential step checklists.

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                        Master SOP Entity (`MasterSOP`)                 β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ SOP ID          β”‚ Title           β”‚ Version          β”‚ Status          β”‚
β”‚ (SOP-EXP-001)   β”‚ T7RNAP Express  β”‚ Semantic (1.2)   β”‚ draft/approved  β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ Description & Formatted Markdown Instructions                          β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ Default Parameter Blueprint:                                           β”‚
β”‚ { "host_strain": "BL21(DE3)", "induction_temp_c": 18.0, ... }          β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ Structured Step Pipeline (`List[SOPStep]`):                            β”‚
β”‚ β”Œβ”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚ β”‚ #   β”‚ Step Name            β”‚ Planned Min β”‚ Checkpoint Parameters   β”‚ β”‚
β”‚ β”œβ”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ β”‚
β”‚ β”‚ 1   β”‚ Seed Culture Inoc    β”‚ 15.0 min    β”‚ 50 mL LB + 50 Β΅g/mL Kan β”‚ β”‚
β”‚ β”‚ 2   β”‚ Bioreactor Scaling   β”‚ 240.0 min   β”‚ 37.0Β°C, 220 RPM, OD 0.6 β”‚ β”‚
β”‚ β”‚ 3   β”‚ IPTG Induction       β”‚ 10.0 min    β”‚ 0.5 mM IPTG, cool to 18Β°β”‚ β”‚
β”‚ β”‚ 4   β”‚ Overnight Expression β”‚ 960.0 min   β”‚ 18.0Β°C, 180 RPM         β”‚ β”‚
β”‚ β”‚ 5   β”‚ Cell Harvest Centrif β”‚ 30.0 min    β”‚ 4Β°C, 6000 x g, 20 min   β”‚ β”‚
β”‚ β””β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Python SOP Definition Example

from biolabcalc.eln.services.sop_service import get_sop_service

sop_service = get_sop_service()

# Register a master protocol
sop = sop_service.create_sop(
    sop_id="SOP-EXP-T7RNAP-001",
    title="High-Density Recombinant T7 RNA Polymerase Expression",
    version="1.0",
    category="Expression",
    description="Standardized fed-batch protocol for pET-28a-T7RNAP in E. coli BL21(DE3).",
    parameters={
        "host_strain": "BL21(DE3)",
        "antibiotic": "Kanamycin 50 ug/mL",
        "target_induction_od600": 0.65,
        "iptg_concentration_mm": 0.5,
        "induction_temp_celsius": 18.0,
        "expression_duration_hours": 16.0,
    },
    steps=[
        {
            "step_index": 1,
            "name": "Primary Inoculation",
            "instruction": "Inoculate 50 mL sterile LB broth containing 50 ug/mL kanamycin with a single fresh colony.",
            "planned_duration_minutes": 15.0,
            "parameters": {"media": "LB", "volume_ml": 50},
        },
        {
            "step_index": 2,
            "name": "Biomass Growth to Mid-Log Phase",
            "instruction": "Incubate culture at 37.0Β°C, 220 RPM until OD600 reaches 0.60 - 0.70.",
            "planned_duration_minutes": 210.0,
            "parameters": {"temp_c": 37.0, "rpm": 220, "target_od": 0.65},
        },
        {
            "step_index": 3,
            "name": "Temperature Shift & IPTG Induction",
            "instruction": "Transfer flasks to 18Β°C shaker for 30 minutes to equilibrate, then add IPTG to 0.5 mM final.",
            "planned_duration_minutes": 40.0,
            "parameters": {"temp_c": 18.0, "iptg_mm": 0.5},
        },
        {
            "step_index": 4,
            "name": "Overnight Induction & Harvest",
            "instruction": "Express for 16 hours at 18Β°C. Pellet cells at 6,000 x g for 20 minutes at 4Β°C.",
            "planned_duration_minutes": 980.0,
            "parameters": {"centrifuge_rcf": 6000, "duration_min": 20},
        },
    ],
    created_by="researcher_alice",
)

🏷️ Semantic Versioning & PI Sign-Off Lifecycle

BioLabCalc enforces a formal governance lifecycle across all SOPs:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     PI Approval      β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    Deprecation    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚    Draft     β”‚ ───────────────────> β”‚    Approved     β”‚ ────────────────> β”‚   Deprecated   β”‚
β”‚ (In Edit)    β”‚   Electronic Sign    β”‚ (Executable GxP)β”‚   New Version     β”‚ (Historical)   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                      β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
  1. Semantic Versioning Semantics:
    • Patch Release (1.0 $\rightarrow$ 1.0.1): Clarifications, typographical corrections, safety equipment notes; does not alter chemical stoichiometry or execution steps.
    • Minor Release (1.0 $\rightarrow$ 1.1): Additions of optional wash steps, non-critical buffer adjustments, or modified incubation temperature tolerances ($\pm 1.0^\circ\text{C}$).
    • Major Release (1.0 $\rightarrow$ 2.0): Changes to host strain, column chromatography resin (e.g., Ni-NTA to Co-TALON), lysis mechanics, or reaction chemistry.
  2. Electronic PI Sign-Off: Before an SOP can be instantiated into daily bench execution runs, a user holding the principal_investigator or lab_manager role must authorize it:
    approved_sop = sop_service.approve_sop(
        sop_id="SOP-EXP-T7RNAP-001",
        approver_id="prof_franklin",
    )
    This operation transitions the SOP status from draft to approved and writes an immutable, timestamped event to the cryptographic audit trail recording the approver's identity and signed version.

πŸ”’ GxP Immutable Execution Forks

In historical research notebooks, altering a master protocol after experiments have completed can retroactively falsify or obscure past methodology. BioLabCalc eliminates this risk through Immutable Execution Forking:

Master SOP: SOP-EXP-T7RNAP-001 (Version 1.0)
    β”‚
    β”œβ”€β–Ί Execution Fork FORK-001 (Campaign CMP-2026-T7, Day 1) [FROZEN]
    β”‚   β”œβ”€β”€ Locked Parameters: { "induction_temp_celsius": 18.0, ... }
    β”‚   └── Execution Checklist: Steps 1..4 (Completed by Operator Alice)
    β”‚
    β–Ό (PI updates Master SOP to Version 2.0 with Cobalt resin)
Master SOP: SOP-EXP-T7RNAP-001 (Version 2.0)
    β”‚
    └─► Execution Fork FORK-002 (Campaign CMP-2026-T7, Day 4) [FROZEN]
        β”œβ”€β”€ Locked Parameters: { "resin": "TALON-Cobalt", ... }
        └── Execution Checklist: Steps 1..4 (In Progress by Operator Bob)

Fork Creation Mechanics

When an operator begins Day 1 of an experimental campaign, the ELN creates an isolated SOPFork:

fork = sop_service.fork_sop_for_entry(
    sop_id="SOP-EXP-T7RNAP-001",
    entry_id="ENTRY-CAMP-T7-D1",
    forked_by="researcher_alice",
    parameter_overrides={
        "induction_temp_celsius": 16.0  # Approved run-specific optimization
    },
)
print(f"Created Execution Fork: {fork.fork_id} (Version {fork.sop_version})")
  • Approved Status Enforcement: To enforce GxP compliance, fork_sop_for_entry validates that the target master SOP has approved status. Attempting to fork an SOP with draft or deprecated status raises ValueError (Cannot fork SOP '{sop_id}' with status '{status}'. Only approved SOPs can be executed in experimental entries.).
  • Parameter Snapshot: Master default parameters are deep-copied and merged with any authorized parameter overrides. The resulting dictionary is permanently locked.
  • Independent Checklist: The step definitions are deep-copied into individual StepExecution instances with pending statuses.

⏱️ Step Checkoffs, Operator Signatures & Deviations

During laboratory execution, operators check off steps in real time via the web interface or REST API.

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Step 2: Biomass Growth to Mid-Log Phase                                [ COMPLETED ]  β”‚
β”‚  Instruction: Incubate culture at 37.0Β°C, 220 RPM until OD600 reaches 0.60 - 0.70.    β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚  Planned Duration: 210.0 min  β”‚  Actual Duration: 235.0 min  (Deviation: +25.0 min)    β”‚
β”‚  Completed By:     alice_r    β”‚  Timestamp:       2026-11-12T14:35:10Z                 β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚  ⚠️ Protocol Deviation Logged:                                                         β”‚
β”‚  "Culture growth was slower than anticipated due to initial incubator lag at 35.5Β°C.   β”‚
β”‚   Induction delayed until target OD600 (0.64) was verified by spectrophotometer."      β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Checkoff API Execution

updated_fork = sop_service.checkoff_step(
    fork_id="FORK-SOP-EXP-T7RNAP-001-A48F91",
    step_index=2,
    completed_by="alice_r",
    actual_duration_minutes=235.0,
    deviation_notes="Incubator took 25 minutes longer to reach target OD600 of 0.64.",
)

Protocol Deviation Logging

Regulatory guidelines mandate that any departure from written procedure must be documented, justified, and reviewed:

  1. Planned vs. Actual Delta: The system automatically computes and displays the variance between planned_duration_minutes and actual_duration_minutes.
  2. Mandatory Deviation Rationale: If actual duration or parameter measurements fall outside pre-configured tolerances, the UI requires the operator to provide an explanation before the checkoff is accepted.
  3. Audit Ledger Coupling: Every checkoff event generates a STEP_CHECKOFF audit event containing the exact timestamp, actor ID, duration metrics, and deviation text.

⏲️ Real-Time Kinetic Timers & Audio Alerts

The ELN web interface features an integrated kinetic timer engine (eln/web/static/timer_widget.js) directly synchronized with SOP execution steps:

  1. Multi-Timer Parallel Tracking: Run multiple incubation, digestion, and centrifuge countdowns simultaneously across different benches.
  2. Step Duration Pre-population: Clicking a step's timer icon automatically initializes the timer to planned_duration_minutes.
  3. Elapsed Countup & Overtime Warning: If an incubation timer expires, it immediately transitions to a flashing amber/red overtime countup, alerting the scientist to the exact duration of over-incubation.
  4. Web Audio Synthesis: Built-in harmonic frequency beeps fire across standard computer or mobile speakers upon milestone completion without relying on external MP3 assets.

πŸ“‘ REST API Reference

The SOP router (biolabcalc.eln.api.routes.sops) exposes the following endpoints:

Method Endpoint Description
GET /api/sops List all Master SOPs, filterable by category and status.
POST /api/sops Create a new master SOP blueprint (Draft status).
GET /api/sops/{sop_id} Retrieve complete master SOP details and step checklist.
POST /api/sops/{sop_id}/approve Principal Investigator authorization sign-off.
POST /api/sops/{sop_id}/fork Instantiate an immutable execution fork for an experiment.
GET /api/sops/forks/{fork_id} Retrieve real-time progress and checklist of an execution fork.
POST /api/sops/forks/{fork_id}/checkoff Record step completion, operator signature, duration, and deviation.

πŸ”— Related Documentation

Clone this wiki locally