# Mass and m/z of a modified peptide, version 1.0.2

peptide-mass\@1.0.2: this version's equations with their symbols, each constant's value, their sources and whether each was read, a worked example where the record holds one, its level and what it was checked against, the number of cases, and what was not checked. This version's record is not rewritten; a correction is added under Changes.

## What this page can and cannot show

**Level: Checked against a reference; AME2020 re-read; pyteomics 5.0.2; \[M±zH\] only; proton as 1H less an electron. Research arithmetic. Reference kind: 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.**

Not fully recorded, and not independently reviewed. Items marked "Not recorded" are missing from this project's records for the version named. Apart from any worked example shown, the cases and their values are not printed, so a reader cannot re-run these checks. No independent scientist has yet reviewed these methods or checks.

[Every version of this method](https://www.drybench.com/methods/m/peptide-mass) · [Every method](https://www.drybench.com/methods/m) · [What the levels mean](https://www.drybench.com/methods/levels)

## Version 1.0.2

**Level: Checked against a reference; AME2020 re-read; pyteomics 5.0.2; \[M±zH\] only; proton as 1H less an electron. Research arithmetic. Reference kind: 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.** `peptide-mass@1.0.2`

Built, not hosted. Generated from a snapshot of the library's records taken on 2026-11-25, as committed on 2026-11-25. A later snapshot replaces this one, so these records and this page can change.

**Verification statement:** Peptide formula from ChEBI residue formulas (22 re-read 14 November 2026) and monoisotopic mass from AME2020 (every nuclide compared with the file). \[M+zH\]z+ and \[M−zH\]z− with the proton taken as m(1H) − m(e), Drybench's construction, 1.46e-8 u below the CODATA 2022 proton mass. Compared with pyteomics 5.0.2 (an older NIST table, within a computed tolerance; a check of composition and arithmetic) and with a second implementation in Python by a separate agent of the same model family (50 cases, 26 at the edges). Other adducts through ms\_ion\_mz. Research arithmetic.

The formula and monoisotopic mass of a peptide with stated termini and modifications, and the m/z of its \[M+zH\]z+ and \[M-zH\]z- ions with each ion's formula and electron parity.

- **How results are reported:** Exact arithmetic in units of 1e-16 u. The number of decimals d is chosen on the exact, unrounded bound: the largest d from 6 down to 1 for which that bound is below 5 x 10^-(d+1) (in Da or Th), otherwise 0. Each mass and m/z is rounded half away from zero to d decimals, and d is reported beside it. The bound is then reported rounded up to two significant figures (toward larger magnitude at the second significant figure). A reported bound of 5.0e-7 can therefore stand beside 6 decimals when the unrounded bound is just under 5e-7 (CuCl: unrounded 4.95e-7). Formulas print in Hill order: C, then H, then the other elements alphabetically; with no carbon, every element alphabetically; each labelled nuclide is written as \[A\]X with its count, straight after its element's unlabelled atoms, in ascending mass number. Isotope labels go only in the labels argument: D, T and bracketed nuclides in a formula are refused as FORMULA\_UNREADABLE. Carbon counts as present for Hill order when any carbon atom, labelled or not, is in the formula. White space inside a formula or group is ignored (C6 H6 reads as C6H6); a count with a leading zero, such as C06, is refused as FORMULA\_UNREADABLE. Refusals are checked in this order, the first failure answered: EMPTY\_SEQUENCE; AMBIGUOUS\_RESIDUE (B or Z anywhere); RESIDUE\_NOT\_IN\_TABLE; MODIFICATION\_OUTSIDE\_SEQUENCE for any modification; EMPTY\_MODIFICATION for any; then for each modification in the order given, the residue at its position with every modification there, each add and remove formula read in order (formula refusals as in ion-mz), then NEGATIVE\_ATOM\_COUNT; then the N-terminal and the C-terminal group read (formula refusals as in ion-mz), NEGATIVE\_ATOM\_COUNT on the whole peptide, then each ion in the order given (REMOVES\_ABSENT\_ATOMS for an \[M-zH\] ion).
- **Uncertainty:** a bound from the AME2020 atomic-mass uncertainties and the electron mass's, summed linearly (the file gives no covariances); it excludes measurement, composition, and the binding energies of electrons and bonds (of order 1e-8 u per charge), which this method does not model; its coverage is not checked
- **Computes through this project's own routines:** reads each formula (symbols, counts, round and square brackets, nested groups, hydrate and adduct parts); the domain's refusals are added in stored reference values
- **Reference, as its record states it:** pyteomics 5.0.2 (an older NIST table, within a computed tolerance; a check of composition and arithmetic); a second implementation in Python by a separate agent of the same model family
- **Computes through:** `peptide-composition@1.0.4`
- **Level confirmed by this project's ruling of** 25 November 2026

[What this page can and cannot show](#what-this-page-can-and-cannot-show)

### What was checked

74 cases in 3 files, linked by this exact version.

Run through the tool at build 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: 70 agree within the tolerance the file states, 4 refuse as the case expects, 0 differ, 0 were not run.

- **File 1, 22 cases**
  - **Where the expected values came from:** our own exact-arithmetic script and a hand-worked case
  - **Recorded on:** 2026-11-10
  - **Reference:** exact decimal script (Python decimal), 3.13.18; licence PSF-2.0
  - **Tolerance as the file states it:** masses and m/z equal at the reported decimals (absolute 1e-9 Da or Th on the rounded values); bounds, decimals, counts, formulas, statuses and codes exact

- **File 2, 2 cases**
  - **Where the expected values came from:** our own exact-arithmetic script and a hand-worked case
  - **Recorded on:** 2026-11-11
  - **Reference:** exact decimal script (Python decimal), 3.13.18; licence PSF-2.0
  - **Tolerance as the file states it:** masses and m/z equal at the reported decimals (absolute 1e-9 Da or Th on the rounded values); bounds, decimals, counts, formulas, statuses and codes exact

- **File 3, 50 cases**
  - **Where the expected values came from:** an outside program, second implementation (Python 3.13) 2026-11-14
  - **Recorded on:** 2026-11-14
  - **Reference:** second implementation (Python 3.13), 2026-11-14; licence BSD-3-Clause
  - **Tolerance as the file states it:** every number relative 1e-12 (absolute 1e-15 below 1e-3, in each value's unit); counts, labels, formulas, strings, flags, statuses and codes exact

Apart from the worked example, the cases and their values are not printed here. This shows agreement with this project's recorded cases. It does not show that a method suits your work, and it is not a qualification.

### What was not checked

One session wrote the first script and the engine; a second implementation in Python by a separate agent of the same model family agrees on 50 cases; no measured spectrum was compared; average mass is not given (seq\_protein\_properties gives a protein's); named modifications are not offered (the caller states formulas). A formula starting with a digit (13H as a terminus) is refused FORMULA\_UNREADABLE since 1.0.2, through formula-mass 1.3.0, with no case in this method's fixtures; the refusal is covered by stored reference values and unit tests only.

### Definition or model

A closed form: the result follows from the inputs by the equations alone.

### Equations

**Equation 1**

```equation
[P] = [N] + [M] + [C], [M] the residue formulas and their modifications (add − remove), [N] and [C] the terminal groups
M = monoisotopic mass of [P] as in ion-mz. The cited page uses [M] for the residue sum and implies the precursor [N] + [M] + [C] without printing it: Drybench's construction from its fragment formulae. Modifications at one position are summed before the negative-count check
```

| Symbol | Meaning and unit |
| --- | --- |
| \[P\] | the peptide's formula, as element counts |
| \[M\] | the residue formulas and their modifications, as element counts |
| \[N\] | the N-terminal group, as element counts |
| \[C\] | the C-terminal group, as element counts |
| M | monoisotopic mass, Da |

Source: Matrix Science, Mascot help: Peptide fragmentation (formulae for fragment ion m/z, after Roepstorff and Fohlman 1984, doi:10.1002/bms.1200111109, and Johnson et al. 1987, doi:10.1021/ac00148a019), section Formulae to Calculate Fragment Ion m/z values, the help page as served on 11 November 2026 (a live page); read in full on 2026-11-11 by an AI-assisted session; not yet checked by a person. Read from the file itself, SHA-256 beginning dedf8327c587. Free to read (free to read; © Matrix Science, no reuse of the text), checked 2026-11-10. No erratum found (searched the page itself (a live page, no errata list)), 2026-11-11.

**Equation 2**

```equation
m/z = (M + q x (m(1H) - m(e))) / z, q = +z for [M+zH]z+ and -z for [M-zH]z-. A proton is taken as m(1H) − m(e), the hydrogen atom less one electron: Drybench's construction
the cited page says only that protons are added. It is 1.46e-8 u below the CODATA 2022 proton mass, and at a rounding boundary the difference can move the sixth decimal by one (ion-mz-1#c3h8os-protonated: 93.036862 here, 93.036863 with the proton mass).
```

| Symbol | Meaning and unit |
| --- | --- |
| z | charge number |
| q | signed charge |
| M | monoisotopic mass of the peptide, Da |
| m(1H) | AME2020 mass of 1H, Da |
| m(e) | electron mass, Da |
| m/z | m/z, the dimensionless quotient of IUPAC 2013 entry 356 (the name 'mass-to-charge ratio' is deprecated there), Th |

Source: Matrix Science, Mascot help: Peptide fragmentation (formulae for fragment ion m/z, after Roepstorff and Fohlman 1984, doi:10.1002/bms.1200111109, and Johnson et al. 1987, doi:10.1021/ac00148a019), section Formulae to Calculate Fragment Ion m/z values, the help page as served on 11 November 2026 (a live page); read in full on 2026-11-11 by an AI-assisted session; not yet checked by a person. Read from the file itself, SHA-256 beginning dedf8327c587. Free to read (free to read; © Matrix Science, no reuse of the text), checked 2026-11-10. No erratum found (searched the page itself (a live page, no errata list)), 2026-11-11.

**Equation 3**

Definition: the ion's electron parity (oddElectron).

```equation
electrons = sum over the ion's atoms of atomic number Z, less q (q = +z for a positive ion, -z for a negative one)
oddElectron is true when that count is odd
```

| Symbol | Meaning and unit |
| --- | --- |
| electrons | the ion's electron count |
| Z | atomic number of each atom |
| q | signed charge |

**Equation 4**

```equation
bound(m/z) = (bound(M) + z x (u(1H) + u(m(e)))) / z, bound(M) summed linearly over the peptide's atoms as peptide-composition gives it
rounded up to two significant figures (toward larger magnitude at the second significant figure)
```

| Symbol | Meaning and unit |
| --- | --- |
| bound(M) | the peptide's mass bound, Da |
| u(1H) | AME2020 uncertainty of 1H, Da |
| u(m(e)) | standard uncertainty of the electron mass, Da |
| z | charge number |

Source: Wang M, Huang WJ, Kondev FG, Audi G, Naimi S. The AME 2020 atomic mass evaluation (II). Tables, graphs and references. Chin Phys C 2021;45:030003, table mass\_1.mas20.txt, column ATOMIC MASS (micro-u) and its uncertainty, every nuclide, AME2020, the mass\_1.mas20.txt file the IAEA AMDC distributes; read in full on 2026-11-10 by an AI-assisted session; not yet checked by a person. Read from the data file of release AME2020, SHA-256 beginning e8599c6d7f72. Free to read (CC BY 3.0), checked 2026-11-10. No erratum found (searched web search: the title with erratum or corrigendum, Chinese Physics C, the IAEA AMDC AME2020 page), 2026-11-11.

### Constants

| Constant | Value and unit | Source | Date read |
| --- | --- | --- | --- |
| AME2020 atomic masses and uncertainties, stored as integers in units of 1e-12 u: the file's micro-u value times one million; divide the stored integer by 10^12 for u (m(nuclide)) | a table of values, part of the method | Wang M, Huang WJ, Kondev FG, Audi G, Naimi S. The AME 2020 atomic mass evaluation (II). Tables, graphs and references. Chin Phys C 2021;45:030003, table mass\_1.mas20.txt, column ATOMIC MASS (micro-u) and its uncertainty, every nuclide | 2026-11-10 |
| electron mass (m(e)) | 0.0005485799090441 Da | Mohr PJ, Newell DB, Taylor BN, Tiesinga E. CODATA recommended values of the fundamental physical constants: 2022 (NIST web table), electron mass in u, table electron mass in u, value and standard uncertainty | 2026-11-11 |
| each element's most abundant isotope: the argmax of its IUPAC 2009 representative composition, kept only where it keeps its lead across the CIAAW 2024 ranges (lead fails) (monoisotope) | a table of values, part of the method | Coursey JS, Schwab DJ, Tsai JJ, Dragoset RA. Atomic Weights and Isotopic Compositions (NIST), whose compositions are Berglund M, Wieser ME, Isotopic compositions of the elements 2009, Pure Appl Chem 2011;83:397-410, as NIST states, table Isotopic Composition column, every element | 2026-11-10 |

### Worked example

Worked example: one case of peptide-mass\@1.0.2, 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**

- sequence = GGG
- nTerm = H
- cTerm = OH
- ions\[0\].charge = 1
- ions\[0\].polarity = positive
- ions\[1\].charge = 2
- ions\[1\].polarity = positive

**Steps**

1. carbon = 72 Da, from sequence; by a rule this method's record does not list as an equation.
2. hydrogen = 11.086075 Da, from sequence, nTerm, cTerm; by a rule this method's record does not list as an equation.
3. nitrogen = 42.009222 Da, from sequence; by a rule this method's record does not list as an equation.
4. oxygen = 63.979658 Da, from sequence, cTerm; by a rule this method's record does not list as an equation.
5. M = 189.07496 Da, from carbon, hydrogen, nitrogen, oxygen; by a rule this method's record does not list as an equation; gives monoisotopicMass.
6. h-less-electron = 1.0072765 Da, from ions\[0\].polarity; by equation 2.
7. mz1 = 190.08223 Th, from M, h-less-electron, ions\[0\].charge; by equation 2; gives ions\[0\].mz.
8. mz2 = 95.544754 Th, from M, h-less-electron, ions\[1\].charge; by equation 2; gives ions\[1\].mz.

The working, as the case writes it:

```equation
G residue = glycine C2H5NO2 - H2O = C2H3NO
x 3 = C6H9N3O3
+ H + OH = C6H11N3O4 (Hill C6H11N3O4). [M] = 6 x 12 (12C, AME2020 by definition) + 11 x 1.007825031898 (1H) + 3 x 14.00307400425 (14N) + 4 x 15.99491461926 (16O) = 189.074956 Da, bound 2.2e-09 Da. m(1H) - m(e) = 1.007825031898 - 0.0005485799090441 (CODATA 2022) = 1.0072764519889559 Da. [M+H]+ = [M] + (m(1H) - m(e)) = 190.082232 Th
[M+2H]2+ = ([M] + 2(m(1H) - m(e)))/2 = 95.544754 Th
each to 6 decimals, half away from zero, the bound rounded up to two significant figures. Carry the AME2020 values in full
the printed partials are rounded and can differ in the last reported decimal.
```

**Answer**

- `monoisotopicMass` = **189.07496 Da**
- `ions[0].mz` = **190.08223 Th**
- `ions[1].mz` = **95.544754 Th**

Where these values came from: our own exact-arithmetic script and a hand-worked case; exact decimal on AME2020 masses and CODATA 2022 m\_e, by this script.

At build the tool returned this answer within the tolerance the file states: masses and m/z equal at the reported decimals (absolute 1e-9 Da or Th on the rounded values); bounds, decimals, counts, formulas, statuses and codes exact.

Who worked this case: not recorded.

### What it refuses, and its input ranges

- `AMBIGUOUS_RESIDUE`: B (D or N) or Z (E or Q): the two readings differ in mass Next: Ask the person which residue B or Z stands for (D or N; E or Q), or call once with each reading.
- `RESIDUE_NOT_IN_TABLE`: X or any other letter with no residue formula Next: Write each residue as its upper-case one-letter code, and a non-standard residue as a modification of the standard one it derives from; an unknown residue (X) has no formula.
- `MODIFICATION_OUTSIDE_SEQUENCE`: a modification at a position outside the sequence Next: Place the modification at a position within the sequence.
- `EMPTY_MODIFICATION`: a modification with neither add nor remove Next: State the atoms the modification adds, removes, or both, as formulas.
- `NEGATIVE_ATOM_COUNT`: a modification takes its own residue below zero atoms of an element Next: Remove no more atoms of an element than the residue carrying the modification has; where the residue keeps them but a fragment does not, leave that ion type out.
- `CHARGED_FORMULA`: a terminus or a modification has a charge written in it Next: Write the terminus or modification as a neutral formula.
- `FORMULA_UNREADABLE`: a terminus or a modification is not a formula Next: Correct the terminus or modification formula: element symbols with their counts.
- `ELEMENT_NOT_IN_TABLE`: a terminus or a modification names an element with no representative composition Next: No change of input makes this computable on these data.
- `MONOISOTOPE_NOT_FIXED`: a terminus or a modification names an element whose most abundant isotope is not fixed (lead) Next: No change of input makes this computable on these data.
- `REMOVES_ABSENT_ATOMS`: an \[M-zH\] ion removes more hydrogens than the peptide has Next: Ask for a lower charge on the negative ion.

### Changes

#### 2026-11-25-peptide-mass\@1.0.2-1

2026-11-25 · [`peptide-mass@1.0.2`](https://www.drybench.com/methods/m/peptide-mass) · Corrections to our methods

- **What was wrong:** A number written before a terminus or modification formula was read as a multiplier. PEPTIDE with its N-terminus written 13H was read as C34H65N7O15: a monoisotopic mass of 811.453864 Da for 799.359964 Da, and \[M+H\]+ at 812.461141 for 800.36724.
- **Affected:** ms\_peptide\_mass at peptide-mass 1.0.1 and earlier, only where a terminus or modification formula starts with a digit. Every other output is unchanged.
- **What changed:** In 1.0.2, through formula-mass 1.3.0, a formula starting with a digit is now refused (FORMULA\_UNREADABLE); every other output is unchanged, and every pinned output hash is the same.
- **How it was found:** A review of the formula reader's grammar on 24 November 2026 found that no rule or test documented a number at the start of a formula, while the shared reader (formula-mass) applied the adduct multiplier to the first part as well; the scientific review ruled the same day that such a formula is refused. A sweep of the tools' worked examples with 13 written before each formula argument, before and after the fix, found which tools computed on it.
- **Cases added:** None in the fixtures: no published case starts a formula with a digit, and every pinned output hash is unchanged. The refusal is covered by the formula reader's hand cases and unit tests; the widened sweep records each tool's reply before and after.

## Tools that use it

- [`ms_peptide_mass`](https://www.drybench.com/methods/tools/ms-peptide-mass)

## Cite this version

Mass and m/z of a modified peptide. Drybench; peptide-mass\@1.0.2; [https://www.drybench.com/methods/m/peptide-mass/1.0.2](https://www.drybench.com/methods/m/peptide-mass/1.0.2) (accessed \[date\]).
