Skip to content

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

@althonos

Description

@althonos

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions