Skip to main page content
U.S. flag

An official website of the United States government

Dot gov

The .gov means it’s official.
Federal government websites often end in .gov or .mil. Before sharing sensitive information, make sure you’re on a federal government site.

Https

The site is secure.
The https:// ensures that you are connecting to the official website and that any information you provide is encrypted and transmitted securely.

Access keys NCBI Homepage MyNCBI Homepage Main Content Main Navigation
. 2025 Jul 4;24(7):3722-3730.
doi: 10.1021/acs.jproteome.5c00063. Epub 2025 Jun 2.

Pairwise Attention: Leveraging Mass Differences to Enhance De Novo Sequencing of Mass Spectra

Affiliations

Pairwise Attention: Leveraging Mass Differences to Enhance De Novo Sequencing of Mass Spectra

Joel Lapin et al. J Proteome Res. .

Abstract

A fundamental challenge in mass spectrometry-based proteomics is determining which peptide generated a given MS2 spectrum. Peptide sequencing typically relies on matching spectra against a known sequence database, which in some applications is not available. Deep learning-based de novo sequencing can address this limitation by directly predicting peptide sequences from MS2 data. We have seen the application of the transformer architecture to de novo sequencing produce state-of-the-art results on the so-called nine-species benchmark. In this study, we propose an improved transformer encoder inspired by the heuristics used in the manual interpretation of spectra. We modify the attention mechanism with a learned bias based on pairwise mass differences, termed Pairwise Attention (PA). Adding PA improves average peptide precision at 100% coverage by 12.7% (5.9 percentage points) over our base transformer on the original nine-species benchmark. We have also achieved a 7.4% increase over the previously published model Casanovo. Our MS2 encoding strategy is largely orthogonal to other transformer-based models encoding MS2 spectra, enabling straightforward integration into existing deep-learning approaches. Our results show that integrating domain-specific knowledge into transformers boosts de novo sequencing performance.

Keywords: Attention; De novo sequencing; MS2; Mass spectrometry; Proteomics; Transformers.

PubMed Disclaimer

Figures

1
1
Architecture of the Pairwise Attention model, depicted through the self-attention mechanism of the Transformer encoder. The original mass spectrum in the lower left is turned into 1D features via the peak encoder, which concatenates Fourier features of the m/z and intensity dimensions, and further processed into 2D features by taking the pairwise differences of its m/z values. As the 1D features are processed by standard Transformer encoder modules, i.e. self-attention and multilayer perceptron (MLP) networks, the 2D features are fed into the self-attention module as a learnable bias before the softmax attention. This bias is fed into self-attention mechanisms throughout the depth of the encoder. The Transformer decoder is unaltered from the original implementation. ,
2
2
Precision-coverage curves for our PA and base models, and Casanovo’s reported BM model. Nine-species V1 is displayed in a) and V2 is displayed in b). For the PA model, only the best of the 3 seeds is plotted.

References

    1. Aebersold R., Mann M.. Mass-spectrometric exploration of proteome structure and function. Nature. 2016;537(7620):347–355. doi: 10.1038/nature19949. - DOI - PubMed
    1. Cox J., Mann M.. MaxQuant enables high peptide identification rates, individualized p.p.b.-range mass accuracies and proteome-wide protein quantification. Nat. Biotechnol. 2008;26(12):1367–1372. doi: 10.1038/nbt.1511. - DOI - PubMed
    1. Perkins D. N., Pappin D. J. C., Creasy D. M., Cottrell J. S.. Probability-based protein identification by searching sequence databases using mass spectrometry data. Electrophoresis. 1999;20(18):3551–3567. doi: 10.1002/(SICI)1522-2683(19991201)20:18<3551::AID-ELPS3551>3.0.CO;2-2. - DOI - PubMed
    1. Dorfer V., Pichler P., Stranzl T., Stadlmann J., Taus T., Winkler S., Mechtler K.. MS Amanda, a Universal Identification Algorithm Optimized for High Accuracy Tandem Mass Spectra. J. Proteome Res. 2014;13(8):3679–3684. doi: 10.1021/pr500202e. - DOI - PMC - PubMed
    1. Kim S., Pevzner P. A.. MS-GF+ makes progress towards a universal database search tool for proteomics. Nat. Commun. 2014;5(1):5277. doi: 10.1038/ncomms6277. - DOI - PMC - PubMed

LinkOut - more resources