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

Lack of documentation on the command line interface #111

Closed Guitou1 closed 7 months ago

Guitou1 commented 7 months ago

Hi, I'm trying to run ms2rescore on a results.sage.tsv (or a results.sage.pin) output file which should be readable according to the documentation, yet I obtain this error:

ms2rescore results.sage.pin -m data/mzML/ -t data/

2023-11-24 15:22:12 // INFO // ms2rescore // Using PinPipeline.
2023-11-24 15:22:13 // ERROR // ms2rescore.__main__ // Critical error occured in MS2ReScore
Traceback (most recent call last):
  File "/home/gdeflandre/miniconda3/lib/python3.11/site-packages/ms2rescore/__main__.py", line 15, in main
    rescore.run()
  File "/home/gdeflandre/miniconda3/lib/python3.11/site-packages/ms2rescore/__init__.py", line 233, in run
    peprec = self.pipeline.get_peprec()
             ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/gdeflandre/miniconda3/lib/python3.11/site-packages/ms2rescore/id_file_parser.py", line 224, in get_peprec
    return self.peprec_from_pin()
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/home/gdeflandre/miniconda3/lib/python3.11/site-packages/ms2rescore/id_file_parser.py", line 179, in peprec_from_pin
    peprec = self.original_pin.to_peptide_record(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/gdeflandre/miniconda3/lib/python3.11/site-packages/ms2rescore/percolator.py", line 470, in to_peptide_record
    peprec_df["spec_id"] = self._get_spectrum_index_column(
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/gdeflandre/miniconda3/lib/python3.11/site-packages/ms2rescore/percolator.py", line 268, in _get_spectrum_index_column
    id_col = self.df["SpecId"].str.extract(pattern, expand=False).astype(int)
             ^^^^^^^^^^^^^^^^^^^^^
  File "/home/gdeflandre/miniconda3/lib/python3.11/site-packages/pandas/core/generic.py", line 5902, in __getattr__
    return object.__getattribute__(self, name)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/gdeflandre/miniconda3/lib/python3.11/site-packages/pandas/core/accessor.py", line 182, in __get__
    accessor_obj = self._accessor(obj)
                   ^^^^^^^^^^^^^^^^^^^
  File "/home/gdeflandre/miniconda3/lib/python3.11/site-packages/pandas/core/strings/accessor.py", line 181, in __init__
    self._inferred_dtype = self._validate(data)
                           ^^^^^^^^^^^^^^^^^^^^
  File "/home/gdeflandre/miniconda3/lib/python3.11/site-packages/pandas/core/strings/accessor.py", line 235, in _validate
    raise AttributeError("Can only use .str accessor with string values!")
AttributeError: Can only use .str accessor with string values!

When sage.tsv file is used, the pipeline cannot be inferred (suggesting to specify the type: 'pin', 'maxquant' etc, but not sage) which is why I'm using sage's .pin output.

Does it not accept .mzML files but only .mgf ones ? I have tried to find the answer to my question through the documentation, but it mainly supports the Python API rather than the command line interface. Furthermore, there is an inconsistent documentation on the command options (between the documentation and ms2rescore -help panel) for example: -s VS -m for the MGF file location.

I have tried with and without a config.json file, giving the same results.

Am I missing something ?

Thank you in advance !

RalfG commented 7 months ago

Hi @Guitou1,

Thanks for your interest in MS²Rescore! I noticed that you are running an older version of MS²Rescore. We have just taken v3 out of beta. Can you retry with the latest release? Both Sage result.tsv and mzML files are supported. Do note that the psm_file_type option should be set to sage.

Also note that a general user guide (for both CLI and GUI) is available, as well as documentation specific to the CLI.

Best, Ralf

Guitou1 commented 7 months ago

Hi @RalfG,

Thank you for the fast response !

I have tried installing using the pip command (without cloning the GitHub content) but the version on it doesn't seem to support sage's output (because it doesn't install the latest version of MS2Rescore).

Also, the links you have provided don't actually inform users how to install the latest version (people not knowing they have to git clone *link* -cd ms2rescore -pip install . wouldn't get access to the latest version) and I think that could be a nice a touch for accessibility :)

But once I've run ms2rescore, it worked like a charm ! Once again, thank you for the quick response !

Kind regards, Guillaume