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 https://github.com/epoyraz/updateHMDB but it is not working or maybe the structure of HMDB folders in https://hmdb.ca/downloads 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?

Hi!

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

1 Like

Hi!
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 “generateHMDB2StructMapping.py”, line 28, in
for event, elem in context:
File “src/lxml/iterparse.pxi”, line 209, in lxml.etree.iterparse.next
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.

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

Traceback (most recent call last):
File “generateHMDB2StructMapping.py”, 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.