31
Canonical Grid model
Guarded Molecular Biology Lab
Synthetic dilution, relative qPCR, and enzyme-rate examples with explicit assumptions and missing-value guards.
- Scale
- Small
- Source
- 31-guarded-biology-lab.grid
- Length
- 55 lines
- Collection
- Advanced language
- Level
- Intermediate
- Runtime
- Portable
- Version
- 1.0.0
MODEL "Guarded Molecular Biology Lab"
DESCRIPTION "Synthetic dilution, relative qPCR, and enzyme-rate examples with explicit assumptions and missing-value guards."
VERSION "1.0.0"
AUTHOR "Grid Team"
TAGS "biology", "laboratory", "validation"
# Concentrations are micromolar; volumes are microliters.
## Stock concentration must be positive. The bounds define this teaching example.
input StockMicromolar = 100
VALIDATE BETWEEN 0.001 AND 1000000 MESSAGE "Stock concentration must be positive (0.001–1000000 micromolar in this example)."
input TargetMicromolar = 10
VALIDATE BETWEEN 0 AND StockMicromolar MESSAGE "Target concentration must be nonnegative and no greater than the stock."
input FinalMicroliters = 200
VALIDATE BETWEEN 0.001 AND 1000000 MESSAGE "Final volume must be positive, in microliters."
# Cq values are measured cycles. Blank is a missing measurement, never zero.
# Try the synthetic scenario: treated target 23, treated reference 20,
# control target 25, control reference 20. The expected relative expression is 4.
# Clearing a Cq restores its blank default and removes the expression result.
## Relative expression assumes equal target/reference efficiencies near doubling; technical means are not biological replication.
input TreatedTargetCq = BLANK
VALIDATE BETWEEN 1 AND 45 MESSAGE "Enter a measured target Cq between 1 and 45 for this example."
input TreatedReferenceCq = BLANK
VALIDATE BETWEEN 1 AND 45 MESSAGE "Enter a measured reference Cq between 1 and 45."
input ControlTargetCq = BLANK
VALIDATE BETWEEN 1 AND 45 MESSAGE "Enter a measured control target Cq between 1 and 45."
input ControlReferenceCq = BLANK
VALIDATE BETWEEN 1 AND 45 MESSAGE "Enter a measured control reference Cq between 1 and 45."
## Slope of Cq against log10(copy number); a negative slope is necessary, not sufficient, for a suitable standard curve.
input StandardSlope = -3.321928094887362
VALIDATE BETWEEN -10 AND -1 MESSAGE "Review the standard curve: this example requires a negative slope between -10 and -1."
# Initial-rate example: Vmax = 100 rate units and Km = 20 micromolar.
input SubstrateMicromolar = 20
VALIDATE BETWEEN 0 AND 1000000 MESSAGE "Substrate concentration must be nonnegative, in micromolar."
# Derived guards also protect outputs when a changed bound invalidates an older value.
DilutionValid = ISNUMBER(StockMicromolar) AND ISNUMBER(TargetMicromolar) AND ISNUMBER(FinalMicroliters) AND StockMicromolar > 0 AND TargetMicromolar >= 0 AND TargetMicromolar <= StockMicromolar AND FinalMicroliters > 0
CqPresent = ISNUMBER(TreatedTargetCq) AND ISNUMBER(TreatedReferenceCq) AND ISNUMBER(ControlTargetCq) AND ISNUMBER(ControlReferenceCq)
CqValid = CqPresent AND TreatedTargetCq >= 1 AND TreatedTargetCq <= 45 AND TreatedReferenceCq >= 1 AND TreatedReferenceCq <= 45 AND ControlTargetCq >= 1 AND ControlTargetCq <= 45 AND ControlReferenceCq >= 1 AND ControlReferenceCq <= 45
SlopeValid = ISNUMBER(StandardSlope) AND StandardSlope >= -10 AND StandardSlope <= -1
SubstrateValid = ISNUMBER(SubstrateMicromolar) AND SubstrateMicromolar >= 0
DeltaDeltaCq = CqValid THEN QPCR_DELTA_DELTA_CQ(TreatedTargetCq, TreatedReferenceCq, ControlTargetCq, ControlReferenceCq) ELSE #N/A
# Public outputs have explicit interpretation and no duplicate helper rows.
output DilutionStatus = DilutionValid THEN "Feasible dilution; concentrations in micromolar and volumes in microliters." ELSE "Infeasible or missing input: check stock, target, and final volume."
output StockVolumeMicroliters = DilutionValid THEN DILUTION_V1(StockMicromolar, TargetMicromolar, FinalMicroliters) ELSE #N/A
output DiluentMicroliters = DilutionValid THEN FinalMicroliters - StockVolumeMicroliters ELSE #N/A
output QpcrStatus = NOT CqPresent THEN "Missing Cq measurement; no relative expression reported." ELSE NOT CqValid THEN "Review Cq values against the example's 1–45 cycle window." ELSE NOT SlopeValid THEN "Review the standard curve slope before interpreting relative expression." ELSE "Relative expression assumes equal target/reference efficiencies near doubling; review assay suitability separately."
output RelativeExpression = CqValid AND SlopeValid THEN 2 ^ (-DeltaDeltaCq) ELSE #N/A
output AmplificationEfficiency = SlopeValid THEN QPCR_EFFICIENCY(StandardSlope) ELSE #N/A
output EnzymeStatus = SubstrateValid THEN "Michaelis–Menten initial rate; Vmax 100 rate units and Km 20 micromolar." ELSE "Missing or negative substrate concentration."
output EnzymeRate = SubstrateValid THEN MICHAELIS_MENTEN_RATE(100, SubstrateMicromolar, 20) ELSE #N/A
END MODEL