5D Library › Molecules and Terroir · 中文
Chapter 6 Batch Variation and the Certificate of Analysis
What a certificate is
A certificate of analysis (COA) is a document that states, for one identified batch, which tests were done, by which methods, with what results, against which limits. It is the main way a buyer who cannot see inside a sack of dried stems or a drum of powder learns what is in it. A good COA answers six questions:
- Which batch? A lot number that can be traced back to a harvest or a production run.
- Who tested it? A laboratory, ideally one accredited to ISO/IEC 17025 for the tests concerned, which means an independent body has checked its competence and its quality system (International Organization for Standardization 2017).
- By which method? A named method (a pharmacopoeia monograph, an ISO or AOAC method, or a validated in-house method), because, as Chapters 2 and 4 showed, different methods give different numbers.
- Against which limit? The specification that applies in the market where the product will be sold.
- With what result, and what uncertainty? A number with units, and, near a limit, an estimate of measurement uncertainty.
- On what sample? How the sample was taken, because a perfect analysis of an unrepresentative sample says little about the batch.
Analytical methods used for release testing should be validated for accuracy, precision, specificity, detection and quantitation limits, linearity and range; the international guideline for medicines, ICH Q2(R2), sets out what each of these means and how to show it (International Council for Harmonisation 2023), and food and herbal laboratories use the same ideas.
Sampling: the part that is usually skipped
Most errors in quality control happen before the sample reaches the laboratory. A batch of agricultural material is not uniform: stems from different plants, rhizomes from different parts of a field, berries from different beds. Two kinds of question need different sampling.
The first is: is there a problem anywhere in the batch? Mould, foreign matter or a contaminated bag may affect only part of a lot. If a share of units is affected and units are drawn at random, the chance of drawing at least one is . The second is: what is the average? For a property such as polysaccharide content, the number of units needed to estimate the mean within a margin depends on how much units vary.
Calculation
How many units to sample to catch a problem that affects part of a lot, and how many to estimate an average to a given precision.
import math
# 1. Finding a problem that affects only part of a lot (e.g. mould in some
# bags). With n independent units drawn at random, the chance that at
# least one is affected is 1 − (1 − p)^n.
def units_needed(p, confidence=0.95):
return math.ceil(math.log(1 - confidence) / math.log(1 - p))
for p in (0.20, 0.05, 0.01):
print(f"{100 * p:4.0f} % of units affected: sample {units_needed(p):3d} "
f"units for a 95 % chance of catching at least one")
# 2. Estimating an average (e.g. polysaccharide %) to within ± d with 95 %
# confidence when units vary with standard deviation s: n = (1.96 s / d)².
for s, d in ((3.0, 1.0), (3.0, 2.0), (6.0, 2.0)):
n = math.ceil((1.96 * s / d) ** 2)
print(f"sd {s:.0f} points, margin ± {d:.0f}: {n:3d} units to sample")
# 20 % of units affected: sample 14 units for a 95 % chance of catching at least one
# 5 % of units affected: sample 59 units for a 95 % chance of catching at least one
# 1 % of units affected: sample 299 units for a 95 % chance of catching at least one
# sd 3 points, margin ± 1: 35 units to sample
# sd 3 points, margin ± 2: 9 units to sample
# sd 6 points, margin ± 2: 35 units to sampleCatching a defect in one unit in a hundred, with 95 % confidence, needs about three hundred units. That is why testing alone cannot guarantee that a batch is free of a rare problem, and why control of the process (clean drying, proper storage, segregation of lots) matters more than testing at the end.
Chromatographic fingerprints
For herbal materials, a single marker compound rarely captures quality. The Chinese Pharmacopoeia therefore uses chromatographic fingerprints or characteristic chromatograms for many materials: the whole pattern of peaks from an HPLC run, compared with a reference pattern. Similarity is often summarised by a single number, the cosine of the angle between the two vectors of peak areas or their correlation coefficient.
Calculation
Similarity of three batches to a reference fingerprint, and the largest change in any one peak.
import math
# HPLC fingerprints as peak areas at the same retention times (invented).
reference = [12.0, 30.5, 8.2, 44.0, 5.1, 19.6, 3.3]
batches = {
"batch A": [11.4, 31.9, 7.8, 42.6, 5.5, 20.3, 3.0],
"batch B": [14.8, 24.1, 9.9, 39.0, 7.2, 25.5, 4.6],
"batch C": [12.5, 29.8, 0.4, 47.3, 5.0, 18.9, 3.4], # one peak missing
}
def cosine(a, b):
dot = sum(x * y for x, y in zip(a, b))
return dot / math.sqrt(sum(x * x for x in a) * sum(y * y for y in b))
def correlation(a, b):
ma, mb = sum(a) / len(a), sum(b) / len(b)
return cosine([x - ma for x in a], [y - mb for y in b])
for name, peaks in batches.items():
worst = max(range(len(peaks)), key=lambda i: abs(peaks[i] / reference[i] - 1))
print(f"{name}: cosine {cosine(reference, peaks):.3f}, "
f"correlation {correlation(reference, peaks):.3f}, "
f"largest change at peak {worst + 1} "
f"({100 * (peaks[worst] / reference[worst] - 1):+.0f} %)")
# batch A: cosine 0.999, correlation 0.998, largest change at peak 7 (-9 %)
# batch B: cosine 0.984, correlation 0.967, largest change at peak 5 (+41 %)
# batch C: cosine 0.990, correlation 0.984, largest change at peak 3 (-95 %)Batch C scores 0.990 against the reference although one of its seven peaks has almost vanished, because the large peaks dominate the score. A similarity threshold alone would pass it. A COA that reports only “similarity ≥ 0.90” hides exactly the kind of change a buyer would want to know about. Specifications should also name the marker peaks that must be present and the range each must fall within.
Contaminants
Plant materials can carry contaminants that matter more for safety than any active compound does: heavy metals (lead, cadmium, arsenic, mercury) taken up from soil or deposited from air; pesticide residues; mycotoxins such as aflatoxins, which moulds produce on rhizomes and seeds stored warm and damp; and microorganisms. Limits differ by product and by market: the Chinese Pharmacopoeia sets limits for medicinal materials, the Codex Alimentarius general standard for contaminants guides many national food laws (Codex Alimentarius Commission 1995), and Malaysia’s Food Regulations 1985 set limits for foods sold there (Government of Malaysia 1985). A COA should state which set of limits it is testing against. “Heavy metals: pass” without a method, a limit and a number is not useful.
Water activity
Water content says how much water a product holds. Water activity says how available that water is. It is defined as
the ratio of the vapour pressure of water above the product to that above pure water at the same temperature. Pure water has ; a product in equilibrium with air at 30 % relative humidity has . Water bound to sugars, proteins and surfaces is less available, so two products with the same water content can have very different water activities.
Microorganisms need available water. Each group has a minimum water activity below which it cannot grow: about 0.97 for most Gram-negative bacteria, 0.90 for most Gram-positive bacteria, 0.86 for Staphylococcus aureus, 0.88 for most yeasts, 0.80 for most moulds, and about 0.61 for xerophilic moulds and osmophilic yeasts (Barbosa-Cánovas et al. 2020; Manitoba Agriculture, n.d.). A simple way to use these limits, the gamma approach, treats each factor as reducing the growth rate by a fraction between 0 and 1; for water activity the fraction rises in a straight line from zero at the minimum to one at (Zwietering et al. 1992).
Calculation
Relative growth rates of microbial groups at five water activities in the gamma approach. A value of 0 means no growth.
# Minimum water activity for growth (typical values, see the text).
AW_MIN = {
"most Gram-negative bacteria": 0.97,
"most Gram-positive bacteria": 0.90,
"Staphylococcus aureus": 0.86,
"most yeasts": 0.88,
"most moulds": 0.80,
"xerophilic moulds": 0.61,
}
def gamma_aw(aw, aw_min):
"""Relative growth rate (0 to 1) in the 'gamma' approach:
linear from aw_min (no growth) to aw = 1 (no limitation)."""
return max(0.0, (aw - aw_min) / (1 - aw_min))
levels = (0.95, 0.85, 0.70, 0.55, 0.30)
print("organism group " + " ".join(f"aw {a:.2f}" for a in levels))
for name, m in AW_MIN.items():
print(f"{name:28s} " + " ".join(f"{gamma_aw(a, m):7.2f}" for a in levels))
print("growth stops below about 0.6; 0.3 is chosen for texture and slower chemistry")
# organism group aw 0.95 aw 0.85 aw 0.70 aw 0.55 aw 0.30
# most Gram-negative bacteria 0.00 0.00 0.00 0.00 0.00
# most Gram-positive bacteria 0.50 0.00 0.00 0.00 0.00
# Staphylococcus aureus 0.64 0.00 0.00 0.00 0.00
# most yeasts 0.58 0.00 0.00 0.00 0.00
# most moulds 0.75 0.25 0.00 0.00 0.00
# xerophilic moulds 0.87 0.62 0.23 0.00 0.00
# growth stops below about 0.6; 0.3 is chosen for texture and slower chemistryNote
Correcting a common statement. It is often said that a water activity below 0.3 is needed to stop microbial growth. That is not quite right. Growth of all known microorganisms stops below about 0.6 (Barbosa-Cánovas et al. 2020). Dried foods are kept well below that, often at 0.2 to 0.3, for other reasons: in that range many dry foods are crisp rather than tough, and the “food stability map” drawn by Labuza and colleagues shows that browning reactions are slow and fat oxidation is near its minimum there (Labuza et al. 1970). Low water activity also stops growth without killing: bacteria such as Salmonella can survive for months in dry foods and grow again when water returns. So a low water activity is a necessary part of safety for a dried product, not a guarantee of it; hygiene before and during drying is still essential.
For a freeze-dried product, water activity is especially important because the porous structure takes up moisture quickly from humid air. A product that leaves the dryer at 0.2 can rise above 0.6 in a tropical warehouse if the packaging leaks.
Hypothesis · not established
Not established. For dried ginger and Dendrobium products stored in the same tropical warehouse conditions, the rate at which water activity rises in storage predicts the later loss of marker compounds (6-gingerol; polysaccharide molecular weight) better than the initial water content does. The hypothesis would be refuted if, in a storage study, initial water content predicted the losses as well as or better than the rate of rise in water activity.
References
Fan, Y. (2026). Molecules and Terroir: Polysaccharides of Dendrobium officinale, Gingerols of Zingiber officinale, A-Type Proanthocyanidins and the Mass Transfer of Freeze-Drying [本草的分子与风土] (Version 1.0.0). 5D Library. https://doi.org/10.5281/zenodo.23693057 · Licensed under Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International (CC BY-NC-ND 4.0).