compomics / ms2rescore

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

Command line tool should pass in fasta file to the rescoring engine (mokapot) to enable the use of other named parameters #157

Closed MatteoLacki closed 3 weeks ago

MatteoLacki commented 1 month ago

Hi,

Running the command line tool allows to pass in the fasta file. However, it is not passed to the rescoring engine and needs to be explicitly mentioned second time in ms2rescore's config.

The add_proteins method is called only in presence of fasta_file entry in the rescoring engine's config. image

i.e. it should be directly here:

"rescoring_engine": {
            "mokapot": {
                "write_flashlfq": true,
                "write_txt": true,
                "write_weights": true,
                "fasta_file": "your_favorite_fasta_of_choice.fasta",
                "protein_kwargs": {
                    "enzyme":"[KR](?!P)"
                }
            }
        },

otherwise the protein_kwargs argument is not being used. In particular, selecting a different enzyme is not possible. As seen above, the read_fasta function cannot get called and it is exactly where the extra arguments should go:

image

Only then I do not get errors in

image

Best,

MatteoLacki commented 1 month ago

some more relevant info:

MS²Rescore (v3.0.3)
Developed at CompOmics, VIB / Ghent University, Belgium.
Please cite: Declercq et al. MCP (2022)

3.0.3

Installed with:

virtualenv ve_test
ve_test/bin/pip install git+https://github.com/compomics/ms2rescore.git@v3.0.3 im2deep

Using Python 3.11.9

Let me know if anything else is needed.

RalfG commented 3 weeks ago

Hi Matteo,

This is now implemented in v3.1.0. If no FASTA is configured in the Mokapot configuration section, the general FASTA setting will be used:

https://github.com/compomics/ms2rescore/blob/7ccb280d844059c5d67937dc9ed5ed2c67d89872/ms2rescore/core.py#L134-L135

Let us know if this now works as expected.

Best, Ralf