Reference model and verification
This implementation follows Reiber's 1994 hyperbolic model, not a linear IgG index. The equations are shared by the charts, classification, CSV output and reports in src/lib/reiber.ts. A mathematical match to published equations is not clinical validation of this software.
Equations and units
For each protein, Q = concentration(CSF) / concentration(serum) with both concentrations in the same unit. These ratios are dimensionless. The application stores and displays quotient numbers in ×10⁻³: entering 6 means Q = 0.006. Form and CSV concentration values are mg/L for both fluids. Convert serum g/L to mg/L by multiplying by 1,000. The retained PDF prints mg/dL; export converts protein concentrations by dividing by 10.
The upper and lower reference curves use:
Q(QAlb) = A × sqrt(QAlb² + B × 10⁻⁶) − C × 10⁻³| Isotype | Curve | A | B | C |
|---|---|---|---|---|
| IgG | Qlim | 0.93 | 6 | 1.7 |
| IgG | Qlow | 0.33 | 2 | 0.3 |
| IgA | Qlim | 0.77 | 23 | 3.1 |
| IgA | Qlow | 0.17 | 74 | 1.3 |
| IgM | Qlim | 0.67 | 120 | 7.1 |
| IgM | Qlow | 0.04 | 442 | 0.82 |
These coefficients are reproduced in Metzger et al., 2017, Table 1, referencing Reiber, 1994.
IF (%) = (1 − Qlim / QIg) × 100
LOC (mg/L) = (QIg − Qlim) × serum Ig (mg/L)
QIg on a percentage curve = Qlim / (1 − IF / 100)The percentage curves are therefore not Qlim × (1 + IF/100). IF and LOC are derived from the corresponding isotype, using full precision. Missing values, zero divisors and negative calculated IF/LOC display as dashes; exact equality with Qlim gives zero. LOC requires the matching serum concentration. The calculation follows Reiber, 1995, p. 258.
Age, regions and reporting
The classical lumbar CSF age reference is QAlb,lim = (4 + age/15) × 10⁻³. Reiber's interpretation guide specifies the simplified rule for ages above five years. This application therefore rejects ages ≤5 rather than extrapolating it; 120 remains an application input ceiling. It does not implement separate pediatric, ventricular or cisternal reference limits.
| Region | Implemented position |
|---|---|
| 1 | Qlow ≤ QIg ≤ Qlim; QAlb below age limit |
| 2 | Qlow ≤ QIg ≤ Qlim; QAlb at/above age limit |
| 3 | QIg > Qlim; QAlb at/above age limit |
| 4 | QIg > Qlim; QAlb below age limit |
| 5 | QIg < Qlow; review measurement and context |
Exact Qlim/Qlow equality belongs to the reference band. The classical normal QAlb interval is treated as open at its age limit. Comparisons account only for floating-point round-trip error, not an assumed laboratory uncertainty.
Crossing Qlim and the reporting recommendation are separate: 0 < IF ≤10% is flagged as borderline; IF >10% exceeds Reiber's reporting threshold. A normal quantitative quotient does not exclude CSF-restricted oligoclonal IgG. These are model descriptions, not disease diagnoses. Reiber's interpretation guide
Alternative reference populations exist. Hegen et al., 2016 reported QAlb,lim × 10³ = age/25 + 8 for adults aged 18–70, using a 95th percentile. It is not silently substituted for the classical model. Choosing a laboratory reference protocol requires laboratory validation.
Display and cohort calculations
- All three plots use the same double-logarithmic axes: QAlb 0.5–100 and QIg 0.1–100, each in ×10⁻³. Positive values outside those axes and zero values remain in the table, with an annotation inside the exported diagram. They are never clamped into the plot or silently discarded from calculations.
- The 20/40/60/80% curves and individual-sample regions are labeled. PNG and PDF exports preserve the chart's aspect ratio.
- Cohort markers show age Q1, median and Q3 using type-7 linear interpolation. Ages
[20, 40, 60, 80]produce[35, 50, 65]. A cohort age line is descriptive; classification always uses each sample's own age. - Offset classes enumerate regions intersecting the rectangle obtained by varying both quotients by ±the selected fraction. Testing only four corners misses intermediate regions. This sensitivity analysis is not a confidence interval or the separate 10% IF reporting rule.
What was verified
Fixed test values in tests/fixtures/reiber-reference.json independently reproduce all six curves with Python Decimal at 50-digit precision. They cover QAlb 0.0005–0.1. Additional checks cover published rounded examples, exact/near boundaries, percentage curves, zero/missing inputs, unsupported ages, IF/LOC, true cohort medians and regions missed by corner-only sensitivity analysis.
Browser tests check diagram coordinates and labels, classification after raw input near Qlim, cohort age handling, and actual exported PDF fields. The PDF conversion is checked for all eight protein concentration fields. The legacy 599-row fixture contains six rows aged five; it is now correctly rejected at the first unsupported row (CSV line 111), while a separate 599-sample supported cohort checks pagination and plotting.
This verifies the documented computational contract. It cannot establish analytical quality of input measurements or certify clinical safety; independent laboratory review and validation remain necessary for clinical use.
Derived classification, IF, LOC and review columns are discarded on CSV re-import and recomputed on classification export, so stale results and case-normalized duplicate headers cannot override the current model. Raw measured data and other metadata are preserved.