0
--------------------------------------------------------------------------- TypeError Traceback (most recent call last) <ipython-input-6-71c3a0553018> in <module>() 1 with mzid.MzIdentML(file, retrieve_refs=True) as psms: 2 ----> 3 for i, psm in enumerate(psms): 4 print i 5 C:\Python27\lib\site-packages\pyteomics\auxiliary.pyc in __next__(self) 391 def __next__(self): 392 try: --> 393 return next(self._reader) 394 except StopIteration: 395 self.__exit__(None, None, None) C:\Python27\lib\site-packages\pyteomics\xml.pyc in iterfind(self, path, **kwargs) 393 if (absolute and elem.getparent() is None) or not absolute: 394 for child in get_rel_path(elem, nodes[1:]): --> 395 info = self._get_info_smart(child, **kwargs) 396 if cond is None or satisfied(info, cond): 397 yield info C:\Python27\lib\site-packages\pyteomics\mzid.pyc in _get_info_smart(self, element, **kwargs) 118 return self._get_info(element, 119 recursive=(rec if rec is not None else True), --> 120 **kwargs) 121 122 def _retrieve_refs(self, info, **kwargs): C:\Python27\lib\site-packages\pyteomics\xml.pyc in _get_info(self, element, **kwargs) 296 else: 297 info.setdefault(cname, []).append( --> 298 self._get_info_smart(child, **kwargs)) 299 300 # process element text C:\Python27\lib\site-packages\pyteomics\mzid.pyc in _get_info_smart(self, element, **kwargs) 118 return self._get_info(element, 119 recursive=(rec if rec is not None else True), --> 120 **kwargs) 121 122 def _retrieve_refs(self, info, **kwargs): C:\Python27\lib\site-packages\pyteomics\xml.pyc in _get_info(self, element, **kwargs) 296 else: 297 info.setdefault(cname, []).append( --> 298 self._get_info_smart(child, **kwargs)) 299 300 # process element text C:\Python27\lib\site-packages\pyteomics\mzid.pyc in _get_info_smart(self, element, **kwargs) 118 return self._get_info(element, 119 recursive=(rec if rec is not None else True), --> 120 **kwargs) 121 122 def _retrieve_refs(self, info, **kwargs): C:\Python27\lib\site-packages\pyteomics\xml.pyc in _get_info(self, element, **kwargs) 316 # resolve refs 317 if kwargs.get('retrieve_refs'): --> 318 self._retrieve_refs(info, **kwargs) 319 320 # flatten the excessive nesting C:\Python27\lib\site-packages\pyteomics\mzid.pyc in _retrieve_refs(self, info, **kwargs) 125 for k, v in dict(info).items(): 126 if k.endswith('_ref'): --> 127 info.update(self.get_by_id(v, retrieve_refs=True)) 128 del info[k] 129 info.pop('id', None) TypeError: 'NoneType' object is not iterable
PEPTIDEEVIDENCE_PEPTIDE_2_DBSEQUENCE_22_756:22_752
--
---
You received this message because you are subscribed to the Google Groups "Pyteomics" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyteomics+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Hello Lev,I think the appropriate correction for this problem would be to search for two references since PEAKS concatenate protein identifiers and separate them with :.PEPTIDEEVIDENCE_PEPTIDE_2_DBSEQUENCE_22_756PEPTIDEEVIDENCE_PEPTIDE_2_DBSEQUENCE_22_752These two exists.So you would need to split 22_756:22_752 with : delimiter, search for them and then add these two the list x['SpectrumIdentificationItem'][0]['PeptideEvidenceRef']
Thanks for the subclass.How can I use it with mzid.qvalues method?I tried the following without success:with PEAKSMzIdentML(file, retrieve_refs=True, build_id_cache=True) as psms:q1 = mzid.qvalues(psms, retrieve_refs=True,key=lambda x: x['SpectrumIdentificationItem'][0]['PEAKS:peptideScore'],is_decoy=my_isDecoy)
Hello,
It looks like your example mzIdentML file is no longer hosted, so I can’t test this on your exact file, but I consume mzIdentML files from PEAKS too. Here’s the work-around to their dbSequence id problem I use. It involved rewriting more of the guts of _get_info
and _retrieve_refs
to handle the multiple-protein problem. Just use MultiProteinMzIdentML
as you would the other versions of MzIdentML
.
This solution may not be as stable because it involved rewriting the guts of how _get_info
and _retrieve_refs
work. It is also a little more aggressive in pursuit of Param tags.
--