{
 "about": {
  "method": "percent-of-vehicle-background (viability normalisations)",
  "ruling": "docs/board/memos/2026-10-13-cso-viability-normalisations.md",
  "origin": "Self-constructed readings",
  "tolerances": {
   "percents, blank share and means": "1e-12 relative",
   "reasons and counts": "exact"
  },
  "recordedOn": "2026-10-13",
  "script": "pipeline/assay-analyser/oracles/viability_normalisation.py",
  "scriptSha256": "8e9d7994e464673791a2d78c6b992211fbf19aa93253efaeaf417570b5c68453",
  "helper": {
   "script": "pipeline/assay-analyser/oracles/stage_a_oracle.py",
   "sha256": "492d85ca2fa6750db80b1c64214fd4a0b13cd4c588267244f6262c504c73e3e8"
  },
  "environment": {
   "image": "ghcr.io/biotechmat/drybench/oracle-env:11b8a5e4456df7eb@sha256:7e69891ca1d9f24838660e0a9887bdb654ce7771d2f2ac7e7275e9b1eb3b6a09",
   "r": "R version 4.4.3 (2025-02-28)",
   "packages": {
    "jsonlite": "2.0.0"
   },
   "python": "3.11.15",
   "numpy": "2.0.2",
   "scipy": "1.13.1",
   "recordedOn": "2026-10-13",
   "cpu": "AMD EPYC 9V74 80-Core Processor",
   "cpuClass": "x86-64-v3",
   "simd": [
    "SSSE3",
    "SSE41",
    "POPCNT",
    "SSE42",
    "AVX",
    "F16C",
    "FMA3",
    "AVX2"
   ],
   "openblasCore": "Haswell",
   "threads": 1
  },
  "crossCheck": {
   "tool": "R stats mean",
   "version": "R version 4.4.3 (2025-02-28)",
   "script": "pipeline/assay-analyser/oracles/r/viability_normalisation.R",
   "scriptSha256": "54ccb64839835bd3ebd3ee189819d42d16284bb0b1835bb1d5cfaf791b35bc99",
   "ran": true,
   "agreement": "every control mean within 1e-12 relative; the script stops otherwise"
  }
 },
 "oracle": {
  "engine": "Python fractions on the decimal readings"
 },
 "cases": [
  {
   "name": "v01-hand",
   "about": "Blanks 10 and 12, positive 110 and 112, a sample at 61: exactly 50",
   "positive": [
    {
     "value": "110",
     "excluded": false
    },
    {
     "value": "112",
     "excluded": false
    }
   ],
   "negative": [],
   "blank": [
    {
     "value": "10",
     "excluded": false
    },
    {
     "value": "12",
     "excluded": false
    }
   ],
   "samples": [
    {
     "value": "61",
     "excluded": false
    }
   ],
   "expected": {
    "nPositive": 2,
    "nNegative": 0,
    "nBlank": 2,
    "percentVehicleBg": {
     "status": "computed",
     "values": [
      50.0
     ],
     "below": 0,
     "above": 0
    },
    "percentControl": [
     54.95495495495496
    ],
    "blankShare": 9.90990990990991,
    "means": {
     "positive": 111.0,
     "negative": null,
     "blank": 11.0
    }
   }
  },
  {
   "name": "v02-percent-control",
   "about": "The same plate under percent of control: 6100/111, blank share 1100/111",
   "positive": [
    {
     "value": "110",
     "excluded": false
    },
    {
     "value": "112",
     "excluded": false
    }
   ],
   "negative": [],
   "blank": [
    {
     "value": "10",
     "excluded": false
    },
    {
     "value": "12",
     "excluded": false
    }
   ],
   "samples": [
    {
     "value": "61",
     "excluded": false
    }
   ],
   "expected": {
    "nPositive": 2,
    "nNegative": 0,
    "nBlank": 2,
    "percentVehicleBg": {
     "status": "computed",
     "values": [
      50.0
     ],
     "below": 0,
     "above": 0
    },
    "percentControl": [
     54.95495495495496
    ],
    "blankShare": 9.90990990990991,
    "means": {
     "positive": 111.0,
     "negative": null,
     "blank": 11.0
    }
   }
  },
  {
   "name": "v03a-one-blank",
   "about": "One blank: needs-blanks",
   "positive": [
    {
     "value": "110",
     "excluded": false
    },
    {
     "value": "112",
     "excluded": false
    }
   ],
   "negative": [],
   "blank": [
    {
     "value": "10",
     "excluded": false
    }
   ],
   "samples": [
    {
     "value": "61",
     "excluded": false
    }
   ],
   "expected": {
    "nPositive": 2,
    "nNegative": 0,
    "nBlank": 1,
    "percentVehicleBg": {
     "status": "withheld",
     "reason": "needs-blanks"
    },
    "percentControl": [
     54.95495495495496
    ],
    "blankShare": null,
    "means": {
     "positive": 111.0,
     "negative": null,
     "blank": 10.0
    }
   }
  },
  {
   "name": "v03b-two-blanks",
   "about": "Two blanks: shown",
   "positive": [
    {
     "value": "110",
     "excluded": false
    },
    {
     "value": "112",
     "excluded": false
    }
   ],
   "negative": [],
   "blank": [
    {
     "value": "10",
     "excluded": false
    },
    {
     "value": "11",
     "excluded": false
    }
   ],
   "samples": [
    {
     "value": "61",
     "excluded": false
    }
   ],
   "expected": {
    "nPositive": 2,
    "nNegative": 0,
    "nBlank": 2,
    "percentVehicleBg": {
     "status": "computed",
     "values": [
      50.24875621890547
     ],
     "below": 0,
     "above": 0
    },
    "percentControl": [
     54.95495495495496
    ],
    "blankShare": 9.45945945945946,
    "means": {
     "positive": 111.0,
     "negative": null,
     "blank": 10.5
    }
   }
  },
  {
   "name": "v04-one-vehicle",
   "about": "One positive-control well: needs-controls",
   "positive": [
    {
     "value": "110",
     "excluded": false
    }
   ],
   "negative": [],
   "blank": [
    {
     "value": "10",
     "excluded": false
    },
    {
     "value": "12",
     "excluded": false
    }
   ],
   "samples": [
    {
     "value": "61",
     "excluded": false
    }
   ],
   "expected": {
    "nPositive": 1,
    "nNegative": 0,
    "nBlank": 2,
    "percentVehicleBg": {
     "status": "withheld",
     "reason": "needs-controls"
    },
    "percentControl": [
     55.45454545454545
    ],
    "blankShare": 10.0,
    "means": {
     "positive": 110.0,
     "negative": null,
     "blank": 11.0
    }
   }
  },
  {
   "name": "v05a-equal",
   "about": "Positive mean equal to blank mean: vehicle-not-above-blank",
   "positive": [
    {
     "value": "11",
     "excluded": false
    },
    {
     "value": "11",
     "excluded": false
    }
   ],
   "negative": [],
   "blank": [
    {
     "value": "10",
     "excluded": false
    },
    {
     "value": "12",
     "excluded": false
    }
   ],
   "samples": [
    {
     "value": "61",
     "excluded": false
    }
   ],
   "expected": {
    "nPositive": 2,
    "nNegative": 0,
    "nBlank": 2,
    "percentVehicleBg": {
     "status": "withheld",
     "reason": "vehicle-not-above-blank"
    },
    "percentControl": [
     554.5454545454545
    ],
    "blankShare": 100.0,
    "means": {
     "positive": 11.0,
     "negative": null,
     "blank": 11.0
    }
   }
  },
  {
   "name": "v05b-below",
   "about": "Positive mean below blank mean (a readout that rises with death): vehicle-not-above-blank",
   "positive": [
    {
     "value": "5",
     "excluded": false
    },
    {
     "value": "7",
     "excluded": false
    }
   ],
   "negative": [],
   "blank": [
    {
     "value": "10",
     "excluded": false
    },
    {
     "value": "12",
     "excluded": false
    }
   ],
   "samples": [
    {
     "value": "61",
     "excluded": false
    }
   ],
   "expected": {
    "nPositive": 2,
    "nNegative": 0,
    "nBlank": 2,
    "percentVehicleBg": {
     "status": "withheld",
     "reason": "vehicle-not-above-blank"
    },
    "percentControl": [
     1016.6666666666666
    ],
    "blankShare": 183.33333333333334,
    "means": {
     "positive": 6.0,
     "negative": null,
     "blank": 11.0
    }
   }
  },
  {
   "name": "v06-outside",
   "about": "A sample below the blank and one above the positive control: kept, counted",
   "positive": [
    {
     "value": "0.812",
     "excluded": false
    },
    {
     "value": "0.796",
     "excluded": false
    },
    {
     "value": "0.805",
     "excluded": false
    }
   ],
   "negative": [],
   "blank": [
    {
     "value": "0.061",
     "excluded": false
    },
    {
     "value": "0.058",
     "excluded": false
    },
    {
     "value": "0.064",
     "excluded": false
    }
   ],
   "samples": [
    {
     "value": "0.050",
     "excluded": false
    },
    {
     "value": "0.430",
     "excluded": false
    },
    {
     "value": "0.902",
     "excluded": false
    }
   ],
   "expected": {
    "nPositive": 3,
    "nNegative": 0,
    "nBlank": 3,
    "percentVehicleBg": {
     "status": "computed",
     "values": [
      -1.4798206278026906,
      49.64125560538117,
      113.1390134529148
     ],
     "below": 1,
     "above": 1
    },
    "percentControl": [
     6.216328222130128,
     53.46042271031911,
     112.14256112722752
    ],
    "blankShare": 7.583920430998757,
    "means": {
     "positive": 0.8043333333333333,
     "negative": null,
     "blank": 0.061
    }
   }
  },
  {
   "name": "v07-excluded-blank",
   "about": "An excluded blank outlier (0.900) changes nothing",
   "positive": [
    {
     "value": "0.812",
     "excluded": false
    },
    {
     "value": "0.796",
     "excluded": false
    },
    {
     "value": "0.805",
     "excluded": false
    }
   ],
   "negative": [],
   "blank": [
    {
     "value": "0.061",
     "excluded": false
    },
    {
     "value": "0.058",
     "excluded": false
    },
    {
     "value": "0.064",
     "excluded": false
    },
    {
     "value": "0.900",
     "excluded": true
    }
   ],
   "samples": [
    {
     "value": "0.050",
     "excluded": false
    },
    {
     "value": "0.430",
     "excluded": false
    },
    {
     "value": "0.902",
     "excluded": false
    }
   ],
   "expected": {
    "nPositive": 3,
    "nNegative": 0,
    "nBlank": 3,
    "percentVehicleBg": {
     "status": "computed",
     "values": [
      -1.4798206278026906,
      49.64125560538117,
      113.1390134529148
     ],
     "below": 1,
     "above": 1
    },
    "percentControl": [
     6.216328222130128,
     53.46042271031911,
     112.14256112722752
    ],
    "blankShare": 7.583920430998757,
    "means": {
     "positive": 0.8043333333333333,
     "negative": null,
     "blank": 0.061
    }
   }
  },
  {
   "name": "v08-no-blanks",
   "about": "A plate without blanks: withheld (a second plate in the same assay normalises independently)",
   "positive": [
    {
     "value": "1.2",
     "excluded": false
    },
    {
     "value": "1.3",
     "excluded": false
    }
   ],
   "negative": [
    {
     "value": "0.06",
     "excluded": false
    },
    {
     "value": "0.07",
     "excluded": false
    }
   ],
   "blank": [],
   "samples": [
    {
     "value": "0.6",
     "excluded": false
    }
   ],
   "expected": {
    "nPositive": 2,
    "nNegative": 2,
    "nBlank": 0,
    "percentVehicleBg": {
     "status": "withheld",
     "reason": "needs-blanks"
    },
    "percent": [
     45.14767932489451
    ],
    "percentControl": [
     48.0
    ],
    "blankShare": null,
    "means": {
     "positive": 1.25,
     "negative": 0.065,
     "blank": null
    }
   }
  },
  {
   "name": "v10-kill-equals-blank",
   "about": "Kill wells equal to blank wells: percent equals percent-vehicle-bg",
   "positive": [
    {
     "value": "1.20",
     "excluded": false
    },
    {
     "value": "1.30",
     "excluded": false
    }
   ],
   "negative": [
    {
     "value": "0.05",
     "excluded": false
    },
    {
     "value": "0.07",
     "excluded": false
    }
   ],
   "blank": [
    {
     "value": "0.05",
     "excluded": false
    },
    {
     "value": "0.07",
     "excluded": false
    }
   ],
   "samples": [
    {
     "value": "0.30",
     "excluded": false
    },
    {
     "value": "0.65",
     "excluded": false
    },
    {
     "value": "1.00",
     "excluded": false
    }
   ],
   "expected": {
    "nPositive": 2,
    "nNegative": 2,
    "nBlank": 2,
    "percentVehicleBg": {
     "status": "computed",
     "values": [
      20.168067226890756,
      49.57983193277311,
      78.99159663865547
     ],
     "below": 0,
     "above": 0
    },
    "percent": [
     20.168067226890756,
     49.57983193277311,
     78.99159663865547
    ],
    "percentControl": [
     24.0,
     52.0,
     80.0
    ],
    "blankShare": 4.8,
    "means": {
     "positive": 1.25,
     "negative": 0.06,
     "blank": 0.06
    }
   }
  }
 ]
}
