Mass error of an observed m/z
ms_mass_error
Works out the difference and ppm error of an observed m/z or mass against its theoretical value.
- Runs
- On the server
- Level
- Checked against a reference: pyOpenMS 3.6.0 Math.getPPM on every computed case (mass-error-3.json); a second implementation in Python by a separate agent of the same model family
What it is
Returns the difference and the ppm error of an observed m/z or mass against its theoretical value. Use when a measured value is to be compared with a predicted one, given as an m/z pair or a mass pair. Not for the theoretical value itself: use `ms_ion_mz`. Refuses anything but exactly one complete pair; values above zero, m/z in Th, masses in Da or kDa; error in uTh/Th or uDa/Da.
Field: Analytical chemistry.
What it does
You give
observedMz: The observed m/z, in Th. Must be above 0 Th. Optional.theoreticalMz: The theoretical m/z, in Th. Must be above 0 Th. Optional.observedMass: The observed mass, in Da or kDa. Must be above 0 Da. Optional.theoreticalMass: The theoretical mass, in Da or kDa. Must be above 0 Da. Optional.
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.
- Arithmetic only: error = (observed − theoretical)/theoretical, reported in parts per million as uTh/Th for an m/z pair and uDa/Da for a mass pair, and the difference in the pair's unit (Th for m/z, Da for mass; never mDa for an m/z); exactly one pair, m/z with m/z or mass with mass; it does not say whether an assignment is right or what accuracy an instrument meets.
- 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
- not exactly one complete pair: an observed and a theoretical m/z, or an observed and a theoretical mass (an m/z is not a mass unless the charge is known).
Every input, with its units4 inputs
observedMz: The observed m/z, in Th. Must be above 0 Th. Optional.theoreticalMz: The theoretical m/z, in Th. Must be above 0 Th. Optional.observedMass: The observed mass, in Da or kDa. Must be above 0 Da. Optional.theoreticalMass: The theoretical mass, in Da or kDa. Must be above 0 Da. Optional.
Every refusal, with its code1 refusal
| Code | When |
|---|---|
NEEDS_ONE_PAIR | not exactly one complete pair: an observed and a theoretical m/z, or an observed and a theoretical mass (an m/z is not a mass unless the charge is known). |
The calculation
The method's equations, constants and worked example.
Equation 1
difference = observed - theoretical
error = (observed - theoretical) / theoretical x 10^6
| Symbol | Meaning |
|---|---|
observed m/z | an observed mass-to-charge ratio, Th |
theoretical m/z | the theoretical mass-to-charge ratio, Th |
observed mass | an observed mass, Da |
theoretical mass | the theoretical mass, Da |
difference | observed less theoretical, in the pair's unit (Th here; Da for a mass pair), Th |
error | the difference over the theoretical value in millionths of it, uTh/Th (uDa/Da for a mass pair); numerically the figure often written 'ppm'; IUPAC 2013 deprecates it ('parts per thousand (ppt) or parts per million (ppm), both of which are deprecated', p. 1518; entry isotope delta, Note 4, 'Units of parts per thousand (ppt, 10–3) or parts per million (ppm, 10–6) are deprecated', p. 1585), so the unit is written uTh/Th or uDa/Da, uTh/Th |
Source 1.
Equation 2
observed is the measured value and theoretical the calculated one
the error is positive when the measured value is the higher
| Symbol | Meaning |
|---|---|
observed | the measured m/z or mass, Th |
theoretical | the calculated m/z or mass, Th |
Source 2.
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 mass-error@1.0.1, 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
- observedMz = 195.088042 Th
- theoreticalMz = 195.087652 Th
Steps
- difference = 0.00039 Th, from observedMz, theoreticalMz; by equation 1; gives difference.
- error = 1.9991014 uTh/Th, from difference, theoreticalMz; by equation 1; gives error.
The working, as the case writes it:
(195.088042 - 195.087652) / 195.087652 x 10^6 = 0.00039 / 195.087652 x 10^6 = 1.99910 ppm
Answer
difference = 0.00039 Th
error = 1.9991014 uTh/Th
Where these values came from: our own exact-arithmetic script and a hand-worked case; exact decimal, this script.
At build the tool returned this answer within the tolerance the file states: difference absolute 1e-9 in Th or Da; error absolute 1e-7 in uTh/Th or uDa/Da (parts per million); statuses, codes and units exact.
Sources
JCGM 200:2012. International vocabulary of metrology: basic and general concepts and associated terms (VIM), 3rd edition, 2008 version with minor corrections
Used for: Mass error of an observed m/z or mass. At: p. 22, section entry 2.16, measurement error: measured quantity value minus a reference quantity value.
Read in full, 14 November 2026Murray KK, Boyd RK, Eberlin MN, Langley GJ, Li L, Naito Y. Definitions of terms relating to mass spectrometry (IUPAC Recommendations 2013). Pure Appl Chem 2013;85:1515-1609
Used for: Mass error of an observed m/z or mass. At: p. 1519, section entry 6, Note 2: one term refers to a measured mass, exact mass to a calculated mass.
Read in full, 14 November 2026
How it is checked
- Level
Checked against a reference.
- Checked against
Our own exact-arithmetic script and a hand-worked case.
- Cases
No case set is linked to this version.
- Not checked
One session wrote the first script and the engine; the division by the theoretical value is a standard definition; no mass-spectrometry source for it was read (Brenton and Godfrey 2010 behind a login on 14 November 2026; Zubarev and Mann 2007 not read).
Changes to its methods1 change
- 14 November 2026, mass-error@1.0.1: In 1.0.1 such a call is refused whole as RESULT_OUTSIDE_DOUBLE_RANGE, naming the quantity. No published case's number moved.