Skip to content

io.pepxml: PSM score cannot be inferred if first spectrum_query items is empty #142

@RalfG

Description

@RalfG

PSM score cannot be inferred from pepXML file when first spectrum_query items do not have search_hit items.

Discussed in CompOmics/ms2rescore#246

Originally posted by medardus333 January 14, 2026
Hi,

I am trying to use MS2rescore (version 3.2.0post1) after Comet (2025.03 rev. 0) search of TMT labelled peptides, using pep.xml output from mzML input files.

Deviating from "out-of-box" configuration, I have placed following into the GUI

  1. Search engine label: M[147] as search engine label and UNIMOD:35 as ProForma label.
  2. MS2PIPI model: TMT

But I run into following error message:


'search_hit'
Traceback (most recent call last):
File "ms2rescore\gui\function2ctk.py", line 302, in run
self.fn(*self.fn_args, **self.fn_kwargs)
File "ms2rescore\gui\app.py", line 870, in function
rescore(configuration=config)
File "ms2rescore\core.py", line 46, in rescore
psm_list = parse_psms(config, psm_list)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "ms2rescore\parse_psms.py", line 29, in parse_psms
psm_list = _read_psms(config, psm_list)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "ms2rescore\parse_psms.py", line 126, in read_psms
psm_utils.io.read_file(
File "psm_utils\io_init
.py", line 209, in read_file
File "psm_utils\io\pepxml.py", line 45, in init
File "psm_utils\io\pepxml.py", line 61, in _infer_score_name
KeyError: 'search_hit'

I do not know what this error means, googling gave unfortunately no info.

If there is a way to fix this? I tried to use

"max_psm_rank_input": 5
"max_psm_rank_output": 1

but I have no idea how to implement this from the GUI.

Thank you!

Cheers
Florian

Comet output:

<spectrum_query spectrum="01_Planet_TMT_Metaproteomics_PRC_6138_Lars.10984.10984.2" spectrumNativeID="controllerType=0 controllerNumber=1 scan=10984" start_scan="10984" end_scan="10984" precursor_neutral_mass="1163.629979" assumed_charge="2" index="11239" retention_time_sec="1844.8">
<search_result>
<search_hit hit_rank="1" peptide="VGVGEPMR" peptide_prev_aa="K" peptide_next_aa="A" protein="tr|A0A069PK37|A0A069PK37_9BURK" num_tot_proteins="1" num_matched_ions="7" tot_num_ions="14" calc_neutral_pep_mass="1163.629273" massdiff="0.000706" num_tol_term="2" num_missed_cleavages="0" num_matched_peptides="1342418">
<modification_info modified_peptide="VGVGEPM[147]R" mod_nterm_mass="305.214925">
<mod_aminoacid_mass position="7" mass="147.035385" variable="15.994900" source="param"/>
</modification_info>
<search_score name="xcorr" value="1.7130"/>
<search_score name="deltacn" value="0.0695"/>
<search_score name="spscore" value="165.0"/>
<search_score name="sprank" value="7"/>
<search_score name="expect" value="9.03E+01"/>
</search_hit>

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingio

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions