Package 'MPN'

Title: Most Probable Number and Other Microbial Enumeration Techniques
Description: Calculates the Most Probable Number (MPN) to quantify the concentration (density) of microbes in serial dilutions of a laboratory sample (described in Jarvis, 2010 <doi:10.1111/j.1365-2672.2010.04792.x>). Also calculates the Aerobic Plate Count (APC) for similar microbial enumeration experiments.
Authors: Martine Ferguson [aut] (original R code), John Ihrie [cre, aut]
Maintainer: John Ihrie <[email protected]>
License: Unlimited
Version: 0.5.0
Built: 2026-07-23 22:43:22 UTC
Source: https://github.com/cran/MPN

Help Index


Calculate aerobic plate count (APC)

Description

apc calculates the Aerobic Plate Count (APC) point estimate and confidence interval of colony forming units (CFU). Adjusts for too-numerous-to-count (TNTC) plates using the maximum likelihood method of Haas et al. (2014).

Usage

apc(
  count,
  amount_scor,
  amount_tntc = NULL,
  tntc_limit = 250,
  conf_level = 0.95,
  tol = 1e-06
)

Arguments

count

A vector of CFU counts in each scorable (countable) plate.

amount_scor

A vector of inoculum amounts (in ml) in each scorable plate. See Details section.

amount_tntc

A vector of inoculum amounts (in ml) in each TNTC plate.

tntc_limit

A vector (or scalar) of the limit above which the plate counts are considered too-numerous-to-count (often 100, 250, or 300). Each plate can potentially have a different value. Default is 250.

conf_level

A scalar value between zero and one for the confidence level. Typically 0.95 (i.e., a 95 percent confidence interval).

tol

A scalar value for tolerance to be passed to stats::optimize() and stats::uniroot().

Details

As an example, assume we start with four plates and 1 ml of undiluted inoculum. For the first two plates we use a 100-fold dilution; for the other two plates we use a 1,000-fold dilution. The first two plates were TNTC with limits of 300 and 250. The other plates had CFU counts of 28 and 20. We now have count = c(28, 20), amount_scor = 1 * c(.001, .001), amount_tntc = 1 * c(.01, .01), and tntc_limit = c(300, 250).

Confidence intervals are calculated using the likelihood ratio (LR) approach described in Haas et al. (2014).

Value

A list containing:

  • APC: The aerobic plate count point estimate in CFU/ml.

  • conf_level: The confidence level used.

  • LB: The lower bound of the confidence interval.

  • UB: The upper bound of the confidence interval.

Warnings

As with most confidence intervals, the likelihood ratio confidence interval assumptions depend on asymptotic theory. Therefore, the confidence interval results will generally (in theory at least) be better with larger experiments.

References

Bacteriological Analytical Manual, Chapter 3, https://www.fda.gov/food/laboratory-methods-food/bam-chapter-3-aerobic-plate-count

Haas CN, Heller B (1988). "Averaging of TNTC counts." Applied and Environmental Microbiology, 54(8), 2069-2072.

Haas CN, Rose JB, Gerba CP (2014). "Quantitative microbial risk assessment, Second Ed." John Wiley & Sons, Inc., ISBN 978-1-118-14529-6.

See Also

mpn for Most Probable Number

Examples

#------- "Quantitative Microbial Risk Assessment (Haas et al., 2014) --------

# Table 6.1 (Sample A)
my_count <- c(1, 2, 1, 0, 0, 1, 1, 3, 6, 8, 4)
my_amount_scor <- c(1, 1, 1, 1, 1, 2.5, 2.5, 2.5, 2.5, 5, 5)
apc(my_count, my_amount_scor)  #1.08

# Table 6.1 (Sample B)
my_count <- c(1, 0, 5, 1, 0, 5, 0, 1, 5, 1, 8)
my_amount_scor <- c(1, 1, 1, 1, 1, 2.5, 2.5, 2.5, 2.5, 5, 5)
apc(my_count, my_amount_scor)  #1.08

# Table 6.2
my_count <- c(12, 8, 15, 40, 58)
my_amount_scor <- c(1, 1, 1, 10, 10)
my_amount_tntc <- c(10, 100, 100, 100)
my_tntc_limit <- 100
apc(my_count, my_amount_scor, my_amount_tntc, my_tntc_limit) #~7 (6.03, 7.96)

#----------- "Averaging of TNTC Counts" (Haas & Heller, 1988) ---------------

my_count <- c(10, 12, 23, 48, 63)
my_amount_scor <- c(1, 1, 1, 5, 5)
my_amount_tntc <- c(5, 10, 10)
my_tntc_limit <- 80
apc(my_count, my_amount_scor, my_amount_tntc, my_tntc_limit)
#Haas & Heller: APC = 13.28 CFU/ml

Calculate most probable number (MPN)

Description

mpn calculates the Most Probable Number (MPN) point estimate and confidence interval for microbial concentrations. Also calculates Blodgett's (2002, 2005, 2010) Rarity Index (RI).

Usage

mpn(
  positive,
  tubes,
  amount,
  conf_level = 0.95,
  CI_method = c("Jarvis", "LR"),
  tol = 1e-06
)

Arguments

positive

A vector of number of positive tubes at each dilution level.

tubes

A vector of total number of tubes at each dilution level.

amount

A vector of the amount of inoculum per tube at each dilution level. See Details section.

conf_level

A scalar value between zero and one for the confidence level. Typically 0.95 (i.e., a 95 percent confidence interval).

CI_method

The method used for calculating the confidence interval. Choices are "Jarvis" or "LR" (likelihood ratio). See Details section.

tol

A scalar value for tolerance to be passed to stats::uniroot().

Details

As an example, assume we start with 3g of undiluted inoculum per tube, then use a 10-fold dilution for 2 dilutions. We now have amount = 3 * c(1, .1, .01).

When all tubes are negative, the point estimate of MPN is zero (same approach as Jarvis et al.).

When all tubes are positive, the point estimate for MPN is Inf (same approach as Jarvis et al.) since no finite maximum likelihood estimate (MLE) exists. The BAM tables "list the MPN for this outcome as greater than the highest MPN for an outcome with at least one negative tube" (App.2).

The bias adjustment for the point estimate uses the method of Salama et al. (1978). Also see Haas (1989).

Confidence intervals are calculated using the Jarvis (2010) or likelihood ratio (LR) approach (Ridout, 1994). The BAM tables use an alternate approach. We slightly modified Jarvis' approach when all tubes are positive or all are negative; we use α\alpha instead of α/2\alpha / 2 since these are one-sided intervals. The Ridout (1994) LR approach uses the same technique (with α\alpha) for these two extreme cases.

If the Rarity Index is less than 1e-04, the experimental results are highly improbable. The researcher may consider running the experiment again and/or changing the dilution levels.

Value

A list containing:

  • MPN: The most probable number point estimate for microbial density (concentration).

  • MPN_adj: The bias-adjusted point estimate for MPN.

  • variance: The estimated variance (see Jarvis et al.) of the MPN estimate if CI_method = "Jarvis". If all tubes are positive or all negative, variance will be NA. If CI_method is not "Jarvis", variance will be NA.

  • var_log: The estimated variance of the natural log of the MPN estimate (see Jarvis et al.) using the Delta Method. If all tubes are positive or all negative, var_log will be NA. If CI_method is not "Jarvis", var_log will be NA.

  • conf_level: The confidence level used.

  • CI_method: The confidence interval method used.

  • LB: The lower bound of the confidence interval.

  • UB: The upper bound of the confidence interval.

  • RI: The rarity index.

Warnings

As with most confidence intervals, the Jarvis confidence interval assumptions (Delta Method and asymptotic normality of maximum likelihood estimators) and the assumptions for the likelihood ratio approach depend on large-sample theory. Therefore, the intervals will generally (in theory at least) be better with larger experiments.

References

Bacteriological Analytical Manual, Appendix 2, https://www.fda.gov/food/laboratory-methods-food/bam-appendix-2-most-probable-number-serial-dilutions

Blodgett RJ (2002). "Measuring improbability of outcomes from a serial dilution test." Communications in Statistics: Theory and Methods, 31(12), 2209-2223.

Blodgett RJ (2005). "Serial dilution with a confirmation step." Food Microbiology, 22(6), 547-552.

Blodgett RJ (2010). "Does a serial dilution experiment's model agree with its outcome?" Model Assisted Statistics and Applications, 5(3), 209-215.

Haas CN (1989). "Estimation of microbial densities from dilution count experiments" Applied and Environmental Microbiology 55(8), 1934-1942.

Haas CN, Rose JB, Gerba CP (2014). "Quantitative microbial risk assessment, Second Ed." John Wiley & Sons, Inc., ISBN 978-1-118-14529-6.

Jarvis B, Wilrich C, Wilrich P-T (2010). "Reconsideration of the derivation of Most Probable Numbers, their standard deviations, confidence bounds and rarity values." Journal of Applied Microbiology, 109, 1660-1667.

Ridout MS (1994). "A comparison of confidence interval methods for dilution series experiments." Biometrics, 50(1), 289-296.

Salama IA, Koch GG, Tolley DH. (1978) "On the estimation of the most probable number in a serial dilution technique." Communications in Statistics - Theory and Methods, 7(13), 1267-1281.

See Also

Shiny app: https://pub-connect.foodsafetyrisk.org/microbial/mpncalc/

apc for Aerobic Plate Count

Examples

# Compare MPN, 95% CI, and RI to Jarvis -------------------------------------

# Table 1
mpn(positive = c(3, 1, 1), tubes = c(3, 3, 3), amount = c(1, .1, .01))
  #Jarvis: 7.5 (1.9, 30) RI = .209

mpn(positive = c(0, 0, 0), tubes = c(3, 3, 3), amount = c(1, .1, .01))
  #Jarvis: 0 (0, 1.1) RI = 1
mpn(positive = c(0, 0, 0), tubes = c(3, 3, 3), amount = c(1, .1, .01),
    conf_level = .975)$UB  #alpha / 2

mpn(positive = c(3, 3, 3), tubes = c(3, 3, 3), amount = c(1, .1, .01))
  #Jarvis: Inf (36, Inf) RI = 1
mpn(positive = c(3, 3, 3), tubes = c(3, 3, 3), amount = c(1, .1, .01),
    conf_level = .975)$LB  #alpha / 2

# Table 2
mpn(positive = c(20, 14, 3), tubes = c(20, 20, 20), amount = c(1, .1, .01))
  #Jarvis: 13 (7.6, 21) RI = 0.794

mpn(positive = c(50, 35, 7), tubes = c(50, 50, 50),
    amount = 2 * c(1, .1, .01))
  #Jarvis: 6.3 (4.5, 8.7) RI = .806

mpn(positive = c(1, 5, 3, 1, 1), tubes = c(1, 5, 5, 5, 5),
    amount = c(5, 1, .5, .1, .05))
  #Jarvis: 2.7 (1.3, 5.5) RI = .512

# Compare MPN and 95% CI to BAM tables --------------------------------------

# Table 1
mpn(positive = c(0, 0, 0), tubes = c(3, 3, 3), amount = c(.1, .01, .001))
  #BAM: <> (-, 9.5)

mpn(positive = c(0, 0, 1), tubes = c(3, 3, 3), amount = c(.1, .01, .001))
mpn(positive = c(0, 0, 1), tubes = c(3, 3, 3), amount = c(.1, .01, .001),
    CI_method = "LR")
  #BAM: 3.0 (0.15, 9.6)

mpn(positive = c(2, 2, 0), tubes = c(3, 3, 3), amount = c(.1, .01, .001))
mpn(positive = c(2, 2, 0), tubes = c(3, 3, 3), amount = c(.1, .01, .001),
    CI_method = "LR")
  #BAM: 21 (4.5, 42)

mpn(positive = c(3, 3, 3), tubes = c(3, 3, 3), amount = c(.1, .01, .001))
  #BAM: >1100 (420, -)
mpn(positive = c(3, 3, 2), tubes = c(3, 3, 3), amount = c(.1, .01, .001))$MPN

# Table 2
mpn(positive = c(0, 0, 0), tubes = c(5, 5, 5), amount = c(.1, .01, .001))
  #BAM: <> (-, 6.8)

mpn(positive = c(4, 0, 2), tubes = c(5, 5, 5), amount = c(.1, .01, .001))
mpn(positive = c(4, 0, 2), tubes = c(5, 5, 5), amount = c(.1, .01, .001),
    CI_method = "LR")
  #BAM: 21 (6.8, 40)

mpn(positive = c(5, 5, 5), tubes = c(5, 5, 5), amount = c(.1, .01, .001))
  #BAM: >1600 (700, -)
mpn(positive = c(5, 5, 4), tubes = c(5, 5, 5), amount = c(.1, .01, .001))$MPN

# Compare MPN and 95% LR CI to Ridout (1994) --------------------------------

# Table 1
mpn(positive = c(0, 0, 0), tubes = c(3, 3, 3), amount = c(.1, .01, .001),
    CI_method = "LR")
  #Ridout: 0 (0, 9.0)
mpn(positive = c(2, 2, 0), tubes = c(3, 3, 3), amount = c(.1, .01, .001),
    CI_method = "LR")
  #Ridout: 21.1 (6.2, 54.3)
mpn(positive = c(3, 3, 3), tubes = c(3, 3, 3), amount = c(.1, .01, .001),
    CI_method = "LR")
  #Ridout: Inf (465.1, Inf)