OpenMS - Update HMDB to version 5.0 for AccurateMassSearch node

Hello everyone!

Is there any way to parse HMDB version 5.0 for AccurateMassSearch node? I tried this but it is not working or maybe the structure of HMDB folders in has changed. According to this link I download the XML of “All Metabolites” and unzipped it. But then, it says to delete it and the point is that there is no other file left in the downloaded folder. Any ideas?


Can you try this fork of the script. Seems a bit more up-to-date

1 Like

Thank you very much for your answer! I tried it but it seems that the new XML from HMDB most likely has some small mistakes concerning the tags:

File “”, line 28, in
for event, elem in context:
File “src/lxml/iterparse.pxi”, line 209, in
File “hmdb_metabolites/hmdb_metabolites.xml”, line 18163858
lxml.etree.XMLSyntaxError: Opening and ending tag mismatch: kiNd line 65535 and kind, line 18163858, column 37

I will download hmdb again and re-try.

So, it seems that the “” works perfectly fine! But with the after a while I get:

Traceback (most recent call last):
File “”, line 46, in
f.write(inchi + “\t”)
TypeError: unsupported operand type(s) for +: ‘NoneType’ and ‘str’

The write command does not look wrong.

The code seems to assume that if one of SMILES and INCHI is set, the other is also set.
Which is probably not true.

You can change it to:

            f.write(smiles if smiles not None else "" + "\t")
            f.write(inchi if inchi not None else "" + "\t")

Or any other string that indicates a missing value

Thank you very much! It works perfectly fine!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.