Skip to content

v4.2.0

Latest

Choose a tag to compare

@RalfG RalfG released this 13 Jul 17:02

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_mode parameter ("Da" or "ppm") on all correlation/annotation functions and CLI
  • correlate now accepts preloaded spectra on PSMs (MS2Spectrum / AnnotatedMS2Spectrum)
  • read_psms accepts list[PSM] in addition to PSMList, str, and Path
  • Replaced remaining C-based model files with native XGBoost models (HCD2019, TMT, and HCDch2)
  • XGBoost models are now pre-loaded across predict_library batches for improved efficiency
  • rt and im optional 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.result and ms2pip.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-based DeepLC wrapper)
  • IM2Deep integration uses im2deep.predict() functional API (replaces legacy im2deep.im2deep.predict_ccs)
  • predict_library now 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 (_Parallelized class)
  • _utils/retention_time.py and _utils/ion_mobility.py (inlined into core.py)
  • iRT calibration peptides (DeepLC v4 handles calibration internally)
  • Minor breaking change: ms2pip.constants.MODELS entries no longer contain id, peaks_version, or features_version keys (C/Cython routing metadata); replaced by fragmentation. Code accessing these keys directly will break.

Fixed

  • annotate-spectra CLI crash (.with_suffix() called with no argument)
  • write_correlations now accepts Path objects
  • _peptidoform_spaces empty check uses is None instead of truthiness
  • Spectrum model: deprecated model_validator/classmethod combination, missing serializers for np.ndarray fields (broke model_dump_json()), and equality comparison crashing on array fields