Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uninformative stacktrace from extract_assay_parameters() #51

Open
sneumann opened this issue Apr 17, 2024 · 0 comments
Open

Uninformative stacktrace from extract_assay_parameters() #51

sneumann opened this issue Apr 17, 2024 · 0 comments

Comments

@sneumann
Copy link

sneumann commented Apr 17, 2024

Hi, for some mzML from a Bruker microTOFq converted with msconvert I am getting an exception
when running mzml2isa -i test -o /tmp/MTBLS4823/ -s MTBLS4823 with mzml2isa version 1.1.1

Traceback (most recent call last):
  File "/home/sneumann/.local/bin/mzml2isa", line 8, in <module>
    sys.exit(main())
  File "/home/sneumann/.local/lib/python3.10/site-packages/mzml2isa/parsing.py", line 251, in main
    convert(
  File "/home/sneumann/.local/lib/python3.10/site-packages/mzml2isa/parsing.py", line 129, in convert
    metalist = list(map(_parse_file, files_iter))
  File "/home/sneumann/.local/lib/python3.10/site-packages/mzml2isa/utils.py", line 122, in new_func
    return func(*args)
  File "/home/sneumann/.local/lib/python3.10/site-packages/mzml2isa/parsing.py", line 56, in _parse_file
    return parser(filesystem, path).metadata
  File "/usr/lib/python3.10/functools.py", line 981, in __get__
    val = self.func(instance)
  File "/home/sneumann/.local/lib/python3.10/site-packages/mzml2isa/mzml.py", line 1264, in metadata
    self._extract_assay_parameters(meta)
  File "/home/sneumann/.local/lib/python3.10/site-packages/mzml2isa/mzml.py", line 964, in _extract_assay_parameters
    for element in self._find_xpath(self._XPATHS[location]):
  File "/home/sneumann/.local/lib/python3.10/site-packages/mzml2isa/mzml.py", line 857, in _find_xpath
    ns = self.namespaces
  File "/usr/lib/python3.10/functools.py", line 981, in __get__
    val = self.func(instance)
  File "/home/sneumann/.local/lib/python3.10/site-packages/mzml2isa/mzml.py", line 803, in namespaces
    root = self.tree.getroot()
  File "/usr/lib/python3.10/functools.py", line 981, in __get__
    val = self.func(instance)
  File "/home/sneumann/.local/lib/python3.10/site-packages/mzml2isa/mzml.py", line 795, in tree
    return etree.parse(self.fs.getsyspath(self.path))
  File "/usr/lib/python3.10/xml/etree/ElementTree.py", line 1222, in parse
    tree.parse(source, parser)
  File "/usr/lib/python3.10/xml/etree/ElementTree.py", line 580, in parse
    self._root = parser._parse_whole(source)
xml.etree.ElementTree.ParseError: no element found: line 56013, column 0

=> This is because the mzML ended prematurely, because the Bruker *.d also aborted prematurely during the run, the mzML ends with :

            </binaryDataArray>
          </binaryDataArrayList>
        </spectrum>

So the only fix would be to xml lint the files prior to proper parsing. Feel free to close this issue right away.
Yours,
Steffen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant