forked from Hadlock-Lab/drug_response_kp
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmapping.py
77 lines (74 loc) · 2.43 KB
/
mapping.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
def custom_mapping(cls):
"""
Method to provide custom mapping to parser.
Configuration of this method in manifest.json should be:
"uploader" : {
"mapping" : "mapping:custom_mapping"
}
This is a class method but @classmethod decorator is not necessary.
See https://docs.biothings.io/en/latest/tutorial/studio_guide.html#manifest-based-data-plugins
"""
return {
"subject": {
"properties": {
"id": {
"normalizer": "keyword_lowercase_normalizer",
"type": "keyword"
},
"name": {
"normalizer": "keyword_lowercase_normalizer",
"type": "keyword"
},
"ENSEMBL": {
"normalizer": "keyword_lowercase_normalizer",
"type": "keyword"
},
"type": {
"normalizer": "keyword_lowercase_normalizer",
"type": "keyword"
}
}
},
"association": {
"properties": {
"edge_label": {
"type": "text"
}
}
},
"object": {
"properties": {
"id": {
"normalizer": "keyword_lowercase_normalizer",
"type": "keyword"
},
"name": {
"type": "text"
},
"CHEBI": {
"normalizer": "keyword_lowercase_normalizer",
"type": "keyword"
},
"type": {
"normalizer": "keyword_lowercase_normalizer",
"type": "keyword"
},
"CHEMBL.COMPOUND": {
"normalizer": "keyword_lowercase_normalizer",
"type": "keyword"
},
"PUBCHEM": {
"normalizer": "keyword_lowercase_normalizer",
"type": "keyword"
},
"HMS_LINCS_ID": {
"normalizer": "keyword_lowercase_normalizer",
"type": "keyword"
},
"CID": {
"normalizer": "keyword_lowercase_normalizer",
"type": "keyword"
}
}
}
}