ms2rescore.feature_generators
Feature generators to add rescoring features to PSMs from various (re)sources and prediction tools.
- ms2rescore.feature_generators.FEATURE_GENERATORS: dict
Implemented feature generator classes by name.
ms2rescore.feature_generators.base
ms2rescore.feature_generators.basic
Generate basic features that can be extracted from any PSM list.
- class ms2rescore.feature_generators.basic.BasicFeatureGenerator(*args, **kwargs)
Bases:
FeatureGeneratorBaseGenerate basic features that can be extracted from any PSM list, including search engine score, charge state, and MS1 error.
- Parameters:
*args – Positional arguments passed to the base class.
**kwargs – Keyword arguments passed to the base class.
ms2rescore.feature_generators.deeplc
DeepLC retention time-based feature generator.
DeepLC is a fully modification-aware peptide retention time predictor. It uses a deep convolutional neural network to predict retention times based on the atomic composition of the (modified) amino acid residues in the peptide. See github.com/compomics/deeplc for more information.
If you use DeepLC through MS²Rescore, please cite:
Bouwmeester, R., Gabriels, R., Hulstaert, N. et al. DeepLC can predict retention times for peptides that carry unknown modifications. Nat Methods 18, 1363-1369 (2021). doi:10.1038/s41592-021-01301-5
- class ms2rescore.feature_generators.deeplc.DeepLCFeatureGenerator(*args, calibration_set_size=None, processes=1, finetune=None, **kwargs)
Bases:
FeatureGeneratorBaseGenerate DeepLC-based features for rescoring.
DeepLC finetuning is off by default. Set
finetune=Trueto enable it. The deprecateddeeplc_retrainkeyword is still accepted and mapped ontofinetune, with a deprecation warning; an explicitly passedfinetunetakes precedence over it.- Parameters:
calibration_set_size (int or float) – Amount of best PSMs to use for DeepLC calibration. If this value is lower than the number of available PSMs, all PSMs will be used. (default: 0.15)
processes ({int, None}) – Number of processes to use in DeepLC. Defaults to 1.
finetune (bool) – Whether to finetune DeepLC on high-confidence target PSMs before prediction. Defaults to False.
kwargs (dict) – Additional keyword arguments are passed to DeepLC.
ms2rescore.feature_generators.im2deep
IM2Deep ion mobility-based feature generator.
IM2Deep is a fully modification-aware peptide ion mobility predictor. It uses a deep convolutional neural network to predict retention times based on the atomic composition of the (modified) amino acid residues in the peptide. See github.com/compomics/IM2Deep for more information.
- class ms2rescore.feature_generators.im2deep.IM2DeepFeatureGenerator(multi=False, calibration_set_size=None, *args, processes=1, **kwargs)
Bases:
FeatureGeneratorBaseInitialize the IM2DeepFeatureGenerator.
- Parameters:
ms2rescore.feature_generators.ms2
MS2-based feature generator.
- class ms2rescore.feature_generators.ms2.MS2FeatureGenerator(*args, fragmentation_model='cidhcd', **kwargs)
Bases:
FeatureGeneratorBaseGenerate MS2-based features for rescoring.
- Parameters:
fragmentation_model (str) – Fragmentation model, used to determine active ion series for scoring. Defaults to
cidhcd(a, b, and y ions).
ms2rescore.feature_generators.ms2pip
MS²PIP fragmentation intensity-based feature generator.
MS²PIP is a machine learning tool that predicts the MS2 spectrum of a peptide given its sequence. It is previously identified MS2 spectra and their corresponding peptide sequences. Because MS²PIP uses the highly performant - but traditional - machine learning approach XGBoost, it can already produce accurate predictions even if trained on smaller spectral libraries. This makes MS²PIP a very flexible platform to train new models on custom datasets. Nevertheless, MS²PIP comes with several pre-trained models. See github.com/compomics/ms2pip for more information.
Because traditional proteomics search engines do not fully consider MS2 peak intensities in their scoring functions, adding rescoring features derived from spectrum prediction tools has proved to be a very effective way to further improve the sensitivity of peptide-spectrum matching.
MS²Rescore uses the unified ms2pip.correlate() API with spectra preloaded on
psm.spectrum. Both raw MS2Spectrum and pre-annotated AnnotatedMS2Spectrum objects
are accepted; ms2pip uses each PSM’s own annotation directly, so multi-rank inputs are handled
correctly.
If you use MS²PIP through MS²Rescore, please cite:
Declercq, A., Bouwmeester, R., Chiva, C., Sabidó, E., Hirschler, A., Carapito, C., Martens, L., Degroeve, S., Gabriels, R. Updated MS²PIP web server supports cutting-edge proteomics applications. Nucleic Acids Research (2023) doi:10.1093/nar/gkad335
- class ms2rescore.feature_generators.ms2pip.MS2PIPFeatureGenerator(*args, model='HCD', model_dir=None, processes=1, **kwargs)
Bases:
FeatureGeneratorBaseGenerate MS²PIP-based features.
- Parameters:
- add_features(psm_list)
Add MS²PIP-derived features to PSMs with preloaded spectra.
- Parameters:
psm_list (PSMList) – PSMs to add features to. Each PSM must have a spectrum attached on
psm.spectrum. BothMS2SpectrumandAnnotatedMS2Spectrumare accepted; ms2pip uses each PSM’s own annotation directly.- Return type:
None