#!/usr/bin/env python# -*- coding: utf-8 -*-## This file is part of the `pypath` python module## Copyright 2014-2023# EMBL, EMBL-EBI, Uniklinik RWTH Aachen, Heidelberg University## Authors: see the file `README.rst`# Contact: Dénes Türei (turei.denes@gmail.com)## Distributed under the GPLv3 License.# See accompanying file LICENSE.txt or copy at# https://www.gnu.org/licenses/gpl-3.0.html## Website: https://pypath.omnipathdb.org/#from__future__importannotations"""Structures from the Human Metabolome Database (HMDB)."""importpypath.formats.sdfassdfparserimportpypath.resources.urlsasurlsimportpypath.share.curlascurl
[docs]defsdf():""" Download and open the SDF file with all HMDB structures. """url=urls.urls['hmdb']['sdf']c=curl.Curl(url,large=True,silent=False,default_mode='rb',files_needed=['structures.sdf'],)returnsdfparser.SdfReader(c.result['structures.sdf'],names={'DATABASE_ID':'id','SMILES':'smiles','GENERIC_NAME':'generic_name',})