mpn-lookup
v1.1.2
Published
A TypeScript library for Most Probable Number (MPN) lookups in microbiological testing, supporting QuantiTray, QuantiTray2000, and Legionella formats
Maintainers
Readme
mpn-lookup
A simple tool for when you don't want to use, or simply can't find, the various reference PDF's for the QuantiTray system.
Built with:
For the work I used the following tools:
Installation
npm install mpn-lookup
# or
pnpm add mpn-lookup
# or
yarn add mpn-lookupQuick Start
import { getQtMpn, getQt2KMpn, getQtLegio } from 'mpn-lookup';
// Standard QuantiTray lookup (0-51 positive wells)
const result = getQtMpn(10);
if (result) {
const [lower, estimate, upper] = result;
console.log(`MPN: ${estimate} (${lower} - ${upper})`);
// Output: MPN: 5.3 (2.3 - 12.3)
}
// QuantiTray 2000 lookup (large pos: 0-49, small pos: 0-48)
const result2k = getQt2KMpn(10, 25);
if (result2k) {
const [lower, estimate, upper] = result2k;
console.log(`2K MPN: ${estimate} (${lower} - ${upper})`);
}
// Legionella lookup (large pos: 0-6, small pos: 0-90)
const legioResult = getQtLegio(3, 45);
if (legioResult !== undefined) {
console.log(`Legionella MPN: ${legioResult}`);
}API Reference
getQtMpn(positiveWells: number): MpnResult | undefined
Returns MPN values for standard QuantiTray testing.
- positiveWells: Number of positive wells (0-51)
- Returns:
[lowerBound, estimate, upperBound]tuple orundefinedfor invalid inputs
getQt2KMpn(largePos: number, smallPos: number): MpnResult | undefined
Returns MPN values for QuantiTray 2000 high-throughput testing.
- largePos: Large position index (0-49)
- smallPos: Small position index (0-48)
- Returns:
[lowerBound, estimate, upperBound]tuple orundefinedfor invalid inputs
getQtLegio(largePos: number, smallPos: number): string | number | undefined
Returns MPN values for Legionella testing.
- largePos: Large position index (0-6)
- smallPos: Small position index (0-90)
- Returns: Single MPN value or
undefinedfor invalid inputs
Development
# Clone and setup
git clone https://github.com/jonathan-gartland/mpn-lookup.git
cd mpn-lookup
pnpm install
# Run tests
pnpm test
# Build library
pnpm build
# Run all checks (lint, type-check, test)
pnpm run check-allExample use in REPL:


Example Apps that uses the mpn-lookup library
https://github.com/jonathan-gartland/mpn-lookup-nextjs
https://github.com/jonathan-gartland/MpnLookupRN
