Skip to content

Methods and checksMethods

How every result is reached and what it was checked against, app by app.

Methods and checks pages

Isotope pattern of a formula at a charge, version 3.0.0

isotope-pattern@3.0.0: 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; Valkenborg 2012 Eq. 3 and Berglund and Wieser 2011 Table 1 read; matches IsoSpecPy. Research arithmetic. Reference kind: our own exact-arithmetic script and a hand-worked case.

Checked by this project, not independently reviewed. Every method on this page has its equations, constants, sources and cases on record, and its cases agree with the stated reference within the stated tolerance. A reader can follow each method's worked example by hand; that shows the stated method gives the stated answer for one set of inputs, and does not test the code. The other cases and their values are not printed, so a reader cannot re-run these checks. No independent scientist has yet reviewed them.

Every version of this method · Every method · What the levels mean

Version 3.0.0

Level: Checked against a reference; Valkenborg 2012 Eq. 3 and Berglund and Wieser 2011 Table 1 read; matches IsoSpecPy. Research arithmetic. Reference kind: our own exact-arithmetic script and a hand-worked case. isotope-pattern@3.0.0

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: Fine-structure probabilities match an exact multinomial in Python decimal at 60 digits and IsoSpecPy 2.6.1 on 24 cases within 2.2e-12 relative, with every line count equal; the boundary cases at the atom limit (C100000, H100000, C99000H2000) agree with 60-digit binomials within 5.1e-15 since 3.0.0 (D0273B-F2, D0273B-F4). Fresh agents' second implementations at 60 digits agree on 127 cases, every probability within 5.1e-15. The IUPAC 2009 abundances as NIST serves them agree with Berglund and Wieser 2011 Table 1, read, 288 of 288 isotopes. The multinomial is Valkenborg et al. 2012's Eq. 3, read. Fine structure only. The ion's own formula is required; charge by electron loss or gain. A real sample's pattern varies with natural isotopic composition (CIAAW 2024 ranges, stated) by more than this. Research arithmetic.

The fine-structure isotope pattern of a formula at a charge: one line per isotopologue at or above a stated fraction of the most intense, with its m/z, bound, probability and relative intensity.

  • 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). Probabilities and relative intensities unrounded. Each fraction is taken as the decimal it is written as: the table's as printed, a stated one as the shortest decimal that gives back its double; a stated composition's sum is checked on the doubles, within 1e-12. The threshold is taken as its double; a subnormal one is declined INVALID_NUMBER, as the kit declines every subnormal quantity.
  • Uncertainty: a bound from the AME2020 atomic-mass uncertainties and the electron mass's, summed linearly (the file gives no covariances); it excludes measurement and composition; 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 joined only by a middle dot, a period or an asterisk: a + or - with formula after it, as in C8H10N4O2+H, joins nothing and is refused FORMULA_UNREADABLE, and one at the end is CHARGED_FORMULA); the domain's refusals are added in stored reference values
  • Reference, as its record states it: an exact multinomial convolution in Python decimal, with IsoSpecPy run beside it; IsoSpecPy 2.6.1 on 24 cases (24 November 2026)
  • Level confirmed by this project's ruling of 25 November 2026

What this page can and cannot show

What was checked

190 cases in 5 files, linked by this exact version.

Run through the tool at build against our own exact-arithmetic script and a hand-worked case: 179 agree within the tolerance the file states, 11 refuse as the case expects, 0 differ, 0 were not run.

  • File 1, 96 cases

    • Where the expected values came from: our own exact-arithmetic script and a hand-worked case
    • Recorded on: 2026-11-25
    • Reference: fresh second implementation (Python 3.13, standard library decimal and fractions), 2026-11-25; licence PSF-2.0
    • Tolerance as the file states it: peak m/z equal at the reported decimals (absolute 1e-9 Th on the rounded values); probabilities, relative intensities and coverage absolute 1e-12; bounds, ranges, labels, counts, formulas, statuses and codes exact
  • File 2, 33 cases

    • Where the expected values came from: our own exact-arithmetic script and a hand-worked case
    • Recorded on: 2026-11-25
    • Reference: exact decimal script (Python decimal), 3.13.18; licence PSF-2.0
    • Tolerance as the file states it: peak m/z equal at the reported decimals (absolute 1e-9 Th on the rounded values); probabilities, relative intensities and coverage absolute 1e-12; bounds, ranges, labels, counts, formulas, statuses and codes exact
  • File 3, 2 cases

    • Where the expected values came from: our own exact-arithmetic script and a hand-worked case
    • Recorded on: 2026-11-25
    • Reference: exact decimal script (Python decimal), 3.13.18; licence PSF-2.0
    • Tolerance as the file states it: peak m/z equal at the reported decimals (absolute 1e-9 Th on the rounded values); probabilities, relative intensities and coverage absolute 1e-12; bounds, ranges, labels, counts, formulas, statuses and codes exact
  • File 4, 28 cases

    • Where the expected values came from: our own exact-arithmetic script and a hand-worked case
    • Recorded on: 2026-11-25
    • Reference: second implementation (Python 3.13, mpmath 1.4.1), 2026-11-14; licence PSF-2.0
    • Tolerance as the file states it: peak m/z equal at the reported decimals (absolute 1e-9 Th on the rounded values); probabilities, relative intensities and coverage absolute 1e-12; bounds, ranges, labels, counts, formulas, statuses and codes exact
  • File 5, 31 cases

    • Where the expected values came from: our own exact-arithmetic script and a hand-worked case
    • Recorded on: 2026-11-25
    • Reference: fresh second implementation (Python 3.13, standard library decimal), 2026-11-25; licence PSF-2.0
    • Tolerance as the file states it: peak m/z equal at the reported decimals (absolute 1e-9 Th on the rounded values); probabilities, relative intensities and coverage absolute 1e-12; bounds, ranges, labels, counts, formulas, 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

Valkenborg et al. 2012 states the multinomial and the product over elements but not that atoms are independent, which is this record's explanation; two fresh agents' second implementations, of the same model family, are stored reference values and stored reference values (127 cases; one left out, a threshold within a few ulps of a line's ratio; 12 schema declines), and the edge cases are a separate agent's of 14 November 2026; Math.log and Math.exp remain the host's (REL-1539), which at 100,000 atoms leaves up to about 4.4e-13 relative on every line, of one sign across a pattern (C99000H2000, against 60 digits); the ratio P / Pmax that decides a line is computed in doubles, within about 1e-15 relative of the exact ratio, so a threshold within a few ulps of a line's exact ratio may keep or drop that line (the line-2 comparison's fresh#lines-threshold-at-1000th-ratio, whose threshold is the double just below the 1000th line's exact ratio: the tool drops that line); no aggregation to a resolving power; no measured spectrum compared; which uncertainty CIAAW prints in its value(u) entries is not stated on its page; one session wrote the script and the engine.; the line limit is applied during enumeration with the pruning bound's relative slack of one part in a billion: a pattern of one thousand lines or fewer whose extra candidates lie within that margin of the threshold may be refused, no pattern of more than one thousand lines is ever returned, and no returned line is affected; a formula starting with a digit (13CH2Cl2) is refused FORMULA_UNREADABLE since 2.0.1, 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

P(element configuration) = n! / prod(c_j!) x prod(p_j ^ c_j), Valkenborg et al. 2012's Eq. 3
P(isotopologue) = the product over elements of their configurations' probabilities, as the paper states on p. 99. An explanation, not the source, in two steps: (1) each of an element's n atoms takes isotope j with probability p_j, independently (independent is this record's word
the paper's premise is that molecules incorporate elemental isotopes according to their natural abundances, p. 97), so one assignment of isotopes to the n atoms with c_j atoms at isotope j has probability prod(p_j ^ c_j)
(2) the assignments with those counts number n! / prod(c_j!), the multinomial coefficient, so the configuration's probability is their product. The Python oracle evaluates this closed form, the coefficient as a product of exact integer binomials, and does not convolve single-atom distributions, so it checks the arithmetic, not the closed form
IsoSpecPy also evaluates the multinomial
Symbol Meaning and unit
n atoms of the element
c_j atoms at isotope j
p_j amount fraction of isotope j
P probability of a configuration or isotopologue

Source: Valkenborg D, Mertens I, Lemière F, Witters E, Burzykowski T. The isotopic distribution conundrum. Mass Spectrometry Reviews 2012;31:96–109, equation 3, with the worked term Pr(12C110 13C2) = 112!/(110! 2!) Pr(12C)^110 Pr(13C)^2, p. 99 (worked terms continue on 100), section II.B, The Multinomial Expansion: 'The probability of occurrence of an isotopic variant of the entire biomolecule is calculated as the product of the probabilities for the corresponding element-specific isotopic variants.', version of record, the publisher's PDF, 14 pages, a copy supplied to the session on 25 November 2026; the hash is of the copy read, and another copy may hash differently; read in full on 2026-11-25 by an AI-assisted session; not yet checked by a person. Read from the file itself, SHA-256 beginning 14001b006b9a. Behind a subscription (© 2011 Wiley Periodicals, Inc.), checked 2026-11-25. No erratum found (searched Crossref, the DOI's record (api.crossref.org/works/10.1002/mas.20339, 25 November 2026): no update-to, no updated-by, no relation; pages 96-109, Crossref, works that update the DOI (filter updates:10.1002/mas.20339): 0 results, Europe PMC, MED 21590704: no comment or correction listed; a title search finds the article alone), 2026-11-25.

Equation 2

m/z = (sum of the line's nuclide masses - q x m(e)) / z, with q = +z for a positive ion and -z for a negative one: m/z is the ion's mass over the unified atomic mass unit divided by its charge number (IUPAC 2013, entry 356)
the ion's mass as the sum of its nuclide masses less q electrons is Drybench's construction, binding energies not modelled. The reply's unit Th is the thomson, which entry 356's Note 3 deprecates
it is kept as the label of that dimensionless quotient
Symbol Meaning and unit
m(nuclide) AME2020 atomic mass, Da
m(e) electron mass, Da
q signed charge
z charge number
m/z m/z, the dimensionless quotient of IUPAC 2013 entry 356 (the name 'mass-to-charge ratio' is deprecated there), Th

Source: Murray 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, p. 1570-1571, section entry 356, m/z: the ion's mass over the unified atomic mass unit, divided by its charge number (regardless of sign); Note 3, the thomson (Th) deprecated, version of record, read from a mirror copy (research.cbc.osu.edu) whose title page matches the DOI, not from the publisher's host; read in full on 2026-11-14 by an AI-assisted session; not yet checked by a person. Read from the file itself, SHA-256 beginning 33f26ca2d82e. Free to read (free to read (IUPAC Recommendations); © IUPAC), checked 2026-11-11. No erratum found (searched web search: the title with erratum, the DOI landing page's listing, as search results show it), 2026-11-11.

Equation 3

bound = sum over atoms of count x u(nuclide), summed linearly, plus z x u(m(e)), over z, rounded up to two significant figures
a line is kept when P / Pmax >= relativeThreshold (inclusive)
lines in ascending m/z
coverage = the sum of the kept lines' probabilities
a label names every isotope other than each element's most abundant one in the composition in use (the table's, or the stated one
of two equally abundant, the lighter), as mass number, symbol and count (the count always written), isotopes in ascending mass number and elements in alphabetical order, separated by spaces, or none for the line in which every element is at its most abundant isotope alone, so a line lighter than that one is labelled too (74Se1, 10B1)
naturalRange lists the CIAAW 2024 entries of each element in the formula whose composition is not stated, by symbol and then mass number, and lists no stated element
Symbol Meaning and unit
P, Pmax probability of a line, and of the most probable line
u(nuclide) AME2020 uncertainty, Da
u(m(e)) standard uncertainty of the electron mass, Da

Source: 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, the NIST page; the IUPAC 2009 compositions; sha256 is of the text extracted by pipeline/library/mass-spectrometry/page_text_hash.py (script and style elements removed, tags removed, entities decoded, lines stripped, empty lines dropped, joined with , UTF-8), reproduced at 11:51Z, 12:14Z and 12:55Z on 14 November 2026; the byte hash d7d5a9fe74a4c03930992104d83ab3474b5b00e7b2d68e37e69b1e89ff45916f of 10 November is historical, the page now carrying a per-request script; read in full on 2026-11-10 by an AI-assisted session; not yet checked by a person. Read from the file itself, SHA-256 beginning 2f4a7cb1646a. Free to read (NIST public information (US government work)), checked 2026-11-10. No erratum found (searched web search: Isotopic compositions of the elements 2009 Berglund Wieser erratum, the IUPAC publication page), 2026-11-11.

Constants

Constant Value and unit Source Date read
IUPAC 2009 representative isotopic compositions (as NIST serves them), or the caller's stated composition (p_j) 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
the natural range stated in the reply, and the check on each element's most abundant isotope (CIAAW 2024 ranges) a table of values, part of the method CIAAW (IUPAC Commission on Isotopic Abundances and Atomic Weights), Isotopic Compositions of the Elements, table Representative isotopic composition, every element 2026-11-10
AME2020 atomic masses and uncertainties, tabulated in units of 1e-12 u (the file prints micro-u; divide by one million) (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

Worked example

Worked example: one case of isotope-pattern@3.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

  • formula = CH2Cl2
  • charge = 1
  • polarity = positive
  • relativeThreshold = 0.000001

Steps

  1. pC = 0.9893, from formula; by equation 1.
  2. pH2 = 0.99977001, from formula; by equation 1.
  3. pCl2 = 0.57395776, from formula; by equation 1.
  4. P = 0.56768582, from pC, pH2, pCl2; by equation 1; gives peaks[0].probability.
  5. pCl35Cl37 = 0.36728448, from formula; by equation 1.
  6. ratio = 0.63991552, from pCl35Cl37, pCl2; by equation 1; gives peaks[3].relativeIntensity.
  7. mass = 83.953355 Da, from formula; by equation 2.
  8. mz = 83.952807 Th, from mass, charge; by equation 2; gives peaks[0].mz.

The working, as the case writes it:

Cl2 alone: 0.7576^2 = 0.57395776, 2 x 0.7576 x 0.2424 = 0.36728448, 0.2424^2 = 0.05875776
relative to the first, 1 : 0.639916 : 0.102373. The all-12C, all-1H peaks with 35Cl2, 35Cl37Cl and 37Cl2 keep exactly these ratios, since the C and H factors are common to all three
the 13C and 2H satellites are separate fine-structure peaks

Answer

  • peaks[0].probability = 0.56768582
  • peaks[3].relativeIntensity = 0.63991552
  • peaks[0].mz = 83.952807 Th

Where these values came from: our own exact-arithmetic script and a hand-worked case; exact multinomial convolution in Python decimal, by stored reference values.

At build the tool returned this answer within the tolerance the file states: peak m/z equal at the reported decimals (absolute 1e-9 Th on the rounded values); probabilities, relative intensities and coverage absolute 1e-12; bounds, ranges, labels, counts, formulas, statuses and codes exact.

Who worked this case: not recorded.

What it refuses, and its input ranges

  • CHARGED_FORMULA: the formula has a charge written in it: the charge is given separately Next: Write the ion's own formula without a charge sign, and give its charge and polarity separately.
  • FORMULA_UNREADABLE: a symbol that is no element, an empty formula, a zero count, a parse error Next: Correct the formula: element symbols with their counts and brackets closed.
  • ELEMENT_NOT_IN_TABLE: an element with no representative composition (technetium and the like); a stated composition does not lift this in this version Next: No change of input makes this computable on these data.
  • MONOISOTOPE_NOT_FIXED: an element whose most abundant isotope can change within CIAAW 2024 (lead), not stated by the caller: its base peak is not fixed either Next: State the element's isotopic composition for the material measured.
  • COMPOSITION_DOES_NOT_SUM_TO_ONE: a stated composition whose fractions do not sum to one Next: Give fractions for each element that sum to one.
  • COMPOSITION_FOR_ABSENT_ELEMENT: a stated composition for an element the formula lacks Next: State compositions only for elements in the formula.
  • NUCLIDE_NOT_IN_TABLE: a stated isotope AME2020 does not tabulate Next: State only isotopes that AME2020 tabulates.
  • ESTIMATED_MASS: a stated isotope whose AME2020 mass is marked estimated (#) Next: State only isotopes whose AME2020 mass is measured, not estimated.
  • TOO_MANY_ATOMS: more than one hundred thousand atoms of one element Next: No threshold or charge makes this computable here; a pattern this large needs a tool built for large molecules, one that lists only the lines above threshold or merges lines by resolving power.
  • TOO_MANY_CONFIGURATIONS: more than one million units of work to list the configurations: summed over elements, the isotopes of non-zero fraction times the ways of placing the element's atoms on them Next: No change of threshold helps; a pattern this large needs a tool built for large molecules, one that lists only the lines above threshold or merges lines by resolving power.
  • TOO_MANY_LINES: more than one thousand lines at or above relativeThreshold Next: Raise relativeThreshold until one thousand lines or fewer remain.

Changes

2026-11-25-isotope-pattern@3.0.0-1

2026-11-25 · isotope-pattern@3.0.0 · Corrections to our methods

  • What was wrong: Each isotope's fraction was used as the nearest double rather than the decimal it is written as, which differs by up to about 5.5e-17 relative. Multiplied by the atom count, this put one relative error of the same sign on every line, up to 5.5e-12 at one hundred thousand atoms. Each line stayed within the absolute 1e-12 the method's fixtures state, but the coverage, their sum, did not: H100000 at threshold 0.5 gave 0.7645868491571434 where the 60-digit value is 0.7645868491553286 (1.8e-12 off), and C99000H2000 at 0.9 gave 0.28356537770429413 for 0.28356537770561463 (1.3e-12).
  • Affected: Calls in versions 2.0.0 and 2.0.1 of the assistant tool ms_isotope_pattern, which was held from serving throughout: line probabilities, relative intensities and coverage, by an amount that grows with the atom count. Below a thousand atoms every probability moved by at most 4.4e-16 absolute (5.9e-15 relative), and at C1000 by 4.4e-14 relative. Masses, bounds, decimals, labels, line counts and refusals were not affected.
  • What changed: In 3.0.0 each fraction's logarithm is the logarithm of its double plus the exact correction to the decimal it is written as (the table's text, or a stated fraction's shortest round-trip decimal), and the count times that logarithm enters the compensated sum as two exact products. Against 60-digit values the coverage at H100000 is now 2.6e-15 off and at C99000H2000 1.2e-13; the largest line difference over 139 cases is 5.1e-15. Every computed output can move in its last bits; 26 of the 63 recorded cases did.
  • How it was found: The comparison of 25 November 2026 with a fresh agent's second implementation in Python decimal at 60 digits (line 2 of the method's full check, 139 cases), filed as D0273B-F4; a 60-digit binomial on H100000 agreed with the agent to 1e-57, so the error was the tool's.
  • Cases added: stored reference values: 96 of the fresh agent's 139 cases, its expected values, including C100000, H100000 and C99000H2000 at thresholds that keep 10, 8 and 30 lines; stored reference values, -8 and -9: the cases of -3, -4 and -5 recorded again at 3.0.0, expected values unchanged.

2026-11-25-isotope-pattern@3.0.0-2

2026-11-25 · isotope-pattern@3.0.0 · Corrections to our methods

  • What was wrong: The method's text said a label names the heavy isotopes only, or none for the lightest isotopologue. The replies have always left each element's most abundant isotope unlabelled instead, so where that isotope is not the lightest, a lighter line carries a label and the line labelled none is not the lightest: selenium's 74Se1, boron's 10B1, lead's 204Pb1 and tin's 116Sn3, and 12C3 under a stated carbon-13-rich composition.
  • Affected: The method's text in versions 1.0.0 to 2.0.1 of the assistant tool ms_isotope_pattern, which was held from serving throughout. The replies' labels were not wrong for the rule they follow and did not change; a reader of the text would have expected another label on lines of selenium, boron, lead, tin and other elements whose most abundant isotope is not the lightest, and of a stated composition whose most abundant isotope is not the lightest.
  • What changed: In 3.0.0 the text states the rule the replies follow: a label names every isotope other than each element's most abundant one in the composition in use (of two equally abundant, the lighter), and none is the line in which every element is at its most abundant isotope.
  • How it was found: Found in the full check of 14 November 2026 (MS-F14), which the scientific review asked to be corrected in the method's text; found again on 25 November 2026 by a fresh agent's second implementation, which read the text as written and differed from the replies on 534 lines in 20 of 139 cases, each by that reference isotope alone (D0273B-F5).
  • Cases added: None needed for the replies, which did not change; the 20 cases are named in the line-2 comparison, where each reply's reference isotope is checked to be the most abundant in the composition in use.

Tools that use it

Cite this version

Isotope pattern of a formula at a charge. Drybench; isotope-pattern@3.0.0; https://www.drybench.com/methods/m/isotope-pattern/3.0.0 (accessed [date]).