Tutorials › Pharmacometric Workflows and Reproducible Modeling › Harmonizing Assay Records

Data Specification and Dataset Preparation · Tutorial 34 of 399

Harmonizing Assay Records

Build a consistent assay-record representation across laboratories without losing the original results or the source information needed to interpret them.

Intermediate 10 min read

What You'll Learn

  • Distinguish assay names from the analyte and measurand an assay reports.
  • Create explicit mappings from laboratory-specific names and identifiers to canonical terms.
  • Convert concentration units using dimensional analysis while retaining reported values and units.
  • Encode result qualifiers consistently without treating qualified results as ordinary numbers.
  • Preserve source-specific metadata and recognize when records cannot be safely harmonized.

Why Assay Harmonization Requires More Than Renaming Columns

Pharmacometric datasets often combine concentration results from laboratories whose records use different assay names, analyte labels, units, and qualifier codes. These differences can be superficial: one laboratory may label a concentration unit “ng/mL” and another “µg/L,” even though the units are equivalent. Other differences are substantive: a label may refer to a metabolite rather than the parent drug, or a qualifier may have a laboratory-specific meaning. Treating every difference as a spelling problem risks combining results that do not represent the same quantity.

Harmonization is the controlled assignment of consistent representations to assay records while retaining their original values and source-specific context. The aim is not to make all records appear interchangeable. It is to make justified equivalences explicit, and to preserve distinctions where equivalence cannot be established.

Definition: A source value is the value or text recorded by a laboratory, together with its reported unit and qualifier. A canonical value is a standardized representation used in the analysis dataset. A mapping records how a particular source label or code corresponds to a canonical term. Harmonization should retain both the source representation and the canonical representation, along with information identifying the source.

Define What the Record Represents

Before changing labels or units, establish what each result measures. An assay name identifies a procedure or test as the source calls it; an analyte identifier identifies the substance or entity reported; and the measurand specifies what the result represents in the relevant sample. These concepts are related but not interchangeable. For example, a laboratory’s “Drug X assay” might report parent Drug X, a named metabolite, or a combined measurement, depending on the assay definition.

A safe mapping therefore considers more than the text in an analyte column. Relevant evidence may include the laboratory’s data dictionary, assay code, protocol, sample matrix, and documentation of the reported entity. Retain distinctions such as parent compound versus metabolite, free versus total concentration, and different sample matrices when they define different measurands. If the source material does not establish what a label means, do not infer equivalence from similar spelling.

Canonical identifiers should be stable and unambiguous within the project. They may be a controlled term or a project identifier linked to a documented definition. The important point is that the identifier represents the intended analyte consistently, while the source analyte name and code remain available for review. Do not reuse one canonical identifier for two substances merely because a laboratory uses the same abbreviation for both.

Worked Example: Mapping Laboratory Analyte Labels

Suppose two hypothetical laboratories report records associated with a study of Drug A. Laboratory North uses the label “Drug A” and assay code “N-101.” Laboratory South uses “A parent” and code “S-04.” Their documentation confirms that both report parent Drug A in plasma. A third South laboratory record is labeled “A-M1”; documentation identifies it as metabolite M1.

A defensible mapping assigns the first two records the same canonical analyte identifier, such as “DRUG_A_PARENT_PLASMA,” while retaining “Drug A”/“N-101” and “A parent”/“S-04” as source fields. The third record receives a distinct identifier, such as “DRUG_A_M1_PLASMA.” It is not mapped to the parent merely because its name contains “A.”

The decision rests on documented analyte identity and matrix, not on visual similarity between labels. If documentation for “A parent” were unavailable, that record would remain unresolved rather than being assigned the parent identifier by assumption.

Standardize Concentration Units Without Overwriting the Source

A numeric result has no interpretable concentration scale without its unit. Unit conversion is appropriate when the source and canonical units express the same physical quantity and the conversion factor is known. Dimensional analysis makes the conversion explicit and provides a simple check against errors.

Unit-conversion rule: Multiply the source value by a conversion factor whose units cancel the source unit and leave the canonical unit. Retain the source value and source unit separately from the converted value and canonical unit.

For example, \(1\ \mathrm{mg}=10^6\ \mathrm{ng}\) and \(1\ \mathrm{L}=10^3\ \mathrm{mL}\). Therefore,

$$ 1\ \frac{\mathrm{mg}}{\mathrm{L}} \times \frac{10^6\ \mathrm{ng}}{1\ \mathrm{mg}} \times \frac{1\ \mathrm{L}}{10^3\ \mathrm{mL}} = 10^3\ \frac{\mathrm{ng}}{\mathrm{mL}}. $$

The milligram and liter units cancel, leaving nanograms per milliliter. This establishes that \(1\ \mathrm{mg/L}=1000\ \mathrm{ng/mL}\). A conversion should not be applied just because two unit strings look different: first check that they describe the same quantity and denominator. A concentration per volume, for instance, is not interchangeable with an amount per mass without additional information.

Worked Example: Converting a Reported Concentration

In a hypothetical dataset, Laboratory East reports a plasma concentration of \(0.025\ \mathrm{mg/L}\). The chosen canonical unit is \(\mathrm{ng/mL}\). Convert the result and state which fields should remain available.

Using \(1\ \mathrm{mg/L}=1000\ \mathrm{ng/mL}\):

$$ 0.025\ \frac{\mathrm{mg}}{\mathrm{L}} \times 1000\ \frac{\mathrm{ng/mL}}{\mathrm{mg/L}} = 25\ \mathrm{ng/mL}. $$

The canonical result is \(25\ \mathrm{ng/mL}\). The record should still retain the source result \(0.025\), the source unit \(\mathrm{mg/L}\), and the laboratory identity, alongside the canonical result and unit. Keeping both representations allows a reviewer to verify the conversion and distinguish a source transcription from a later standardized value.

Represent Qualifiers as Information, Not as Numbers

A result qualifier changes how a reported value should be interpreted. A laboratory may provide a numeric result with “<” or “>,” a text category such as “BLQ,” or a code defined in its own data dictionary. Harmonization should standardize the qualifier’s meaning where that meaning is documented, while retaining the exact source token.

A useful representation separates the numeric value from the qualifier. For example, a record might retain a source text of “<0.5,” a parsed numeric bound of \(0.5\), and a canonical qualifier meaning “less than.” The bound is not an ordinary measured value: removing the qualifier and treating \(0.5\) as an exact concentration would change the information in the record. Likewise, replacing a qualified result with zero, a missing value, or an unqualified number is not a neutral formatting choice.

Text codes require particular care. “BLQ,” “ND,” “not reported,” and an empty field should not be assumed to mean the same thing. A code can be mapped to a canonical category only when its source-specific definition supports that mapping. If a code’s meaning is unknown or ambiguous, preserve the original code and mark its canonical interpretation as unresolved rather than guessing.

Worked Example: Harmonizing Qualifier Codes

Two hypothetical laboratories use different formats. Laboratory West records a result as “<0.5 ng/mL.” Laboratory Central records a numeric bound of \(0.5\), with qualifier code “LT.” Both laboratories’ documentation defines “<” and “LT” as meaning that the result is less than the recorded bound.

The records can be represented consistently with a canonical numeric bound of \(0.5\ \mathrm{ng/mL}\) and a canonical qualifier meaning “less than,” while preserving each source’s original result and qualifier token. The value \(0.5\ \mathrm{ng/mL}\) remains a bound, not an exact observed concentration. If Central’s code “LT” were undocumented, the equivalence would not be established from the code alone; its meaning would remain unresolved pending clarification.

This mapping harmonizes representation without discarding the evidence needed to interpret the result. It does not, by itself, establish any further treatment or analysis of qualified results.

A Controlled Harmonization Workflow

A repeatable process makes mapping decisions reviewable and reduces the chance that a convenient label change conceals a change in meaning. Keep decisions explicit: each canonical assignment should be supported by source information, not by an undocumented assumption.

1
Inventory source fields.
Collect the laboratory identifier, assay name and code, analyte label and code, matrix, reported value, unit, and qualifier as supplied. Preserve the original text and values.
2
Establish assay and analyte meaning.
Use the relevant source definitions to determine whether records represent the same assay context and measurand. Keep distinct analytes or matrices distinct.
3
Apply documented mappings.
Assign canonical assay and analyte identifiers only when the source evidence supports the correspondence. Record the source terms associated with each mapping.
4
Convert compatible units and qualifiers.
Use explicit conversion factors for units of the same quantity. Map qualifier codes only when their documented meanings are known, and keep the source forms.
5
Review unresolved cases.
Retain ambiguous labels, units, or codes as unresolved rather than forcing them into a canonical category. Keep enough source-specific metadata to investigate them later.

Checks, Alternatives, and Limits

A harmonized result should be reviewable from its retained source representation. For a converted result, recompute the conversion from the source value and unit and check that the canonical value and unit follow from the stated factor. For a mapped label or qualifier, compare the assignment with the source definition. These checks evaluate the harmonization decision; they do not establish that the assay itself is accurate or that different assay methods produce directly comparable measurements.

Several warning signs deserve investigation. A single source label mapping to multiple canonical analytes may indicate an overloaded abbreviation or a mapping rule that is too broad. Conversely, many spelling variants assigned to separate canonical terms may indicate inconsistent mapping. Unit conversions that produce implausible orders of magnitude can signal a reversed factor or a mistaken source unit. A qualifier that disappears during conversion signals information loss. In each case, return to the source record and documentation rather than repairing the output by guesswork.

Two common approaches are manual relabeling and an explicit mapping table. Manual relabeling can be quick for a small, unambiguous file, but it is difficult to review, reproduce, and apply consistently when sources or files change. A mapping table makes the relationship between source-specific terms and canonical terms visible and reusable. It also makes unresolved entries apparent. Neither approach justifies a mapping unsupported by the source definitions.

Harmonization also has limits. Different laboratories may use different methods or assay definitions even when their labels and units match. Standardizing a name and unit does not prove analytical equivalence. Preserve relevant source-specific assay information and do not collapse distinctions merely to obtain a single tidy category. Decisions that depend on the detailed interpretation of assay limits require the associated assay information; a qualifier label alone may not be enough.

A common mistake is to treat harmonization as cosmetic cleanup: “The names look similar, so I can replace them; the units are close enough; and BLQ can be stored as zero.” The correction is to establish equivalence for each field separately, convert only dimensionally compatible units, and retain the qualifier and source representation. Standardization should make the data easier to compare without claiming more comparability than the evidence supports.

Key takeaway: A defensible harmonized assay record keeps the original result, unit, qualifier, and source context while adding explicit canonical representations. Map only what documentation supports, and preserve uncertainty where it does not.

Check Your Understanding

Answer each question, then compare your reasoning with the solutions.

  1. Two laboratories use different labels for a parent compound, but one label could also refer to a metabolite. What evidence is needed before assigning a shared canonical analyte identifier?
  2. Convert \(0.004\ \mathrm{mg/L}\) to \(\mathrm{ng/mL}\). Show the conversion factor.
  3. A source reports “<2 ng/mL.” Why should the canonical record not store \(2\ \mathrm{ng/mL}\) as an unqualified exact result?
  4. A laboratory code “ND” appears in a source file, but its data dictionary is unavailable. What is a defensible harmonization decision?
  5. Name two source fields or metadata items that should remain available after harmonization, and explain why.

Solutions. (1) Consult documentation that identifies the reported analyte and measurand, such as the assay definition and code; similar labels alone are not enough. (2) \(0.004\ \mathrm{mg/L}\times1000\ \mathrm{ng/mL}\text{ per mg/L}=4\ \mathrm{ng/mL}\). (3) The “less than” qualifier means the reported number is a bound, not an exact concentration; dropping it changes the result’s meaning. (4) Retain “ND” and its source context, but leave its canonical interpretation unresolved until its meaning is documented. (5) Examples include the original value and unit, the source qualifier, laboratory identifier, and source assay or analyte code; these allow review of conversions and mappings and help preserve distinctions among sources.

Clinical Biostats