Reporter-ion correction for reagent isotopic impurity
ms_isobaric_impurity_correction
Corrects reporter-ion intensities for the reagent lot's isotopic impurities.
- Runs
- On the server
- Level
- Checked against a reference: an exact-rational script that rebuilds MSnbase's printed matrix from its certificate; a fresh agent's second implementation; pyOpenMS 3.6.0's matrices on 8 certificate cases
What it is
Returns reporter-ion intensities corrected for the reagent lot's isotopic impurities. Use when TMT or iTRAQ reporter intensities must be unmixed using the impurity percentages on a lot's certificate. Not for co-isolation interference, ratio compression or normalisation; for tracer isotopologues, use `ms_isotopologue_correction`; for a formula's isotope peaks, use `ms_isotope_pattern`. Refuses negative intensities, a matrix with no inverse and the main-peak basis (only percent of reagent total is offered); withholds a channel below zero; the basis is required.
Field: Analytical chemistry.
What it does
You give
channels(required): The reporter channels in the caller's order; row k of the reply is channels[k].impurityPercentBasis(required): What the certificate's percentages are relative to.
No request is recorded for this tool.
Limits
- Research arithmetic: each number follows from the formula, sequence or values you give, by the method and any constants named on the tool, and describes those inputs rather than the sample or instrument they came from.
- It is not an identification, a validated quantification or a check of an instrument, and it is not for diagnosis or treatment decisions.
- Unmixes reporter intensities using the lot certificate's isotopic impurities and a stated percentage basis; a channel that comes out below zero is withheld; it does not correct co-isolation interference or ratio compression, does not normalise, and does not encode any plex layout; every channel needs a measured value, and channels without one are not corrected as a subset.
- Every computed number a reply returns, other than an integer or an exact decimal, is rounded once to 12 significant figures: to the nearest, a change of at most 5 × 10⁻¹² of its value, except that a lower bound is rounded down and an upper bound up, a change of less than 1 × 10⁻¹¹; the method computes, and decides any pass or fail, on the unrounded value.
It will not answer when
- an observed intensity below zero.
- a reagent's impurities add up to all of its signal or more, so no main peak is left.
- the impurity matrix has no inverse, so the channels cannot be separated.
- impurityPercentBasis is of-main-peak: no document read states how percentages relative to a reagent's main peak become the matrix, so that basis is not computed; checked after the channel checks.
Every input, with its units2 inputs
channels(required): The reporter channels in the caller's order; row k of the reply is channels[k].impurityPercentBasis(required): What the certificate's percentages are relative to.
Every refusal, with its code7 refusals
| Code | When |
|---|---|
NEGATIVE_INTENSITY | an observed intensity below zero. |
IMPURITY_SUM_NOT_BELOW_WHOLE | a reagent's impurities add up to all of its signal or more, so no main peak is left. |
SINGULAR_MATRIX | the impurity matrix has no inverse, so the channels cannot be separated. |
MAIN_PEAK_BASIS_NOT_OFFERED | impurityPercentBasis is of-main-peak: no document read states how percentages relative to a reagent's main peak become the matrix, so that basis is not computed; checked after the channel checks. |
SENTINEL_AS_CHANNEL | a channel is named outside-measured-channels, the word reserved for impurity lost to unmeasured masses. |
UNKNOWN_DESTINATION | an impurity names a destination that is not one of the channels. |
SELF_DESTINATION | an impurity names its own channel as destination. |
The calculation
The method's equations, constants and worked example.
Equation 1
of reagent total: e_ij = p_ij / 100, e_ii = 1 - sum(p_i) / 100
sum(p_i) includes outside
| Symbol | Meaning |
|---|---|
p_ij | certificate percentage of reagent i observed at channel j; a cell the certificate leaves out is zero, % |
sum(p_i) | the sum of all of reagent i's impurity percentages, those to outside-measured-channels included, % |
p_i,out | reagent i's percentages to outside-measured-channels, summed, % |
M | the impurity matrix, M[i][j] = e_ij (impurityMatrix[i].observedIn[j].fraction) |
e_ij | fraction of reagent i's signal observed at channel j |
y_j | observed intensity at channel j |
x_i | corrected intensity of reagent i |
Source 1.
Equation 2
outsideMeasuredChannels_i = p_i,out / 100
p_i,out the sum of the reagent's outside-measured-channels cells, two or more summed (MS-F9)
| Symbol | Meaning |
|---|---|
p_ij | certificate percentage of reagent i observed at channel j; a cell the certificate leaves out is zero, % |
sum(p_i) | the sum of all of reagent i's impurity percentages, those to outside-measured-channels included, % |
p_i,out | reagent i's percentages to outside-measured-channels, summed, % |
M | the impurity matrix, M[i][j] = e_ij (impurityMatrix[i].observedIn[j].fraction) |
e_ij | fraction of reagent i's signal observed at channel j |
y_j | observed intensity at channel j |
x_i | corrected intensity of reagent i |
Source 1.
Equation 3
y_j = sum over i of e_ij x_i, solved exactly for x
a value below zero withheld
a value of exactly zero is reported as zero, not withheld
the decision is exact
| Symbol | Meaning |
|---|---|
p_ij | certificate percentage of reagent i observed at channel j; a cell the certificate leaves out is zero, % |
sum(p_i) | the sum of all of reagent i's impurity percentages, those to outside-measured-channels included, % |
p_i,out | reagent i's percentages to outside-measured-channels, summed, % |
M | the impurity matrix, M[i][j] = e_ij (impurityMatrix[i].observedIn[j].fraction) |
e_ij | fraction of reagent i's signal observed at channel j |
y_j | observed intensity at channel j |
x_i | corrected intensity of reagent i |
Source not recorded.
Conventions
- EXACT_SOLVE_NO_CLIPPING = exact solve: Fixed by the method; not an argument. The system is solved exactly; a channel below zero is withheld, never clipped to zero or fitted by non-negative least squares.
A definition, not a model: the equation states what the quantity means. A different convention gives a different number.
Worked example
Worked example: one case of isobaric-impurity-correction@2.0.0, from its inputs through each step to the answer. Values are written as a person writes them; the working carries more digits, so your own figure may differ in the last digit shown.
Inputs
- channels[0].channel = 114
- channels[0].observedIntensity = 969
- channels[0].impurities[0].destination = 115
- channels[0].impurities[0].percentage = 5.9 %
- channels[0].impurities[1].destination = 116
- channels[0].impurities[1].percentage = 0.2 %
- channels[0].impurities[2].destination = outside-measured-channels
- channels[0].impurities[2].percentage = 1 %
- channels[1].channel = 115
- channels[1].observedIntensity = 1999
- channels[1].impurities[0].destination = 114
- channels[1].impurities[0].percentage = 2 %
- channels[1].impurities[1].destination = 116
- channels[1].impurities[1].percentage = 5.6 %
- channels[1].impurities[2].destination = 117
- channels[1].impurities[2].percentage = 0.1 %
- channels[2].channel = 116
- channels[2].observedIntensity = 3046
- channels[2].impurities[0].destination = 115
- channels[2].impurities[0].percentage = 3 %
- channels[2].impurities[1].destination = 117
- channels[2].impurities[1].percentage = 4.5 %
- channels[2].impurities[2].destination = outside-measured-channels
- channels[2].impurities[2].percentage = 0.1 %
- channels[3].channel = 117
- channels[3].observedIntensity = 3829
- channels[3].impurities[0].destination = 115
- channels[3].impurities[0].percentage = 0.1 %
- channels[3].impurities[1].destination = 116
- channels[3].impurities[1].percentage = 4 %
- channels[3].impurities[2].destination = outside-measured-channels
- channels[3].impurities[2].percentage = 3.6 %
- impurityPercentBasis = of-reagent-total
Steps
- e114-114 = 0.929, from channels[0].impurities, impurityPercentBasis; by equation 1; gives impurityMatrix[0].observedIn[0].fraction.
- e114-115 = 0.059, from channels[0].impurities[0].percentage; by equation 1; gives impurityMatrix[0].observedIn[1].fraction.
- x114 = 1000, from channels[0].observedIntensity, channels[1].observedIntensity, channels[2].observedIntensity, channels[3].observedIntensity, e114-114; by equation 3; gives correctedChannels[0].correctedIntensity.
The working, as the case writes it:
M rebuilt from the certificate equals MSnbase's printed matrix (rows 0.929 0.059 0.002 0
0.020 0.923 0.056 0.001
0 0.030 0.924 0.045
0 0.001 0.040 0.923). Forward M^T (1000, 2000, 3000, 4000) = (969, 1999, 3046, 3829)
157 counts lost (10 + 3 + 144). The exact solve returns the true values.
Answer
impurityMatrix[0].observedIn[0].fraction = 0.929
impurityMatrix[0].observedIn[1].fraction = 0.059
correctedChannels[0].correctedIntensity = 1000
Where these values came from: our own exact-arithmetic script and a hand-worked case; exact rationals (Python fractions), by this script, from Drybench's rulings of 11 November 2026.
At build the tool returned this answer within the tolerance the file states: Corrected intensities and matrix fractions within absolute 1e-9 (each rounded once from an exact solve); channels, texts, statuses and codes exact.
Sources
Gatto L, Lilley KS. MSnbase, purityCorrect and makeImpuritiesMatrix documentation, man/purityCorrect-methods.Rd (Bioconductor; GitHub lgatto/MSnbase, master)
Used for: Reporter-ion correction for reagent isotopic impurity. At: section the impurities matrix: reporter ions along the columns, percentages along the rows; the iTRAQ 4-plex example.
Read in full, 11 November 2026
How it is checked
- Level
Checked against a reference.
- Checked against
Our own exact-arithmetic script and a hand-worked case; a reference program this project wrote itself, second implementation (Python 3.13), 2026-11-14, exact rationals (Python fractions) on the exact value of each input double, each output rounded once to the nearest double; not an outside program.
- Cases
No case set is linked to this version.
- Not checked
MSnbase was not run (not packaged here; pyOpenMS 3.6.0 was); i-Tracker (Shadforth 2005) was read and does not state a basis; a certificate stated relative to the main peak is refused, not converted, since no document read gives that basis; no plex layout is encoded, so the caller maps each certificate cell to its channel; co-isolation interference and ratio compression are not corrected; one session wrote the script and the engine, and the second implementation is by an agent of the same model family.
What this project's records still lack1 thing
- The source's location for each equation for isobaric-impurity-correction@2.0.0.
Changes to its methods1 change
- 25 November 2026, isobaric-impurity-correction@2.0.0: In 2.0.0 the main-peak basis is refused as MAIN_PEAK_BASIS_NOT_OFFERED, and the basis's description says so; only percent of each reagent's total signal, the basis MSnbase documents, is computed.