-
Notifications
You must be signed in to change notification settings - Fork 1
/
global_variables.py
56 lines (44 loc) · 1.25 KB
/
global_variables.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
__author__ = 'Sarah Keating'
global server
server = 'www.wikidata.org'
global used_wd_ids
used_wd_ids = dict({'pmid': [], 'goterms': [], 'reactome': [], 'chebi': [], 'proteins': []})
global supported_properties
supported_properties = [{'id': 'P686', 'name': 'goterm'},
{'id': 'P3937', 'name': 'reactomeid'},
{'id': 'P698', 'name': 'pmid'},
{'id': 'P352', 'name': 'uniprotid'},
{'id': 'P683', 'name': 'chebi'}
]
global supported_species
supported_species = [dict({'ReactomeCode': 'HSA', 'name': 'Homo sapiens', 'WDItem': 'Q15978631'})]
global edited_wd_pages
edited_wd_pages = []
global exceptions
exceptions = []
global psimod
psimod = []
global prodata
prodat = []
def set_psimod(data):
global psimod
psimod = data
def set_prodata(data):
global prodata
prodata = data
def get_chebi_from_mod(modref):
if len(psimod) == 0:
return ''
else:
for ref in psimod:
if ref['id'] == modref:
return ref['chebi']
return ''
def get_pro_for_id(id):
if len(prodata) == 0:
return ''
else:
for ref in prodata:
if ref['id'] == id:
return ref['pro']
return ''