From d8e4197441757d4562db1ad834746f68b58e316f Mon Sep 17 00:00:00 2001 From: jonasscheid Date: Mon, 30 Sep 2024 19:12:46 +0000 Subject: [PATCH] parse idxmls with no spectra file info --- CHANGELOG.md | 1 + psm_utils/io/idxml.py | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0649b16..8aee2ee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - `io.flashlfq`: Fix column names `Peptide Monoisotopic Mass` and `Protein Accession`. +- `io.idxml`: Fix parsing if spectra file name not present [#92](https://github.com/compomics/psm_utils/issues/92) ## [1.1.0] - 2024-09-05 diff --git a/psm_utils/io/idxml.py b/psm_utils/io/idxml.py index 9a43293..bff4412 100644 --- a/psm_utils/io/idxml.py +++ b/psm_utils/io/idxml.py @@ -219,8 +219,10 @@ def _get_run( .getMetaValue("spectra_data")[peptide_id.getMetaValue("id_merge_index")] .decode() ).stem - else: + elif protein_ids[0].metaValueExists("spectra_data"): run = Path(protein_ids[0].getMetaValue("spectra_data")[0].decode()).stem + else: + run = None # Convert back to None value (see writer) if run == "None":