@@ -158,7 +158,9 @@ def _parse_idxml(self) -> tuple[Any, Any]:
158158 """
159159 protein_ids : Any = [] # list[oms.ProteinIdentification]
160160 peptide_ids : Any = [] # list[oms.PeptideIdentification]
161- oms .IdXMLFile ().load (str (self .filename ), protein_ids , peptide_ids ) # type: ignore
161+
162+ idxml_file = oms .IdXMLFile () # type: ignore
163+ idxml_file .load (str (self .filename ), protein_ids , peptide_ids )
162164
163165 if len (protein_ids ) == 0 :
164166 raise IdXMLReaderEmptyListException (
@@ -564,7 +566,8 @@ def _update_existing_ids(
564566
565567 peptide_id .setHits (updated_peptide_hits )
566568
567- oms .IdXMLFile ().store (str (self .filename ), self .protein_ids , self .peptide_ids ) # type: ignore
569+ idxml_file = oms .IdXMLFile () # type: ignore
570+ idxml_file .store (str (self .filename ), self .protein_ids , self .peptide_ids )
568571
569572 def _update_peptide_hit (self , peptide_hit : Any , psm : PSM ) -> None :
570573 """Inplace update of PeptideHit with novel predicted features information from PSM."""
@@ -624,7 +627,8 @@ def _create_ids_for_collection(
624627
625628 # Write idXML file
626629 filename = "/" .join (filter (None , [collection , str (self .filename )]))
627- oms .IdXMLFile ().store (filename , self .protein_ids , self .peptide_ids ) # type: ignore
630+ idxml_file = oms .IdXMLFile () # type: ignore
631+ idxml_file .store (filename , self .protein_ids , self .peptide_ids )
628632
629633 def _create_peptide_identification (
630634 self ,
0 commit comments