ISA-tools / mzml2isa

Parser to get meta information from mzML file and parse relevant information to a ISA-Tab structure
GNU General Public License v3.0
12 stars 6 forks source link

mzML2isa fails on MTBLS 433 (cannot find `softwareRef`) #30

Open althonos opened 7 years ago

althonos commented 7 years ago

Tried to parse a single file KA1_GB1_01_10465.mzML, got the following traceback:

raceback (most recent call last):
  File "/home/althonos/Code/mzml2isa/mzml2isa/mzml.py", line 267, in cvParam_loop
    soft_ref = get_parent(e, self.tree).attrib['softwareRef']
  File "src/lxml/lxml.etree.pyx", line 2467, in lxml.etree._Attrib.__getitem__ (src/lxml/lxml.etree.c:70679)
KeyError: 'softwareRef'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/althonos/Code/mzml2isa/mzml2isa/__main__.py", line 5, in <module>
    parsing.main()
  File "/home/althonos/Code/mzml2isa/mzml2isa/parsing.py", line 224, in main
    jobs=args.jobs, template_directory=args.template_dir, OUT_dir=args.OUT_path
  File "/home/althonos/Code/mzml2isa/mzml2isa/parsing.py", line 158, in convert
    metalist = [_parse_file([mzml_file, ontology, parser, pbar]) for mzml_file in sorted(mzml_files, key=str)]
  File "/home/althonos/Code/mzml2isa/mzml2isa/parsing.py", line 158, in <listcomp>
    metalist = [_parse_file([mzml_file, ontology, parser, pbar]) for mzml_file in sorted(mzml_files, key=str)]
  File "/home/althonos/Code/mzml2isa/mzml2isa/utils.py", line 245, in new_func
    return func(*args[0])
  File "/home/althonos/Code/mzml2isa/mzml2isa/parsing.py", line 77, in _parse_file
    meta = parser(filepath, ontology).meta
  File "/home/althonos/Code/mzml2isa/mzml2isa/mzml.py", line 146, in __init__
    self.extract_meta(terms, xpaths_meta)
  File "/home/althonos/Code/mzml2isa/mzml2isa/mzml.py", line 195, in extract_meta
    self.cvParam_loop(elements, location_name, terms)
  File "/home/althonos/Code/mzml2isa/mzml2isa/mzml.py", line 269, in cvParam_loop
    soft_ref = get_parent(get_parent(e, self.tree), self.tree).attrib['softwareRef']
  File "src/lxml/lxml.etree.pyx", line 2467, in lxml.etree._Attrib.__getitem__ (src/lxml/lxml.etree.c:70679)
KeyError: 'softwareRef'

It seems the file was converted from mzXML before hand as suggested from the sourceFile tag.