Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed bugs for invalid psm #6

Merged
merged 4 commits into from
Dec 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "quantms-rescoring"
description = "quantms-rescoring: Python scripts and helpers for the quantMS workflow"
readme = "README.md"
license = "MIT"
version = "0.0.2"
version = "0.0.3"
authors = [
"Yasset Perez-Riverol <[email protected]>",
"Dai Chengxin <[email protected]>",
Expand Down
11 changes: 9 additions & 2 deletions quantmsrescore/ms2rescore.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ def __iter__(self) -> Iterable[PSM]:

psm_list: return [PSM 1]

The invalid PSM are directly from search engines results (MSGF+). The search engine doesn't report search
score features (e.g. MSGF:ScoreRatio) for these invalid PSMs. And we can observe the NumMatchedMainIons of
peptide hit is 0. So we should remove these invalid PSMs

"""
for peptide_id in self.peptide_ids:
new_hits = []
Expand All @@ -72,8 +76,10 @@ def __iter__(self) -> Iterable[PSM]:
yield psm
else:
self.skip_invalid_psm += 1
peptide_id.setHits(new_hits)
self.new_peptide_ids.append(peptide_id)
# If it is a valid Peptide Hits then keep it
if len(new_hits) > 0:
peptide_id.setHits(new_hits)
self.new_peptide_ids.append(peptide_id)

def _parse_psm(
self,
Expand Down Expand Up @@ -244,6 +250,7 @@ def rescore_idxml(input_file, output_file, config) -> None:
logging.warning(
f"Removed {reader.skip_invalid_psm} PSMs without search engine features!"
)
# Synchronised acquisition of new peptide IDs after removing invalid PSMs
peptide_ids = reader.new_peptide_ids
else:
peptide_ids = reader.peptide_ids
Expand Down
2 changes: 1 addition & 1 deletion recipe/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# recipe/meta.yaml
package:
name: quantms-rescoring
version: "0.0.2"
version: "0.0.3"

source:
path: ../
Expand Down
Loading