# OpenMS - Update HMDB to version 5.0 for AccurateMassSearch node

**URL:** <https://forum.knime.com/t/openms-update-hmdb-to-version-5-0-for-accuratemasssearch-node/37052>\
**Category:** Community Extensions\
**Tags:** openms\
**Created:** [October 31, 2021, 10:49am UTC](https://forum.knime.com/t/openms-update-hmdb-to-version-5-0-for-accuratemasssearch-node/37052 "2021-10-31T10:49:18Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![ktzanakis](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/k/e95f7d/32.png) [@ktzanakis](https://forum.knime.com/u/ktzanakis)\
**Post date:** [October 31, 2021, 10:49am UTC](https://forum.knime.com/t/openms-update-hmdb-to-version-5-0-for-accuratemasssearch-node/37052/1 "2021-10-31T10:49:18Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![jpfeuffer](https://forum-cdn.knime.com/user_avatar/forum.knime.com/jpfeuffer/32/171_2.png) [@jpfeuffer](https://forum.knime.com/u/jpfeuffer)\
**Post date:** [November 1, 2021, 11:32am UTC](https://forum.knime.com/t/openms-update-hmdb-to-version-5-0-for-accuratemasssearch-node/37052/2 "2021-11-01T11:32:25Z")

</div>

Hi!

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

> **[GitHub - heckendorfc/updateHMDB: update script for HMDB in OpenMS](https://github.com/heckendorfc/updateHMDB)**
>
> update script for HMDB in OpenMS. Contribute to heckendorfc/updateHMDB development by creating an account on GitHub.

---

<div class="post-metadata">

**Author:** ![ktzanakis](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/k/e95f7d/32.png) [@ktzanakis](https://forum.knime.com/u/ktzanakis)\
**Post date:** [November 1, 2021, 3:56pm UTC](https://forum.knime.com/t/openms-update-hmdb-to-version-5-0-for-accuratemasssearch-node/37052/3 "2021-11-01T15:56:49Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![ktzanakis](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/k/e95f7d/32.png) [@ktzanakis](https://forum.knime.com/u/ktzanakis)\
**Post date:** [November 1, 2021, 6:08pm UTC](https://forum.knime.com/t/openms-update-hmdb-to-version-5-0-for-accuratemasssearch-node/37052/4 "2021-11-01T18:08:15Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![jpfeuffer](https://forum-cdn.knime.com/user_avatar/forum.knime.com/jpfeuffer/32/171_2.png) [@jpfeuffer](https://forum.knime.com/u/jpfeuffer)\
**Post date:** [November 1, 2021, 6:12pm UTC](https://forum.knime.com/t/openms-update-hmdb-to-version-5-0-for-accuratemasssearch-node/37052/5 "2021-11-01T18:12:14Z")

</div>

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:

```auto
            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

---

<div class="post-metadata">

**Author:** ![ktzanakis](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/k/e95f7d/32.png) [@ktzanakis](https://forum.knime.com/u/ktzanakis)\
**Post date:** [November 1, 2021, 6:49pm UTC](https://forum.knime.com/t/openms-update-hmdb-to-version-5-0-for-accuratemasssearch-node/37052/6 "2021-11-01T18:49:11Z")

</div>

Thank you very much! It works perfectly fine!

---

<div class="post-metadata">

**Author:** ![system](https://forum-cdn.knime.com/uploads/default/original/1X/ab3ccf34482a0329361734a18199390177204f15.png) [@system](https://forum.knime.com/u/system)\
**Post date:** [November 8, 2021, 6:49pm UTC](https://forum.knime.com/t/openms-update-hmdb-to-version-5-0-for-accuratemasssearch-node/37052/7 "2021-11-08T18:49:29Z")

</div>

Closed on November 8, 2021, 6:49pm UTC

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