Skip to content

Commit

Permalink
Update to version 1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
n-elie committed Jun 20, 2022
1 parent b128660 commit 8512bda
Showing 1 changed file with 23 additions and 6 deletions.
29 changes: 23 additions & 6 deletions isdb.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,35 @@
"""MetGem plugin to download ISDB"""

__version__ = '1.0'
__version__ = '1.1'
__description__ = "MetGem plugin to download ISDB"
__author__ = "Nicolas Elie"
__email__ = "[email protected]"
__copyright__ = "Copyright 2019, CNRS/ICSN"
__copyright__ = "Copyright 2019-2022, CNRS/ICSN"
__license__ = "GPLv3"

import json


# noinspection PyUnresolvedReferences
class ISDB(DbSource):

name = "ISDB"
items_base_url = "https://raw.githubusercontent.com/oolonek/ISDB/master/Data/dbs/"
page = "https://doi.org/10.5281/zenodo.5607185"
items_base_url = ""

def get_items(self, tree):
json_s = tree.find('.//script[@type="application/ld+json"]').text
json_load = json.loads(json_s)
description = json_load['description']
identifier = json_load['identifier']
version = json_load['version']
date = json_load['datePublished']

hrefs = []

def get_items(self):
yield "In-Silico Database", [f'UNPD_ISDB_R_p0{i}.mgf' for i in range(1, 10)],\
'A database of In-Silico predicted MS/MS spectrum of Natural Products'
for distrib in json_load['distribution']:
if distrib['@type'] == 'DataDownload':
href = distrib['contentUrl']
hrefs.append(href)
yield "In-Silico Database", hrefs,\
f"Version {version} ({date}) <a href='{identifier}'>{identifier}</a>\n{description}"

0 comments on commit 8512bda

Please sign in to comment.