diff --git a/pyproject.toml b/pyproject.toml index 359648b..c620b2f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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 ", "Dai Chengxin ", diff --git a/quantmsrescore/ms2rescore.py b/quantmsrescore/ms2rescore.py index 5251123..6ae7af3 100644 --- a/quantmsrescore/ms2rescore.py +++ b/quantmsrescore/ms2rescore.py @@ -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 = [] @@ -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, @@ -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 diff --git a/recipe/meta.yaml b/recipe/meta.yaml index b652f6d..c8d075c 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -1,7 +1,7 @@ # recipe/meta.yaml package: name: quantms-rescoring - version: "0.0.2" + version: "0.0.3" source: path: ../