fix parsing pepxml with none of the standard scores#148
Merged
Conversation
If nothing was found, we return the first element as fallback. However, score_keys isn't subscriptable, resulting in issue #258 when none of the standard search engine scores were found. Making this a list fixes this. However, if the order isn't significant (the order of the keys will be the order of insertion in current (C?)Python implementations, the order of the set would de-facto be according to the order of the hashes) we could also use a set here, and then use `score_keys.pop()` as fallback instead of `score_keys[0]`.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #148 +/- ##
=======================================
Coverage 72.01% 72.01%
=======================================
Files 32 32
Lines 3248 3248
=======================================
Hits 2339 2339
Misses 909 909
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
RalfG
approved these changes
Jun 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
If nothing was found, we return the first element as fallback. However, dict_keys isn't subscriptable, resulting in issue compomics/ms2rescore#258 when none of the standard search engine scores were found. Making this a list fixes this.
However, if the order isn't significant (the order of the keys will be the order of insertion in current (C?)Python implementations, the order of the set would de-facto be according to the order of the hashes) we could also use a set here, and then use
score_keys.pop()as fallback instead ofscore_keys[0].