lumicall 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- lumicall-0.1.0/.github/workflows/publish.yml +31 -0
- lumicall-0.1.0/.github/workflows/tests.yml +16 -0
- lumicall-0.1.0/.gitignore +7 -0
- lumicall-0.1.0/CHANGELOG.md +12 -0
- lumicall-0.1.0/CITATION.cff +46 -0
- lumicall-0.1.0/LICENSE +21 -0
- lumicall-0.1.0/PKG-INFO +175 -0
- lumicall-0.1.0/README.md +153 -0
- lumicall-0.1.0/pyproject.toml +34 -0
- lumicall-0.1.0/src/lumicall/__init__.py +22 -0
- lumicall-0.1.0/src/lumicall/calls.py +284 -0
- lumicall-0.1.0/src/lumicall/cli.py +119 -0
- lumicall-0.1.0/src/lumicall/data/example_negatives.txt +30 -0
- lumicall-0.1.0/src/lumicall/data/example_plate.tsv +9 -0
- lumicall-0.1.0/src/lumicall/layout.py +116 -0
- lumicall-0.1.0/src/lumicall/plate.py +143 -0
- lumicall-0.1.0/src/lumicall/reference.py +245 -0
- lumicall-0.1.0/src/lumicall/report.py +197 -0
- lumicall-0.1.0/src/lumicall/simulate.py +56 -0
- lumicall-0.1.0/tests/conftest.py +14 -0
- lumicall-0.1.0/tests/test_calls_cli.py +78 -0
- lumicall-0.1.0/tests/test_layout_plate.py +71 -0
- lumicall-0.1.0/tests/test_reference.py +106 -0
- lumicall-0.1.0/validation/coverage.py +63 -0
- lumicall-0.1.0/validation/coverage_results.md +22 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
name: publish
|
|
2
|
+
on:
|
|
3
|
+
release:
|
|
4
|
+
types: [published]
|
|
5
|
+
workflow_dispatch:
|
|
6
|
+
jobs:
|
|
7
|
+
build:
|
|
8
|
+
runs-on: ubuntu-latest
|
|
9
|
+
steps:
|
|
10
|
+
- uses: actions/checkout@v4
|
|
11
|
+
- uses: actions/setup-python@v5
|
|
12
|
+
with:
|
|
13
|
+
python-version: "3.12"
|
|
14
|
+
- run: pip install build
|
|
15
|
+
- run: python -m build
|
|
16
|
+
- uses: actions/upload-artifact@v4
|
|
17
|
+
with:
|
|
18
|
+
name: dist
|
|
19
|
+
path: dist/
|
|
20
|
+
pypi:
|
|
21
|
+
needs: build
|
|
22
|
+
runs-on: ubuntu-latest
|
|
23
|
+
environment: pypi
|
|
24
|
+
permissions:
|
|
25
|
+
id-token: write
|
|
26
|
+
steps:
|
|
27
|
+
- uses: actions/download-artifact@v4
|
|
28
|
+
with:
|
|
29
|
+
name: dist
|
|
30
|
+
path: dist/
|
|
31
|
+
- uses: pypa/gh-action-pypi-publish@release/v1
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
name: tests
|
|
2
|
+
on: [push, pull_request]
|
|
3
|
+
jobs:
|
|
4
|
+
test:
|
|
5
|
+
runs-on: ${{ matrix.os }}
|
|
6
|
+
strategy:
|
|
7
|
+
matrix:
|
|
8
|
+
os: [ubuntu-latest, windows-latest]
|
|
9
|
+
python: ["3.10", "3.12", "3.13"]
|
|
10
|
+
steps:
|
|
11
|
+
- uses: actions/checkout@v4
|
|
12
|
+
- uses: actions/setup-python@v5
|
|
13
|
+
with:
|
|
14
|
+
python-version: ${{ matrix.python }}
|
|
15
|
+
- run: pip install ".[xlsx,test]"
|
|
16
|
+
- run: pytest -q
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 0.1.0 (2026-11-30)
|
|
4
|
+
|
|
5
|
+
First release.
|
|
6
|
+
|
|
7
|
+
- Plate input: grids from CSV, TSV, TXT and XLSX (decimal commas, several grids per file) and long tables.
|
|
8
|
+
- Default layout of the Anisakis simplex CL-S-ELISA protocol; custom layouts from a table.
|
|
9
|
+
- Reference negatives per matrix; log-scale t prediction p-values, conformal p-values, Benjamini-Hochberg q-values.
|
|
10
|
+
- Run acceptance as in the protocol, run limit of detection from the P1 and P10 controls.
|
|
11
|
+
- Calls with retest rules (discordant wells, duplicate CV, repeatability zone) and the protocol rule shown alongside.
|
|
12
|
+
- CSV, JSON and HTML reports; command line interface; plate simulator; validation script.
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
cff-version: 1.2.0
|
|
2
|
+
message: "If you use this software, please cite it as below."
|
|
3
|
+
title: "lumicall: calibrated calls for qualitative chemiluminescent plate immunoassays"
|
|
4
|
+
type: software
|
|
5
|
+
version: 0.1.0
|
|
6
|
+
date-released: 2026-11-30
|
|
7
|
+
license: MIT
|
|
8
|
+
authors:
|
|
9
|
+
- family-names: Kochanowski
|
|
10
|
+
given-names: Maciej
|
|
11
|
+
orcid: "https://orcid.org/0000-0002-9982-3028"
|
|
12
|
+
email: maciej.kochanowski@piwet.pulawy.pl
|
|
13
|
+
affiliation: "Department of Bacteriology and Bacterial Animal Diseases, National Veterinary Research Institute, 57 Partyzantów Avenue, 24-100 Puławy, Poland"
|
|
14
|
+
keywords:
|
|
15
|
+
- ELISA
|
|
16
|
+
- chemiluminescence
|
|
17
|
+
- immunoassay
|
|
18
|
+
- cut-off
|
|
19
|
+
- prediction limit
|
|
20
|
+
- conformal p-value
|
|
21
|
+
references:
|
|
22
|
+
- type: article
|
|
23
|
+
title: "Development and application of novel chemiluminescence immunoassays for highly sensitive detection of Anisakis simplex proteins in thermally processed seafood"
|
|
24
|
+
authors:
|
|
25
|
+
- family-names: Kochanowski
|
|
26
|
+
given-names: Maciej
|
|
27
|
+
- family-names: Różycki
|
|
28
|
+
given-names: M.
|
|
29
|
+
- family-names: Dąbrowska
|
|
30
|
+
given-names: Joanna
|
|
31
|
+
- family-names: Karamon
|
|
32
|
+
given-names: J.
|
|
33
|
+
- family-names: Sroka
|
|
34
|
+
given-names: Jacek
|
|
35
|
+
- family-names: Antolak
|
|
36
|
+
given-names: E.
|
|
37
|
+
- family-names: Bełcik
|
|
38
|
+
given-names: A.
|
|
39
|
+
- family-names: Cencek
|
|
40
|
+
given-names: T.
|
|
41
|
+
journal: Pathogens
|
|
42
|
+
volume: 9
|
|
43
|
+
issue: 10
|
|
44
|
+
start: 777
|
|
45
|
+
year: 2020
|
|
46
|
+
doi: 10.3390/pathogens9100777
|
lumicall-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Maciej Kochanowski
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
lumicall-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: lumicall
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Calibrated calls for qualitative chemiluminescent plate immunoassays
|
|
5
|
+
Author-email: Maciej Kochanowski <maciej.kochanowski@piwet.pulawy.pl>
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
License-File: LICENSE
|
|
8
|
+
Keywords: ELISA,chemiluminescence,conformal p-value,cut-off,food safety,immunoassay,prediction limit
|
|
9
|
+
Classifier: Intended Audience :: Science/Research
|
|
10
|
+
Classifier: Operating System :: OS Independent
|
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
|
|
13
|
+
Requires-Python: >=3.10
|
|
14
|
+
Requires-Dist: numpy>=1.23
|
|
15
|
+
Requires-Dist: pandas>=1.5
|
|
16
|
+
Requires-Dist: scipy>=1.9
|
|
17
|
+
Provides-Extra: test
|
|
18
|
+
Requires-Dist: pytest>=7; extra == 'test'
|
|
19
|
+
Provides-Extra: xlsx
|
|
20
|
+
Requires-Dist: openpyxl>=3.1; extra == 'xlsx'
|
|
21
|
+
Description-Content-Type: text/markdown
|
|
22
|
+
|
|
23
|
+
# lumicall
|
|
24
|
+
|
|
25
|
+
Calibrated calls for qualitative chemiluminescent plate immunoassays.
|
|
26
|
+
|
|
27
|
+
`lumicall` reads a 96-well plate of relative light units (RLU), checks run acceptance,
|
|
28
|
+
and gives every sample a p-value and a call (detected, not detected, retest) whose
|
|
29
|
+
per-sample false-positive rate is set by the user. It reports the run's own limit
|
|
30
|
+
of detection in concentration units, and it always shows the result of the
|
|
31
|
+
conventional rule (mean + 3 SD of negatives) alongside, so that changed calls are visible.
|
|
32
|
+
|
|
33
|
+
The default configuration is the *Anisakis simplex* chemiluminescent sandwich ELISA
|
|
34
|
+
(CL-S-ELISA) protocol: Luminoskan reads, controls Blank, Neg, P10 and P1 in A1 to D2,
|
|
35
|
+
samples S1 to S44 in horizontal duplicate pairs, limit of detection 0.5 ng/mL
|
|
36
|
+
(Kochanowski et al. 2020, *Pathogens* 9:777). Any layout can be supplied as a table.
|
|
37
|
+
|
|
38
|
+
## Why
|
|
39
|
+
|
|
40
|
+
A common cut-off is the arithmetic mean + 3 SD of analyte-free samples, which is meant to
|
|
41
|
+
give 0.135% false positives. It does not when RLU of negatives are right-skewed or few,
|
|
42
|
+
as `validation/coverage.py` shows (expected per-sample false-positive rate for a new negative):
|
|
43
|
+
|
|
44
|
+
| Negatives | SD of ln RLU | n | mean + 3 SD | Frey 95% on raw RLU | lumicall, alpha 1% |
|
|
45
|
+
| --- | --- | --- | --- | --- | --- |
|
|
46
|
+
| lognormal | 0.30 | 5 | 4.69% | 7.50% | 0.94% |
|
|
47
|
+
| lognormal | 0.30 | 30 | 1.45% | 6.80% | 0.98% |
|
|
48
|
+
| lognormal | 0.60 | 30 | 2.61% | 7.44% | 0.99% |
|
|
49
|
+
|
|
50
|
+
The full table, including negatives that are normal on the raw scale, is in
|
|
51
|
+
`validation/coverage_results.md`.
|
|
52
|
+
|
|
53
|
+
## Install
|
|
54
|
+
|
|
55
|
+
```
|
|
56
|
+
pip install lumicall # once released; until then: pip install .
|
|
57
|
+
pip install "lumicall[xlsx]" # to read .xlsx exports
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Python 3.10 or later; depends on numpy, scipy and pandas.
|
|
61
|
+
|
|
62
|
+
## Quick start
|
|
63
|
+
|
|
64
|
+
```
|
|
65
|
+
lumicall example --out demo
|
|
66
|
+
lumicall reference demo/example_negatives.txt --out demo/reference.json
|
|
67
|
+
lumicall run demo/example_plate.tsv --reference demo/reference.json --out demo/report
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
The example data are synthetic (the same as in the protocol's online calculator).
|
|
71
|
+
`run` writes `samples.csv`, `controls.csv`, `summary.json` and a self-contained
|
|
72
|
+
`report.html`. The exit code is 0 for an accepted run, 2 for a rejected run and 1 for an error.
|
|
73
|
+
|
|
74
|
+
From Python:
|
|
75
|
+
|
|
76
|
+
```python
|
|
77
|
+
from lumicall import analyse_run, anisakis_cl_elisa, read_negatives, read_plate, Settings
|
|
78
|
+
|
|
79
|
+
ref = read_negatives("negatives.csv").get(None)
|
|
80
|
+
res = analyse_run(read_plate("plate.xlsx"), anisakis_cl_elisa(), ref, Settings(alpha=0.01))
|
|
81
|
+
print(res.run_ok, res.cutoff, res.samples[["sample_id", "p_model", "call"]])
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
## Inputs
|
|
85
|
+
|
|
86
|
+
**Plate.** A grid with rows labelled A to H and twelve values each, in CSV, TSV, TXT
|
|
87
|
+
or XLSX, as exported by SkanIt or Gen5 or pasted from a spreadsheet; decimal commas are
|
|
88
|
+
accepted. If a file holds several grids (for example two reads), `--block` selects one.
|
|
89
|
+
A long table with columns `well` and `rlu` is also accepted.
|
|
90
|
+
|
|
91
|
+
**Reference negatives.** Analyte-free samples of the same matrix, processed and read as
|
|
92
|
+
routine samples. Either a table with one or more columns whose names start with `rlu`
|
|
93
|
+
(replicate wells) and optional `sample_id` and `matrix` columns, or one value per line.
|
|
94
|
+
A file with several matrices gives one reference per matrix; choose with `--matrix`.
|
|
95
|
+
|
|
96
|
+
**Layout.** `anisakis` (default) or a table with columns `well`, `role`
|
|
97
|
+
(`blank`, `neg`, `p10`, `p1`, `sample`), `sample_id` and optional `matrix`.
|
|
98
|
+
Sample names can be supplied in plate order with `--ids`.
|
|
99
|
+
|
|
100
|
+
## Method
|
|
101
|
+
|
|
102
|
+
Each sample is summarised by y, the mean of ln(RLU) over its wells. For n reference
|
|
103
|
+
negatives with mean m and SD s of y, a new negative sample satisfies, if y is normal,
|
|
104
|
+
|
|
105
|
+
```
|
|
106
|
+
(y - m) / (s * sqrt(1 + 1/n)) ~ t with n - 1 degrees of freedom
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
The model p-value is the upper tail of this t distribution; it is exactly uniform for a
|
|
110
|
+
new negative, for any n of 3 or more. A sample is called detected when p <= alpha, which is
|
|
111
|
+
the same as comparing its geometric mean with the cut-off
|
|
112
|
+
exp(m + t[1 - alpha, n - 1] * s * sqrt(1 + 1/n)), the prediction limit of Frey et al. (1998)
|
|
113
|
+
on the log scale.
|
|
114
|
+
|
|
115
|
+
The conformal p-value (1 + number of reference values >= y) / (n + 1) is valid without any
|
|
116
|
+
distributional assumption but cannot fall below 1/(n + 1). When it can reach alpha
|
|
117
|
+
(n >= 1/alpha - 1), the report flags samples on which it disagrees with the model.
|
|
118
|
+
|
|
119
|
+
A sample is a retest when its wells fall on both sides of the cut-off, when a detected
|
|
120
|
+
sample has a duplicate CV above 15%, or when its summary lies within 1.96 standard errors
|
|
121
|
+
of the cut-off. The standard error uses the within-pair SD of ln(RLU), estimated robustly
|
|
122
|
+
from the plate's duplicates (1.4826 * median |ln a - ln b| / sqrt 2) or set from a precision
|
|
123
|
+
study with `--repeatability-cv`. Benjamini-Hochberg q-values are reported for screening
|
|
124
|
+
use. The expected number of false positives on a plate is at most alpha times the number
|
|
125
|
+
of samples.
|
|
126
|
+
|
|
127
|
+
Run acceptance follows the protocol: blank and negative-matrix control below the cut-off
|
|
128
|
+
in both wells, P10 above the cut-off with duplicate CV <= 15%, and P1 above the cut-off as
|
|
129
|
+
a sensitivity check. The run limit of detection is the concentration whose expected signal
|
|
130
|
+
equals the cut-off, from the net signals of P1 (= LOD) and P10 (= 10 x LOD) above the
|
|
131
|
+
negative-matrix control, assumed linear on log-log scales; a run whose limit exceeds the
|
|
132
|
+
validated LOD is flagged.
|
|
133
|
+
|
|
134
|
+
## Validation
|
|
135
|
+
|
|
136
|
+
- `tests/` (26 tests): the Frey multiplier for n = 3 (3.372); the model p-value equals
|
|
137
|
+
alpha at the cut-off; simulated calibration of the model p-value for n = 3, 5, 10, 30 and
|
|
138
|
+
validity of the conformal p-value under heavy-tailed data; Benjamini-Hochberg against
|
|
139
|
+
`scipy.stats.false_discovery_control`; recovery of the run LOD on noise-free plates with
|
|
140
|
+
log-log slopes 1.0 and 0.8; reproduction of the protocol calculator on its example plate
|
|
141
|
+
(cut-off 39.6 RLU; 8 detected, 34 not detected, 2 retest); plate, layout and CLI input, including semicolon-separated files with decimal commas.
|
|
142
|
+
- `validation/coverage.py`: the per-sample false-positive rate of the rules above under
|
|
143
|
+
lognormal negatives and under negatives that are normal on the raw scale. lumicall holds
|
|
144
|
+
alpha under lognormal negatives and is conservative when negatives are normal on the raw
|
|
145
|
+
scale (for example 0.35% at alpha 1% with CV 0.15 and n = 30).
|
|
146
|
+
|
|
147
|
+
Note on run acceptance: the negative-matrix control is itself a negative sample, so it
|
|
148
|
+
occasionally exceeds the cut-off in a valid run. In simulation (SD of ln RLU 0.15 between
|
|
149
|
+
samples, well CV 3%), that check rejected 1.3% of valid runs with lumicall at alpha 1% and
|
|
150
|
+
1.1% with the mean + 3 SD cut-off.
|
|
151
|
+
|
|
152
|
+
## Limitations of version 0.1
|
|
153
|
+
|
|
154
|
+
- Readings at or below the reader floor (censored values) are refused in the reference.
|
|
155
|
+
- One reference per matrix; information is not yet shared between matrices or runs.
|
|
156
|
+
- Optical crosstalk between wells is not modelled.
|
|
157
|
+
- The SkanIt and Gen5 readers are tested on grid exports, not yet on files from every
|
|
158
|
+
software version.
|
|
159
|
+
|
|
160
|
+
Planned: censoring at the reader floor and saturation, a reference model shared across
|
|
161
|
+
matrices and runs with the P10 control as a covariate, pooled conformal p-values, a
|
|
162
|
+
crosstalk check from a calibration plate, and a POD curve with LOD95 in the validation report.
|
|
163
|
+
|
|
164
|
+
## Citation
|
|
165
|
+
|
|
166
|
+
If you use lumicall, cite the software (see `CITATION.cff`) and, for the default assay,
|
|
167
|
+
Kochanowski M, et al. (2020) *Pathogens* 9(10):777, doi:10.3390/pathogens9100777.
|
|
168
|
+
|
|
169
|
+
Frey A, Di Canzio J, Zurakowski D (1998) A statistically defined endpoint titer
|
|
170
|
+
determination method for immunoassays. *J Immunol Methods* 221:35-41.
|
|
171
|
+
|
|
172
|
+
## Licence
|
|
173
|
+
|
|
174
|
+
MIT. Copyright (c) 2026 Maciej Kochanowski, National Veterinary Research Institute,
|
|
175
|
+
Puławy, Poland.
|
lumicall-0.1.0/README.md
ADDED
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
# lumicall
|
|
2
|
+
|
|
3
|
+
Calibrated calls for qualitative chemiluminescent plate immunoassays.
|
|
4
|
+
|
|
5
|
+
`lumicall` reads a 96-well plate of relative light units (RLU), checks run acceptance,
|
|
6
|
+
and gives every sample a p-value and a call (detected, not detected, retest) whose
|
|
7
|
+
per-sample false-positive rate is set by the user. It reports the run's own limit
|
|
8
|
+
of detection in concentration units, and it always shows the result of the
|
|
9
|
+
conventional rule (mean + 3 SD of negatives) alongside, so that changed calls are visible.
|
|
10
|
+
|
|
11
|
+
The default configuration is the *Anisakis simplex* chemiluminescent sandwich ELISA
|
|
12
|
+
(CL-S-ELISA) protocol: Luminoskan reads, controls Blank, Neg, P10 and P1 in A1 to D2,
|
|
13
|
+
samples S1 to S44 in horizontal duplicate pairs, limit of detection 0.5 ng/mL
|
|
14
|
+
(Kochanowski et al. 2020, *Pathogens* 9:777). Any layout can be supplied as a table.
|
|
15
|
+
|
|
16
|
+
## Why
|
|
17
|
+
|
|
18
|
+
A common cut-off is the arithmetic mean + 3 SD of analyte-free samples, which is meant to
|
|
19
|
+
give 0.135% false positives. It does not when RLU of negatives are right-skewed or few,
|
|
20
|
+
as `validation/coverage.py` shows (expected per-sample false-positive rate for a new negative):
|
|
21
|
+
|
|
22
|
+
| Negatives | SD of ln RLU | n | mean + 3 SD | Frey 95% on raw RLU | lumicall, alpha 1% |
|
|
23
|
+
| --- | --- | --- | --- | --- | --- |
|
|
24
|
+
| lognormal | 0.30 | 5 | 4.69% | 7.50% | 0.94% |
|
|
25
|
+
| lognormal | 0.30 | 30 | 1.45% | 6.80% | 0.98% |
|
|
26
|
+
| lognormal | 0.60 | 30 | 2.61% | 7.44% | 0.99% |
|
|
27
|
+
|
|
28
|
+
The full table, including negatives that are normal on the raw scale, is in
|
|
29
|
+
`validation/coverage_results.md`.
|
|
30
|
+
|
|
31
|
+
## Install
|
|
32
|
+
|
|
33
|
+
```
|
|
34
|
+
pip install lumicall # once released; until then: pip install .
|
|
35
|
+
pip install "lumicall[xlsx]" # to read .xlsx exports
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Python 3.10 or later; depends on numpy, scipy and pandas.
|
|
39
|
+
|
|
40
|
+
## Quick start
|
|
41
|
+
|
|
42
|
+
```
|
|
43
|
+
lumicall example --out demo
|
|
44
|
+
lumicall reference demo/example_negatives.txt --out demo/reference.json
|
|
45
|
+
lumicall run demo/example_plate.tsv --reference demo/reference.json --out demo/report
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
The example data are synthetic (the same as in the protocol's online calculator).
|
|
49
|
+
`run` writes `samples.csv`, `controls.csv`, `summary.json` and a self-contained
|
|
50
|
+
`report.html`. The exit code is 0 for an accepted run, 2 for a rejected run and 1 for an error.
|
|
51
|
+
|
|
52
|
+
From Python:
|
|
53
|
+
|
|
54
|
+
```python
|
|
55
|
+
from lumicall import analyse_run, anisakis_cl_elisa, read_negatives, read_plate, Settings
|
|
56
|
+
|
|
57
|
+
ref = read_negatives("negatives.csv").get(None)
|
|
58
|
+
res = analyse_run(read_plate("plate.xlsx"), anisakis_cl_elisa(), ref, Settings(alpha=0.01))
|
|
59
|
+
print(res.run_ok, res.cutoff, res.samples[["sample_id", "p_model", "call"]])
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## Inputs
|
|
63
|
+
|
|
64
|
+
**Plate.** A grid with rows labelled A to H and twelve values each, in CSV, TSV, TXT
|
|
65
|
+
or XLSX, as exported by SkanIt or Gen5 or pasted from a spreadsheet; decimal commas are
|
|
66
|
+
accepted. If a file holds several grids (for example two reads), `--block` selects one.
|
|
67
|
+
A long table with columns `well` and `rlu` is also accepted.
|
|
68
|
+
|
|
69
|
+
**Reference negatives.** Analyte-free samples of the same matrix, processed and read as
|
|
70
|
+
routine samples. Either a table with one or more columns whose names start with `rlu`
|
|
71
|
+
(replicate wells) and optional `sample_id` and `matrix` columns, or one value per line.
|
|
72
|
+
A file with several matrices gives one reference per matrix; choose with `--matrix`.
|
|
73
|
+
|
|
74
|
+
**Layout.** `anisakis` (default) or a table with columns `well`, `role`
|
|
75
|
+
(`blank`, `neg`, `p10`, `p1`, `sample`), `sample_id` and optional `matrix`.
|
|
76
|
+
Sample names can be supplied in plate order with `--ids`.
|
|
77
|
+
|
|
78
|
+
## Method
|
|
79
|
+
|
|
80
|
+
Each sample is summarised by y, the mean of ln(RLU) over its wells. For n reference
|
|
81
|
+
negatives with mean m and SD s of y, a new negative sample satisfies, if y is normal,
|
|
82
|
+
|
|
83
|
+
```
|
|
84
|
+
(y - m) / (s * sqrt(1 + 1/n)) ~ t with n - 1 degrees of freedom
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
The model p-value is the upper tail of this t distribution; it is exactly uniform for a
|
|
88
|
+
new negative, for any n of 3 or more. A sample is called detected when p <= alpha, which is
|
|
89
|
+
the same as comparing its geometric mean with the cut-off
|
|
90
|
+
exp(m + t[1 - alpha, n - 1] * s * sqrt(1 + 1/n)), the prediction limit of Frey et al. (1998)
|
|
91
|
+
on the log scale.
|
|
92
|
+
|
|
93
|
+
The conformal p-value (1 + number of reference values >= y) / (n + 1) is valid without any
|
|
94
|
+
distributional assumption but cannot fall below 1/(n + 1). When it can reach alpha
|
|
95
|
+
(n >= 1/alpha - 1), the report flags samples on which it disagrees with the model.
|
|
96
|
+
|
|
97
|
+
A sample is a retest when its wells fall on both sides of the cut-off, when a detected
|
|
98
|
+
sample has a duplicate CV above 15%, or when its summary lies within 1.96 standard errors
|
|
99
|
+
of the cut-off. The standard error uses the within-pair SD of ln(RLU), estimated robustly
|
|
100
|
+
from the plate's duplicates (1.4826 * median |ln a - ln b| / sqrt 2) or set from a precision
|
|
101
|
+
study with `--repeatability-cv`. Benjamini-Hochberg q-values are reported for screening
|
|
102
|
+
use. The expected number of false positives on a plate is at most alpha times the number
|
|
103
|
+
of samples.
|
|
104
|
+
|
|
105
|
+
Run acceptance follows the protocol: blank and negative-matrix control below the cut-off
|
|
106
|
+
in both wells, P10 above the cut-off with duplicate CV <= 15%, and P1 above the cut-off as
|
|
107
|
+
a sensitivity check. The run limit of detection is the concentration whose expected signal
|
|
108
|
+
equals the cut-off, from the net signals of P1 (= LOD) and P10 (= 10 x LOD) above the
|
|
109
|
+
negative-matrix control, assumed linear on log-log scales; a run whose limit exceeds the
|
|
110
|
+
validated LOD is flagged.
|
|
111
|
+
|
|
112
|
+
## Validation
|
|
113
|
+
|
|
114
|
+
- `tests/` (26 tests): the Frey multiplier for n = 3 (3.372); the model p-value equals
|
|
115
|
+
alpha at the cut-off; simulated calibration of the model p-value for n = 3, 5, 10, 30 and
|
|
116
|
+
validity of the conformal p-value under heavy-tailed data; Benjamini-Hochberg against
|
|
117
|
+
`scipy.stats.false_discovery_control`; recovery of the run LOD on noise-free plates with
|
|
118
|
+
log-log slopes 1.0 and 0.8; reproduction of the protocol calculator on its example plate
|
|
119
|
+
(cut-off 39.6 RLU; 8 detected, 34 not detected, 2 retest); plate, layout and CLI input, including semicolon-separated files with decimal commas.
|
|
120
|
+
- `validation/coverage.py`: the per-sample false-positive rate of the rules above under
|
|
121
|
+
lognormal negatives and under negatives that are normal on the raw scale. lumicall holds
|
|
122
|
+
alpha under lognormal negatives and is conservative when negatives are normal on the raw
|
|
123
|
+
scale (for example 0.35% at alpha 1% with CV 0.15 and n = 30).
|
|
124
|
+
|
|
125
|
+
Note on run acceptance: the negative-matrix control is itself a negative sample, so it
|
|
126
|
+
occasionally exceeds the cut-off in a valid run. In simulation (SD of ln RLU 0.15 between
|
|
127
|
+
samples, well CV 3%), that check rejected 1.3% of valid runs with lumicall at alpha 1% and
|
|
128
|
+
1.1% with the mean + 3 SD cut-off.
|
|
129
|
+
|
|
130
|
+
## Limitations of version 0.1
|
|
131
|
+
|
|
132
|
+
- Readings at or below the reader floor (censored values) are refused in the reference.
|
|
133
|
+
- One reference per matrix; information is not yet shared between matrices or runs.
|
|
134
|
+
- Optical crosstalk between wells is not modelled.
|
|
135
|
+
- The SkanIt and Gen5 readers are tested on grid exports, not yet on files from every
|
|
136
|
+
software version.
|
|
137
|
+
|
|
138
|
+
Planned: censoring at the reader floor and saturation, a reference model shared across
|
|
139
|
+
matrices and runs with the P10 control as a covariate, pooled conformal p-values, a
|
|
140
|
+
crosstalk check from a calibration plate, and a POD curve with LOD95 in the validation report.
|
|
141
|
+
|
|
142
|
+
## Citation
|
|
143
|
+
|
|
144
|
+
If you use lumicall, cite the software (see `CITATION.cff`) and, for the default assay,
|
|
145
|
+
Kochanowski M, et al. (2020) *Pathogens* 9(10):777, doi:10.3390/pathogens9100777.
|
|
146
|
+
|
|
147
|
+
Frey A, Di Canzio J, Zurakowski D (1998) A statistically defined endpoint titer
|
|
148
|
+
determination method for immunoassays. *J Immunol Methods* 221:35-41.
|
|
149
|
+
|
|
150
|
+
## Licence
|
|
151
|
+
|
|
152
|
+
MIT. Copyright (c) 2026 Maciej Kochanowski, National Veterinary Research Institute,
|
|
153
|
+
Puławy, Poland.
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling>=1.21"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "lumicall"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "Calibrated calls for qualitative chemiluminescent plate immunoassays"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = "MIT"
|
|
11
|
+
license-files = ["LICENSE"]
|
|
12
|
+
requires-python = ">=3.10"
|
|
13
|
+
authors = [{ name = "Maciej Kochanowski", email = "maciej.kochanowski@piwet.pulawy.pl" }]
|
|
14
|
+
keywords = ["ELISA", "chemiluminescence", "immunoassay", "cut-off", "prediction limit", "conformal p-value", "food safety"]
|
|
15
|
+
classifiers = [
|
|
16
|
+
"Programming Language :: Python :: 3",
|
|
17
|
+
"Intended Audience :: Science/Research",
|
|
18
|
+
"Topic :: Scientific/Engineering :: Bio-Informatics",
|
|
19
|
+
"Operating System :: OS Independent",
|
|
20
|
+
]
|
|
21
|
+
dependencies = ["numpy>=1.23", "scipy>=1.9", "pandas>=1.5"]
|
|
22
|
+
|
|
23
|
+
[project.optional-dependencies]
|
|
24
|
+
xlsx = ["openpyxl>=3.1"]
|
|
25
|
+
test = ["pytest>=7"]
|
|
26
|
+
|
|
27
|
+
[project.scripts]
|
|
28
|
+
lumicall = "lumicall.cli:main"
|
|
29
|
+
|
|
30
|
+
[tool.hatch.build.targets.wheel]
|
|
31
|
+
packages = ["src/lumicall"]
|
|
32
|
+
|
|
33
|
+
[tool.pytest.ini_options]
|
|
34
|
+
testpaths = ["tests"]
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"""lumicall: calibrated calls for qualitative chemiluminescent plate immunoassays."""
|
|
2
|
+
|
|
3
|
+
__version__ = "0.1.0"
|
|
4
|
+
|
|
5
|
+
from .calls import RunResult, Settings, analyse_run # noqa: E402
|
|
6
|
+
from .layout import Layout, anisakis_cl_elisa, read_layout # noqa: E402
|
|
7
|
+
from .plate import read_plate # noqa: E402
|
|
8
|
+
from .reference import MatrixReference, Reference, read_negatives # noqa: E402
|
|
9
|
+
|
|
10
|
+
__all__ = [
|
|
11
|
+
"__version__",
|
|
12
|
+
"Layout",
|
|
13
|
+
"MatrixReference",
|
|
14
|
+
"Reference",
|
|
15
|
+
"RunResult",
|
|
16
|
+
"Settings",
|
|
17
|
+
"analyse_run",
|
|
18
|
+
"anisakis_cl_elisa",
|
|
19
|
+
"read_layout",
|
|
20
|
+
"read_negatives",
|
|
21
|
+
"read_plate",
|
|
22
|
+
]
|