Skip to content

Commit 53e4cee

Browse files
Merge pull request #264 from CompOmics/percolator-removal
Percolator removal
2 parents 3b26484 + fd0976d commit 53e4cee

14 files changed

Lines changed: 63 additions & 352 deletions

File tree

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ Modular and user-friendly platform for AI-assisted rescoring of peptide identifi
1313
## About MS²Rescore
1414

1515
MS²Rescore performs ultra-sensitive peptide identification rescoring with LC-MS predictors such as
16-
[MS²PIP][ms2pip] and [DeepLC][deeplc], and with ML-driven rescoring engines
17-
[Percolator][percolator] or [Mokapot][mokapot]. This results in more confident peptide
16+
[MS²PIP][ms2pip] and [DeepLC][deeplc], using ML-driven rescoring engines
17+
like [Mokapot][mokapot]. This results in more confident peptide
1818
identifications, which allows you to get **more peptide IDs** at the same false discovery rate
1919
(FDR) threshold, or to set a **more stringent FDR threshold** while still retaining a similar
2020
number of peptide IDs. MS²Rescore is **ideal for challenging proteomics identification workflows**,
@@ -106,7 +106,6 @@ make a [pull request][pr]!
106106
[publication-branch]: https://github.com/compomics/ms2rescore/tree/pub
107107
[ms2pip]: https://github.com/compomics/ms2pip
108108
[deeplc]: https://github.com/compomics/deeplc
109-
[percolator]: https://github.com/percolator/percolator/
110109
[mokapot]: https://mokapot.readthedocs.io/
111110
[psm_utils]: https://github.com/compomics/psm_utils
112111
[file-formats]: https://psm-utils.readthedocs.io/en/stable/#supported-file-formats
-94.6 KB
Binary file not shown.

docs/source/api/ms2rescore.rescoring_engines.rst

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,3 @@ Mokapot
1212

1313
.. automodule:: ms2rescore.rescoring_engines.mokapot
1414
:members:
15-
16-
17-
18-
Percolator
19-
##########
20-
21-
.. automodule:: ms2rescore.rescoring_engines.percolator
22-
:members:

docs/source/config_schema.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
- **`ms2`**: Refer to *[#/definitions/ms2](#definitions/ms2)*.
1515
- **`rescoring_engine`** *(object)*: Rescoring engine to use and its configuration. Leave empty to skip rescoring and write features to file. Default: `{"mokapot": {}}`.
1616
- **`.*`**: Refer to *[#/definitions/rescoring_engine](#definitions/rescoring_engine)*.
17-
- **`percolator`**: Refer to *[#/definitions/percolator](#definitions/percolator)*.
1817
- **`mokapot`**: Refer to *[#/definitions/mokapot](#definitions/mokapot)*.
1918
- **`psm_generator`** *(object)*: PSM generator and their configuration.
2019
- **`.*`**: Refer to *[#/definitions/psm_generator](#definitions/psm_generator)*.
@@ -124,8 +123,3 @@
124123
- **`train_fdr`** *(number)*: FDR threshold for training Mokapot. Minimum: `0`. Maximum: `1`. Default: `0.01`.
125124
- **`write_weights`** *(boolean)*: Write Mokapot weights to a text file. Default: `false`.
126125
- **`write_txt`** *(boolean)*: Write Mokapot results to a text file. Default: `false`.
127-
- <a id="definitions/percolator"></a>**`percolator`** *(object)*: Percolator rescoring engine configuration. Can contain additional properties. Refer to *[#/definitions/rescoring_engine](#definitions/rescoring_engine)*.
128-
- **`init-weights`**: Weights file for scoring function. Default: `false`.
129-
- **One of**
130-
- *string*
131-
- *null*

docs/source/installation.rst

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -60,23 +60,6 @@ files, ``<tag>`` is the container version tag, and ``<ms2rescore-arguments>`` ar
6060
command line options (see :ref:`Command line interface`).
6161

6262

63-
Installing Percolator
64-
=====================
65-
66-
To use :ref:`percolator` as rescoring engine, it must be installed separately. Percolator is
67-
available for most platforms and can be downloaded from the
68-
`GitHub releases page <https://github.com/percolator/percolator/releases/latest>`_. Ensure that
69-
the ``percolator`` executable is in your ``PATH``. On Windows, this can be done by checking the
70-
``Add percolator to the system PATH for current user`` option during installation:
71-
72-
.. figure:: ../_static/img/percolator-install-path.png
73-
:width: 60%
74-
:alt: Percolator installation on Windows
75-
76-
.. note::
77-
Alternatively, :ref:`mokapot` can be used as rescoring engine, which does not require a separate
78-
installation.
79-
8063
For development
8164
===============
8265

docs/source/tutorials/in-depth-python-api.ipynb

Lines changed: 35 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5103,14 +5103,36 @@
51035103
{
51045104
"cell_type": "markdown",
51055105
"metadata": {},
5106-
"source": "### Parsing modification names\n\nWhile `psm_utils` could take care of all file parsing, we must still map the amino acid modification names that were used by the search engine to ones that are recognized by tools such as MS²PiP and DeepLC. This includes:\n\n- Names as used in the Unimod or PSI-MOD databases\n- Accession numbers as used in the Unimod or PSI-MOD databases\n- Chemical formulas\n- Mass shifts in Da\n\nNote that, for instance DeepLC, requires a chemical formula to encode modifications. It will not be able to correctly encode modifications if only the mass shift is provided. It is therefore always preferred to provide a name/accession of a database where this information can be retrieved, or provide the chemical formula directly.\n\nIf a chemical formula is provided, other tools, such as MS²PIP, can use it to derive the correct mass shift.\n\nTo map modification names, simply provide a dictionary to the `psm_list.map_modifications` method."
5106+
"source": [
5107+
"### Parsing modification names\n",
5108+
"\n",
5109+
"While `psm_utils` could take care of all file parsing, we must still map the amino acid modification names that were used by the search engine to ones that are recognized by tools such as MS²PiP and DeepLC. This includes:\n",
5110+
"\n",
5111+
"- Names as used in the Unimod or PSI-MOD databases\n",
5112+
"- Accession numbers as used in the Unimod or PSI-MOD databases\n",
5113+
"- Chemical formulas\n",
5114+
"- Mass shifts in Da\n",
5115+
"\n",
5116+
"Note that, for instance DeepLC, requires a chemical formula to encode modifications. It will not be able to correctly encode modifications if only the mass shift is provided. It is therefore always preferred to provide a name/accession of a database where this information can be retrieved, or provide the chemical formula directly.\n",
5117+
"\n",
5118+
"If a chemical formula is provided, other tools, such as MS²PIP, can use it to derive the correct mass shift.\n",
5119+
"\n",
5120+
"To map modification names, simply provide a dictionary to the `psm_list.map_modifications` method."
5121+
]
51075122
},
51085123
{
51095124
"cell_type": "code",
51105125
"execution_count": null,
51115126
"metadata": {},
51125127
"outputs": [],
5113-
"source": "psm_list.rename_modifications({\n \"gl\": \"Gln->pyro-Glu\",\n \"ox\": \"Oxidation\",\n \"ac\": \"Acetylation\",\n \"de\": \"Deamidation\",\n})"
5128+
"source": [
5129+
"psm_list.rename_modifications({\n",
5130+
" \"gl\": \"Gln->pyro-Glu\",\n",
5131+
" \"ox\": \"Oxidation\",\n",
5132+
" \"ac\": \"Acetylation\",\n",
5133+
" \"de\": \"Deamidation\",\n",
5134+
"})"
5135+
]
51145136
},
51155137
{
51165138
"cell_type": "markdown",
@@ -5785,7 +5807,15 @@
57855807
{
57865808
"cell_type": "markdown",
57875809
"metadata": {},
5788-
"source": "#### Configuring MS²PIP\n\nIn contrast to the basic feature generator, MS²PIP requires some parameters to be set and requires access to the original observed peptide spectra:\n\n- `model`: Name of the prediction model to be used. This strongly depends on the dataset your are rescoring. A list of all MS²PIP models is available on https://ms2pip.readthedocs.io/en/latest/prediction-models/. \n- `ms2_tolerance`: As MS²PIP must reannotate the observed MS2 spectra, a mass tolerance must be set. For MS²PIP, this is configured in Dalton. A good value for Orbitrap spectra, for example, is `0.02`.\n- `processes`: Number of CPU processes to use for parallel processing. Note that higher values can lead to memory issues."
5810+
"source": [
5811+
"#### Configuring MS²PIP\n",
5812+
"\n",
5813+
"In contrast to the basic feature generator, MS²PIP requires some parameters to be set and requires access to the original observed peptide spectra:\n",
5814+
"\n",
5815+
"- `model`: Name of the prediction model to be used. This strongly depends on the dataset your are rescoring. A list of all MS²PIP models is available on https://ms2pip.readthedocs.io/en/latest/prediction-models/. \n",
5816+
"- `ms2_tolerance`: As MS²PIP must reannotate the observed MS2 spectra, a mass tolerance must be set. For MS²PIP, this is configured in Dalton. A good value for Orbitrap spectra, for example, is `0.02`.\n",
5817+
"- `processes`: Number of CPU processes to use for parallel processing. Note that higher values can lead to memory issues."
5818+
]
57895819
},
57905820
{
57915821
"cell_type": "code",
@@ -74922,7 +74952,7 @@
7492274952
"Using mokapot directly allows us to quickly generate `LinearPsmDataset` objects with different feature sets, for instance:\n",
7492374953
"\n",
7492474954
"- Only basic features\n",
74925-
"- Basic + MaxQuant-derived features (mimicking a traditional Percolator rescoring run)\n",
74955+
"- Basic + MaxQuant-derived features\n",
7492674956
"- Basic + MaxQuant-derived + MS²PIP features\n",
7492774957
"- Basic + MaxQuant-derived + MS²PIP + DeepLC features\n"
7492874958
]
@@ -111537,4 +111567,4 @@
111537111567
},
111538111568
"nbformat": 4,
111539111569
"nbformat_minor": 2
111540-
}
111570+
}

docs/source/userguide/configuration.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -287,9 +287,9 @@ the following configuration can be used:
287287
Configuring rescoring engines
288288
=============================
289289

290-
MS²Rescore supports multiple rescoring engines, such as Mokapot and Percolator. The rescoring
291-
engine can be selected and configured with the ``rescoring_engine`` option. For example, to use
292-
Mokapot with a custom train_fdr of 0.1%, the following configuration can be used:
290+
MS²Rescore uses Mokapot as its rescoring engine. It can be configured with the
291+
``rescoring_engine`` option. For example, to use Mokapot with a custom train_fdr of 0.1%, the
292+
following configuration can be used:
293293

294294
.. tab:: JSON
295295

docs/source/userguide/output-files.rst

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -38,26 +38,25 @@ Log and configuration files:
3838

3939
Rescoring engine files:
4040

41-
+-------------------------------------------------------------+-------------------------------------------------------------+
42-
| File | Description |
43-
+=============================================================+=============================================================+
44-
| ``<prefix>.<mokapot/percolator>.psms.txt`` | PSMs and their new scores at PSM-level FDR. |
45-
+-------------------------------------------------------------+-------------------------------------------------------------+
46-
| ``<prefix>.<mokapot/percolator>.peptides.txt`` | Peptides and their new scores at peptide-level FDR. |
47-
+-------------------------------------------------------------+-------------------------------------------------------------+
48-
| ``<prefix>.<mokapot/percolator>.proteins.txt`` | Proteins and their new scores at protein-level FDR. |
49-
+-------------------------------------------------------------+-------------------------------------------------------------+
50-
| ``<prefix>.<mokapot/percolator>.decoy.psms.txt`` | Decoy PSMs and their new scores at PSM-level FDR. |
51-
+-------------------------------------------------------------+-------------------------------------------------------------+
52-
| ``<prefix>.<mokapot/percolator>.decoy.peptides.txt`` | Decoy peptides and their new scores at peptide-level FDR. |
53-
+-------------------------------------------------------------+-------------------------------------------------------------+
54-
| ``<prefix>.<mokapot/percolator>.decoy.proteins.txt`` | Decoy proteins and their new scores at protein-level FDR. |
55-
+-------------------------------------------------------------+-------------------------------------------------------------+
56-
| ``<prefix>.<mokapot/percolator>.weights.txt`` | Feature weights, showing feature usage in the rescoring run |
57-
+-------------------------------------------------------------+-------------------------------------------------------------+
41+
+-----------------------------------------+-------------------------------------------------------------+
42+
| File | Description |
43+
+=========================================+=============================================================+
44+
| ``<prefix>.mokapot.psms.txt`` | PSMs and their new scores at PSM-level FDR. |
45+
+-----------------------------------------+-------------------------------------------------------------+
46+
| ``<prefix>.mokapot.peptides.txt`` | Peptides and their new scores at peptide-level FDR. |
47+
+-----------------------------------------+-------------------------------------------------------------+
48+
| ``<prefix>.mokapot.proteins.txt`` | Proteins and their new scores at protein-level FDR. |
49+
+-----------------------------------------+-------------------------------------------------------------+
50+
| ``<prefix>.mokapot.decoy.psms.txt`` | Decoy PSMs and their new scores at PSM-level FDR. |
51+
+-----------------------------------------+-------------------------------------------------------------+
52+
| ``<prefix>.mokapot.decoy.peptides.txt`` | Decoy peptides and their new scores at peptide-level FDR. |
53+
+-----------------------------------------+-------------------------------------------------------------+
54+
| ``<prefix>.mokapot.decoy.proteins.txt`` | Decoy proteins and their new scores at protein-level FDR. |
55+
+-----------------------------------------+-------------------------------------------------------------+
56+
| ``<prefix>.mokapot.weights.txt`` | Feature weights, showing feature usage in the rescoring run |
57+
+-----------------------------------------+-------------------------------------------------------------+
5858

59-
If no rescoring engine is selected, if Percolator was selected, or in DEBUG mode, the following
60-
files will also be written:
59+
If no rescoring engine is selected or in DEBUG mode, the following files will also be written:
6160

6261
+-------------------------------------------------------------+-----------------------------------------------------------+
6362
| File | Description |

ms2rescore/core.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
from ms2rescore.parse_spectra import MSDataType, add_precursor_values, annotate_spectra
1616
from ms2rescore.report import generate
1717
from ms2rescore.report.data import ReportData
18-
from ms2rescore.rescoring_engines import mokapot, percolator
18+
from ms2rescore.rescoring_engines import mokapot
1919
from ms2rescore.rescoring_engines.mokapot import (
2020
add_peptide_confidence,
2121
add_psm_confidence,
@@ -197,15 +197,7 @@ def rescore(configuration: Dict, psm_list: Optional[PSMList] = None) -> None:
197197
# Rescore PSMs
198198
feature_weights = None
199199
try:
200-
if "percolator" in config["rescoring_engine"]:
201-
percolator.rescore(
202-
psm_list,
203-
output_file_root=output_file_root,
204-
log_level=config["log_level"],
205-
processes=config["processes"],
206-
percolator_kwargs=config["rescoring_engine"]["percolator"],
207-
)
208-
elif "mokapot" in config["rescoring_engine"]:
200+
if "mokapot" in config["rescoring_engine"]:
209201
if "fasta_file" not in config["rescoring_engine"]["mokapot"]:
210202
config["rescoring_engine"]["mokapot"]["fasta_file"] = config["fasta_file"]
211203
if "protein_kwargs" in config["rescoring_engine"]["mokapot"]:

ms2rescore/gui/app.py

Lines changed: 2 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,6 @@
6969
"Mokapot: Fondrie et al. JPR (2021)",
7070
"https://doi.org/10.1021/acs.jproteome.0c01010",
7171
),
72-
(
73-
"Percolator: Käll et al. Nat Methods (2007)",
74-
"https://doi.org/10.1038/nmeth1113",
75-
),
7672
]
7773
LINKS = [
7874
(
@@ -671,30 +667,12 @@ def __init__(self, *args, **kwargs):
671667
self.configure(fg_color="transparent")
672668
self.grid_columnconfigure(0, weight=1)
673669

674-
self.radio_button = widgets.LabeledRadioButtons(
675-
self,
676-
label="Rescoring engine",
677-
options=["Mokapot", "Percolator"],
678-
default_value="Mokapot",
679-
)
680-
self.radio_button.grid(row=0, column=0, pady=(0, 10), sticky="nsew")
681-
682670
self.mokapot_config = MokapotRescoringConfiguration(self)
683-
self.mokapot_config.grid(row=1, column=0, pady=(0, 10), sticky="nsew")
684-
685-
self.percolator_config = PercolatorRescoringConfiguration(self)
686-
self.percolator_config.grid(row=2, column=0, pady=(0, 10), sticky="nsew")
671+
self.mokapot_config.grid(row=0, column=0, pady=(0, 10), sticky="nsew")
687672

688673
def get(self) -> Dict:
689674
"""Return the configuration as a dictionary."""
690-
if self.radio_button.get().lower() == "mokapot":
691-
return {self.radio_button.get().lower(): self.mokapot_config.get()}
692-
elif self.radio_button.get().lower() == "percolator":
693-
return {self.radio_button.get().lower(): self.percolator_config.get()}
694-
else:
695-
raise MS2RescoreConfigurationError(
696-
f"Unknown rescoring engine: {self.radio_button.get().lower()}"
697-
)
675+
return {"mokapot": self.mokapot_config.get()}
698676

699677

700678
class MokapotRescoringConfiguration(ctk.CTkFrame):
@@ -757,28 +735,6 @@ def _parse_protein_kwargs(table_output):
757735
return protein_kwargs
758736

759737

760-
class PercolatorRescoringConfiguration(ctk.CTkFrame):
761-
def __init__(self, *args, **kwargs):
762-
"""Rescoring engine configuration frame."""
763-
super().__init__(*args, **kwargs)
764-
765-
self.configure(fg_color="transparent")
766-
self.grid_columnconfigure(0, weight=1)
767-
768-
self.title = widgets._Heading(self, text="Percolator coffeeguration")
769-
self.title.grid(row=0, column=0, columnspan=2, pady=(0, 5), sticky="ew")
770-
771-
self.weights_file = widgets.LabeledFileSelect(
772-
self, label="Pretrained Percolator model weights", file_option="openfile"
773-
)
774-
self.weights_file.grid(row=1, column=0, columnspan=2, sticky="nsew")
775-
776-
def get(self) -> Dict:
777-
"""Return the configuration as a dictionary."""
778-
config = {"init-weights": self.weights_file.get()}
779-
return config
780-
781-
782738
class UpdateDialog(PopupWindow):
783739
def __init__(self, master, current: str, latest: str, url: str):
784740
msg = (

0 commit comments

Comments
 (0)