onsite is a comprehensive Python package for mass spectrometry post-translational modification (PTM) localization. It provides algorithms for confident phosphorylation site localization and scoring, including implementations of AScore, PhosphoRS, and LucXor (LuciPHOr2).
We benchmarked onsite algorithms on the PXD000138 dataset using unified mzML/idXML inputs and consistent filtering (FDR < 0.01, tool-specific localization thresholds). Key takeaways:
| Tool | Total PSMs | Total phospho sites | Well-resolved sites | Uncertain sites | Global FLR |
|---|---|---|---|---|---|
| LuciPHOr | 111,588 | 118,625 | 48,186 | 37,337 | 0.0237 |
| AScore | 111,747 | 101,382 | 52,906 | 23,628 | 0.0283 |
| pyLucXor | 111,588 | 117,341 | 51,468 | 38,970 | 0.0304 |
| PhosphoRS | 111,747 | 107,552 | 50,000 | 26,354 | 0.0142 |
See benchmark.md for methodology, full tables, and analysis details.
onsite provides three complementary algorithms for PTM localization:
# Clone the repository
git clone https://github.com/bigbio/onsite.git
cd onsite
# Install with Poetry
poetry install
# Activate the virtual environment
poetry shell
# Install from PyPI (when available)
pip install onsite
# Or install from source
git clone https://github.com/bigbio/onsite.git
cd onsite
pip install -e .
# Clone the repository
git clone https://github.com/bigbio/onsite.git
cd onsite
# Install with development dependencies
poetry install --with dev
# Or with pip
pip install -e ".[dev]"
onsite provides a unified command-line interface for all algorithms:
# AScore algorithm
onsite ascore -in spectra.mzML -id identifications.idXML -out results.idXML
# PhosphoRS algorithm
onsite phosphors -in spectra.mzML -id identifications.idXML -out results.idXML
# LucXor algorithm
onsite lucxor -in spectra.mzML -id identifications.idXML -out results.idXML
# Basic usage
python -m onsite.ascore.cli -in spectra.mzML -id identifications.idXML -out results.idXML
# With custom parameters
python -m onsite.ascore.cli -in spectra.mzML -id identifications.idXML -out results.idXML \
--fragment-mass-tolerance 0.05 \
--fragment-mass-unit Da \
--threads 4 \
--add-decoys
# Basic usage
python -m onsite.phosphors.cli -in spectra.mzML -id identifications.idXML -out results.idXML
# With custom parameters
python -m onsite.phosphors.cli -in spectra.mzML -id identifications.idXML -out results.idXML \
--fragment-mass-tolerance 0.05 \
--fragment-mass-unit Da \
--threads 1 \
--add-decoys
# Basic usage
python -m onsite.lucxor.cli -in spectra.mzML -id identifications.idXML -out results.idXML
# With custom parameters
python -m onsite.lucxor.cli -in spectra.mzML -id identifications.idXML -out results.idXML \
--fragment-method HCD \
--fragment-mass-tolerance 0.5 \
--fragment-error-units Da \
--threads 8 \
--debug
| Option | Default | Description |
|---|---|---|
-in |
- | Input mzML file with spectra |
-id |
- | Input idXML file with identifications |
-out |
- | Output idXML file with scores |
--fragment-mass-tolerance |
0.05 | Fragment mass tolerance |
--fragment-mass-unit |
Da | Tolerance unit (Da or ppm) |
--threads |
1 | Number of threads for parallel processing |
--add-decoys |
False | Include decoy sites for validation |
--debug |
False | Enable debug logging |
| Option | Default | Description |
|---|---|---|
-in |
- | Input mzML file with spectra |
-id |
- | Input idXML file with identifications |
-out |
- | Output idXML file with scores |
--fragment-mass-tolerance |
0.05 | Fragment mass tolerance |
--fragment-mass-unit |
Da | Tolerance unit (Da or ppm) |
--threads |
1 | Number of threads for parallel processing |
--add-decoys |
False | Include decoy sites for validation |
--debug |
False | Enable debug logging |
| Option | Default | Description |
|---|---|---|
-in |
- | Input mzML file with spectra |
-id |
- | Input idXML file with identifications |
-out |
- | Output idXML file with scores |
--fragment-method |
CID | Fragmentation method (CID or HCD) |
--fragment-mass-tolerance |
0.5 | Fragment mass tolerance |
--fragment-error-units |
Da | Tolerance units (Da or ppm) |
--min-mz |
150.0 | Minimum m/z value to consider |
--target-modifications |
Phospho (S/T/Y) | List of target PTM definitions |
--neutral-losses |
sty -H3PO4 -97.97690 | Neutral loss definitions applied during scoring |
--decoy-mass |
79.966331 | Mass offset used when generating decoy permutations |
--decoy-neutral-losses |
X -H3PO4 -97.97690 | Neutral loss patterns for decoy permutations |
--max-charge-state |
5 | Maximum charge state |
--max-peptide-length |
40 | Maximum peptide length |
--max-num-perm |
16384 | Maximum permutations |
--modeling-score-threshold |
0.95 | Minimum score for selecting PSMs during model building |
--scoring-threshold |
0.0 | Minimum LucXor score to report |
--min-num-psms-model |
50 | Minimum number of high-scoring PSMs required for modeling |
--threads |
1 | Number of threads for parallel processing |
--rt-tolerance |
0.01 | RT tolerance used when matching spectra by retention time |
--debug |
False | Enable debug logging |
The AScore algorithm provides phosphorylation site localization by analyzing MS/MS fragment ions to identify site-determining ions and computing localization probabilities based on fragment evidence.
Output Metrics:
AScore_pep_score: Overall peptide scoreAScore_1, AScore_2, ...: Individual site scoresProForma: Standardized sequence notation with confidence scoresThe PhosphoRS algorithm implements a comprehensive approach using isomer generation, theoretical spectrum matching, and probability scoring for confident phosphorylation site assignment.
Output Metrics:
LucXor implements the complete LuciPHOr2 algorithm with two-stage processing for accurate PTM localization with false localization rate (FLR) estimation.
Output Metrics:
Luciphor_delta_score: Main localization scoreLuciphor_pep_score: Peptide identification scoreLuciphor_global_flr: Global false localization rateLuciphor_local_flr: Local false localization rateYou can find example result files in the data directory. Here are the direct links to different algorithm result files:
| Algorithm | Description | Result File |
|---|---|---|
| AScore | AScore phosphorylation site localization results | AScore Example |
| PhosphoRS | PhosphoRS phosphorylation site localization results | PhosphoRS Example |
| LucXor | LucXor (LuciPHOr2) PTM localization results with FLR | LucXor Example |
For more detailed information:
To contribute to onsite:
git clone https://github.com/YOUR-USERNAME/onsitegit checkout -b new-featurepip install -e .poetry run pytestgit commit -am 'Add new feature'git push origin new-featureThis project is licensed under the MIT License - see the LICENSE file for details.
If you use onsite in your research, please cite:
onsite: Mass spectrometry post-translational modification localization tool.
https://github.com/bigbio/onsite
If you have questions or need assistance:
onsite builds upon the excellent work of the original algorithm developers and the OpenMS community. We thank all contributors and users for their feedback and support.