compomics / ms2rescore

Modular and user-friendly platform for AI-assisted rescoring of peptide identifications
https://ms2rescore.readthedocs.io
Apache License 2.0
39 stars 14 forks source link

Implementation of get_search_engine_features for PeptideShaker input #33

Closed KunathBJ closed 9 months ago

KunathBJ commented 3 years ago

Hello,

I tried to install and run ms2rescore together with percolator on a peptideshaker output. I used conda environment and installed percolator using conda and ms2rescore using pip. When I call the tool I get the help printed so I'd guess my installation is correct but not entirely sure.

I tried to run ms2rescore using the command: ms2rescore -c config_defaut.json -m /scratch/users/bkunath/IMP_MetaP/MGF_LAO/D01 vi/scratch/users/bkunath/IMP_MetaP/OUT_LAO/D01.out/D01_1_1_Extended_PSM_Report.txt

and obtained this error:

2021-05-10 15:25:10 // INFO // ms2rescore // Using PeptideShakerPipeline.
2021-05-10 15:25:12 // ERROR // ms2rescore.__main__ // Critical error occured in MS2ReScore
Traceback (most recent call last):
  File "/home/users/bkunath/miniconda3/envs/ms2rescore/lib/python3.9/site-packages/ms2rescore/__main__.py", line 15, in main
    rescore.run()
  File "/home/users/bkunath/miniconda3/envs/ms2rescore/lib/python3.9/site-packages/ms2rescore/__init__.py", line 207, in run
    search_engine_features = self.pipeline.get_search_engine_features()
  File "/home/users/bkunath/miniconda3/envs/ms2rescore/lib/python3.9/site-packages/ms2rescore/id_file_parser.py", line 439, in get_search_engine_features
    return self.extended_psm_report.ext_psm_report.get_search_engine_features()
  File "/home/users/bkunath/miniconda3/envs/ms2rescore/lib/python3.9/site-packages/ms2rescore/peptideshaker.py", line 187, in get_search_engine_features
    raise NotImplementedError
NotImplementedError

Here is a copy of the config file if needed. Thanks a lot for your help! Ben

{
    "$schema": "./config_schema.json",
    "general":{
        "pipeline":"peptideshaker",
        "feature_sets":["all"],
        "run_percolator":true,
        "id_decoy_pattern": "REVERSED",
        "num_cpu":-1,
        "config_file":"/scratch/users/bkunath/IMP_MetaP/config_defaut.json",
        "tmp_path":"/scratch/users/bkunath/IMP_MetaP/MGF_LAO/ms2",
        "mgf_path":"/scratch/users/bkunath/IMP_MetaP/MGF_LAO/D01",
        "output_filename":"/scratch/users/bkunath/IMP_MetaP/MGF_LAO/ms2/D01",
        "log_level": "info"
    },
    "ms2pip": {
        "model": "HCD",
        "frag_error": 0.02,
        "modifications": [
            {"name":"Acetyl", "unimod_accession":1, "mass_shift":42.010565, "amino_acid":null, "n_term":true, "c_term": false},
            {"name":"Carbamidomethyl", "unimod_accession":4, "mass_shift":57.021464, "amino_acid":"C", "n_term":false, "c_term": false},
            {"name":"Deamidated", "unimod_accession":7, "mass_shift":0.984016, "amino_acid":"N", "n_term":false, "c_term": false},
            {"name":"PhosphoS", "unimod_accession":21, "mass_shift":79.966331, "amino_acid":"S", "n_term":false, "c_term": false},
            {"name":"PhosphoT", "unimod_accession":21, "mass_shift":79.966331, "amino_acid":"T", "n_term":false, "c_term": false},
            {"name":"PhosphoY", "unimod_accession":21, "mass_shift":79.966331, "amino_acid":"Y", "n_term":false, "c_term": false},
            {"name":"Pyro-carbamidomethyl", "unimod_accession":26, "mass_shift":39.994915, "amino_acid":"C", "n_term":false, "c_term": false},
            {"name":"Glu->pyro-Glu", "unimod_accession":27, "mass_shift":-18.010565, "amino_acid":"E", "n_term":true, "c_term": false},
            {"name":"Gln->pyro-Glu", "unimod_accession":28, "mass_shift":-17.026549, "amino_acid":"Q", "n_term":true, "c_term": false},
            {"name":"Oxidation", "unimod_accession":35, "mass_shift":15.994915, "amino_acid":"M", "n_term":false, "c_term": false},
            {"name":"iTRAQ", "unimod_accession":214, "mass_shift":144.102063, "amino_acid":null, "n_term":true, "c_term": false},
            {"name":"Ammonia-loss", "unimod_accession":385, "mass_shift":-17.026549, "amino_acid":"C", "n_term":true, "c_term": false},
            {"name":"TMT6plexN", "unimod_accession":737, "mass_shift":229.162932, "amino_acid":"N", "n_term":false, "c_term": false},
            {"name":"TMT6plex", "unimod_accession":737, "mass_shift":229.162932, "amino_acid":null, "n_term":true, "c_term": false},
            {"name":"Amidated", "unimod_accession": 2, "mass_shift": -0.984016, "amino_acid":null, "n_term": false, "c_term": true}
        ]
    },
    "maxquant_to_rescore": {
        "mgf_dir": "",
        "modification_mapping":{
            "ox":"Oxidation",
            "ac":"Acetyl",
            "cm":"Carbamidomethyl",
            "de":"Deamidated",
            "gl":"Gln->pyro-Glu"
        },
        "fixed_modifications":{
            "C":"Carbamidomethyl"
        }
    },
    "percolator": {}
}
KunathBJ commented 3 years ago

Hello,

I digged into the issue and noticed I made few mistake in the config file. I fixed them and now have a different error (i updated them in my first message).

Apparently it's already on your todo list:

    def get_search_engine_features(self):
        """Get pandas.DataFrame with search engine features."""
        # TODO: Implement this!
        raise NotImplementedError

So I was wandering what would be best for me to do here.

Thanks a lot and take care, Ben

RalfG commented 2 years ago

Hi Ben,

I must have missed this issue; my apologies for the late reply. We have indeed not yet implemented search engine features for PeptideShaker input. If I'm not mistaken, you can still run MS²Rescore on PeptideShaker output using ms2pip and deeplc features only.

Best, Ralf

RalfG commented 9 months ago

Hi @KunathBJ,

I am happy to announce that PeptideShaker is now fully supported through its exported mzIdentML files! You can try it out through the CLI:

pip install ms2rescore --pre

or download the installer from https://github.com/compomics/ms2rescore/releases/latest.