Lecture notes on Algorithmic Mass Spectrometry

Many years ago, I (Sebastian) started writing a textbook on the algorithmics (and, to a lesser extent, statistics and machine learning) behind computational mass spectrometry. Unfortunately, I never found the time to finish it. Consequently, I decided to release it “into the wild” in 2019. Since then, I could not find a co-author who would help me finish it. So, in 2026, I finally decided that the time is right for an LLM to help me. So, starting with version 0.9.0, Claude from Anthropic will help me finish the text. In the first iteration (0.9.0) this is only for spell checking, grammar, etc.. The upcoming version 0.9.1 will also contain fact-checking. With version 0.9.2 I will start closing the holes and todos in the book. What can possibly go wrong… 🙂

Update on Nov 4, 2026: Version 0.9.2 is released. Claude has helped me close all the holes. At least, the ones that Claude or I can see. For obvious reasons, the future reading parts are a little outdated now, and so is the list on missing chapters etc.. But I am not sure if I want to update that, because this is a bottomless pit. In particular, since the field continues expanding: In computational mass spectrometry for proteomics, the number of publications doubled from 2015 to 2025; computational MS for metabolomics quadrupled, and is now almost on par with proteomics. But this textbook was never meant as a “what’s new?” review. If you want that, let your favorite chatbot write you one, they are pretty good at that.

If you find any errors in the manuscript, please send me an email and I am happy to correct them! (There should be no chapters or sections marked “work in progress” left in the manuscript; if you find one, you are most likely reading an older version.) If you want to contribute, even better!

  • version 0.9.2 (Nov 4, 2026) — no more “work in progress” chapters, again with help from Claude; passages that Claude wrote and I checked are marked “Claude helped!” in the margin:
    • the chapter on comparing mass spectra and database searching is finished: scoring intensities, additional and missing peaks, fast alignment of spectra, the precursor mass error, many-to-many matchings, and hypothesis-driven recalibration
    • new sections on computing isotope distributions with the fast Fourier transform, on simulating isotopologues (isotopic fine structure), on graph theory and computational complexity, and on filtering vs. priors; a new item on data-independent acquisition among the missing chapters
    • a final consistency pass over the whole book: cross-references, notation, numbers that appear in several places, and leftovers from earlier versions; for example, a simpler algorithm for counting compomers, and new exercises
    • fewer parentheses in running text
  • version 0.9.1 (Oct 29, 2026) — a fact check and a domain review, again with help from Claude; text by Claude that I did not check myself is marked “Claude says” in the margin:
    • every chapter reviewed from the point of view of a domain expert; all recurrences and algorithms tested against brute force, which uncovered and fixed errors in several of them (peptide de novo sequencing, decompositions via the extended residue table, fragmentation trees, exact p-values)
    • all chapters checked against the cited papers and sources: corrections of historical facts, numbers and descriptions of methods in every chapter, for example the history of electrospray ionization and of FDR estimation, how early SEQUEST scored spectra, and the mass of 15N
    • atomic masses now consistently use AME2020
    • new text on GDB-20, on deep learning for peptide de novo sequencing, and on collision energies for peptides
    • bibliography entries and links checked and corrected
  • version 0.9.0 (Oct 23, 2026) — the first version prepared with help from Claude, see the preface. No new sections yet, but a thorough clean-up:
    • all chapters copy-edited: more than 1,000 corrections of grammar, spelling, punctuation and word choice, now consistently in American English; all chapter quotations checked against their sources; 13 new glossary entries
    • all calculations in the worked examples recomputed by script; corrections of proofs, formulas and indices in almost every chapter, for example the proof of the lower bound for decomposing isotope patterns, the running time for computing fragmentation trees, and the HIV example in the ML chapter
    • two bugs fixed in the recalibration algorithm (tie handling, points with identical mass)
    • isotope abundances updated to IUPAC values, all sucrose examples recomputed
    • new text on “guilt by association” methods for identifying metabolites
  • version 0.8.4 (Apr 29, 2022) is still not the major update I wanted to do, but loads of smaller changes and corrections, particularly for the ML section
  • version 0.8.3 (Sep 05, 2019) fixes tons of smaller stuff, plus changes suggested by Magnus Palmblad on isotope patterns, thanks a lot!
  • version 0.8.2 (Apr 13, 2019) fixes more typos — similar to those found by Hannes — throughout the text
  • version 0.8.1 (Apr 12, 2019) includes corrections by Hannes Röst, thanks a lot!
  • version 0.8.0 (Apr 2, 2019) — Winter is coming! No, wait… Lecture time is coming! Before that, the “last release” while I still have time. I have added the ILP for fragmentation tree computation, plus many things here and there. The largest ToDo remaining is the chapter on database searching. Again: Please, send me corrections. So far, none.
  • version 0.7.0 of the textbook (Mar 20, 2019) — I have mostly “finished” the chapters on p-values and decoy databases; I hope that someone who knows more about statistics than I do, can tell me where I erred.
  • version 0.6.0 of the textbook (Feb 27, 2019)

A Jupyter notebook with code solving and visualizing the exercises can be found here.