MS²PIP 4.2 brings drastically improved computational performance and stability. The entire C/Cython backend has been replaced with Rust (via ms2rescore-rs), cutting prediction time by ~30% and eliminating a scaling bottleneck that made more CPU cores slower. The package is now a pure-Python wheel, with no compilation on install, and requires Python 3.11+. Alongside this backend rewrite, a new ms2_tolerance_mode option allows switching between Da and ppm tolerances.
Added
- All prediction, m/z calculation, and spectrum annotation now use ms2rescore-rs (Rust); replaces C/Cython backend
ms2_tolerance_modeparameter ("Da"or"ppm") on all correlation/annotation functions and CLIcorrelatenow accepts preloaded spectra on PSMs (MS2Spectrum/AnnotatedMS2Spectrum)read_psmsacceptslist[PSM]in addition toPSMList,str, andPath- Replaced remaining C-based model files with native XGBoost models (HCD2019, TMT, and HCDch2)
- XGBoost models are now pre-loaded across
predict_librarybatches for improved efficiency rtandimoptional dependency groups for DeepLC and IM2Deep- Min/max length validators on
ProteomeSearchSpace - CUDA_VISIBLE_DEVICES workaround on XGBoost model load (dmlc/xgboost#11283)
- API docs for
ms2pip.resultandms2pip.spectrum
Changed
- Minimum Python version raised to 3.11
- Package is now a pure-Python wheel (no compiled extensions)
- Batch processing uses Rayon-parallelized Rust calls instead of Python multiprocessing
- DeepLC integration uses
deeplc.predict()functional API (replaces class-basedDeepLCwrapper) - IM2Deep integration uses
im2deep.predict()functional API (replaces legacyim2deep.im2deep.predict_ccs) predict_librarynow runs RT/IM predictions once on the full filtered PSMList before batching (closes #243)- Invalid peptidoforms (unsupported amino acids, length outside 4–100, missing charge) are skipped with a summarized warning instead of raising
- Bumped ms2rescore-rs requirement to
>=0.5.0a3,<2 - Bumped psm_utils requirement to
>=1.5
Removed
- C/Cython components:
_cython_modules/,_models_c/,setup.py,MANIFEST.in - All Python-based multiprocessing (
_Parallelizedclass) _utils/retention_time.pyand_utils/ion_mobility.py(inlined intocore.py)- iRT calibration peptides (DeepLC v4 handles calibration internally)
- Minor breaking change:
ms2pip.constants.MODELSentries no longer containid,peaks_version, orfeatures_versionkeys (C/Cython routing metadata); replaced byfragmentation. Code accessing these keys directly will break.
Fixed
annotate-spectraCLI crash (.with_suffix()called with no argument)write_correlationsnow acceptsPathobjects_peptidoform_spacesempty check usesis Noneinstead of truthinessSpectrummodel: deprecatedmodel_validator/classmethodcombination, missing serializers fornp.ndarrayfields (brokemodel_dump_json()), and equality comparison crashing on array fields