Skip to content

Commit 3526593

Browse files
committed
io.pepxml: Fix inferring score when first spectrum_query items do not have search_hit items.
1 parent c5960ee commit 3526593

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

psm_utils/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""Common utilities for parsing and handling PSMs, and search engine results."""
22

3-
__version__ = "1.5.1"
3+
__version__ = "1.5.2"
44
__all__ = ["Peptidoform", "PSM", "PSMList"]
55

66
from warnings import filterwarnings

psm_utils/io/pepxml.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ def _infer_score_name(self) -> str | None:
7373
# Get scores from first PSM
7474
with pepxml.read(str(self.filename)) as reader:
7575
for spectrum_query in reader:
76+
if "search_hit" not in spectrum_query:
77+
continue
7678
score_keys = spectrum_query["search_hit"][0]["search_score"].keys()
7779
break
7880
else:

0 commit comments

Comments
 (0)