Skip to content

Commit

Permalink
Merge pull request #74 from compomics/idxml-updates
Browse files Browse the repository at this point in the history
Idxml updates
  • Loading branch information
RalfG authored Mar 29, 2024
2 parents a8762af + be289d5 commit 10086b1
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions psm_utils/io/idxml.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,29 @@
is parsed as an individual :py:class:`~psm_utils.psm.PSM` object.
"""


from __future__ import annotations

import logging
import re
from warnings import filterwarnings
from pathlib import Path
from typing import Iterable, List, Tuple, Union

import pyopenms as oms

from psm_utils.exceptions import PSMUtilsException
from psm_utils.io._base_classes import ReaderBase, WriterBase
from psm_utils.psm import PSM
from psm_utils.psm_list import PSMList
from psm_utils.peptidoform import Peptidoform

filterwarnings(
"ignore",
message="OPENMS_DATA_PATH environment variable already exists",
category=UserWarning,
module="pyopenms",
)

import pyopenms as oms #noqa: E402

logger = logging.getLogger(__name__)

# Patterns to match open and closed round/square brackets
Expand Down Expand Up @@ -105,7 +111,7 @@ def __iter__(self) -> Iterable[PSM]:
for peptide_hit in peptide_id.getHits():
yield self._parse_psm(self.protein_ids, peptide_id, peptide_hit)

def _parse_idxml(self) -> Tuple(oms.ProteinIdentification, oms.PeptideIdentification):
def _parse_idxml(self) -> Tuple[oms.ProteinIdentification, oms.PeptideIdentification]:
"""
Parse idXML using pyopenms and perform sanity checks to make sure the file is not empty.
"""
Expand Down

0 comments on commit 10086b1

Please sign in to comment.