-
Notifications
You must be signed in to change notification settings - Fork 0
/
combiner+vsm-box.test.html
96 lines (90 loc) · 3.72 KB
/
combiner+vsm-box.test.html
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
<!DOCTYPE html>
<html>
<head>
<script src="https://unpkg.com/vsm-dictionary-complex-portal@^1.0.1/dist/vsm-dictionary-complex-portal.min.js"></script>
<script src="https://unpkg.com/vsm-dictionary-ensembl-genomes@^1.0.2/dist/vsm-dictionary-ensembl-genomes.min.js"></script>
<script src="https://unpkg.com/vsm-dictionary-ensembl@^1.0.3/dist/vsm-dictionary-ensembl.min.js"></script>
<script src="https://unpkg.com/vsm-dictionary-rnacentral@^1.0.1/dist/vsm-dictionary-rnacentral.min.js"></script>
<script src="https://unpkg.com/vsm-dictionary-uniprot@^1.0.15/dist/vsm-dictionary-uniprot.min.js"></script>
<script src="https://unpkg.com/vsm-dictionary-bioportal@^1.1.3/dist/vsm-dictionary-bioportal.min.js"></script>
<script src="https://unpkg.com/vsm-dictionary-cacher@^1.2.0/dist/vsm-dictionary-cacher.min.js"></script>
<script src="https://unpkg.com/vsm-dictionary-combiner@^1.0.1/dist/vsm-dictionary-combiner.min.js"></script>
<script src="https://unpkg.com/vsm-box@^1.0.0/dist/vsm-box.standalone.min.js"></script>
</head>
<body>
<vsm-box autofocus=true></vsm-box>
</body>
<script>
// initialize various vsm-dictionaries
var VsmDictComplexPortal = new VsmDictionaryComplexPortal({log: true});
var VsmDictEnsemblGenomes = new VsmDictionaryEnsemblGenomes({log: true});
var VsmDictEnsembl = new VsmDictionaryEnsembl({log: true});
var VsmDictRNAcentral = new VsmDictionaryRNAcentral({log: true});
var VsmDictUniProt = new VsmDictionaryUniProt({log: true});
var key = '5904481f-f6cb-4c71-94d8-3b775cf0f19e';
var VsmDictBioPortal = new VsmDictionaryBioPortal({ log: true, apiKey: key });
// initialize a cached version of the combiner
var VsmDictionaryCombinerCached = VsmDictionaryCacher(VsmDictionaryCombiner, { predictEmpties: false });
var dictionary = new VsmDictionaryCombinerCached({
// Give all required dictionaries as initialized Objects in this array
dictionaries: [
VsmDictComplexPortal,
VsmDictEnsemblGenomes,
VsmDictEnsembl,
VsmDictRNAcentral,
VsmDictUniProt,
VsmDictBioPortal
],
errorIfAllErrors: true
});
var vsmBox = document.getElementsByTagName('vsm-box')[0];
var queryOptions = { perPage: 5 };
var initialValue = {
terms: [
{ // query all dictionaries (and sub-dictionaries)
placeholder: 'all'
},
{ // query only OBOREL ontology (sub-dictionary) from BioPortal dictionary
queryOptions: {
filter: { dictID: [ 'http://data.bioontology.org/ontologies/OBOREL' ] }
},
placeholder: 'causally related',
maxWidth: 400
},
{ // query only complex-portal
queryOptions: {
filter: { dictID: [ 'https://www.ebi.ac.uk/complexportal' ] }
},
placeholder: 'complex',
maxWidth: 600
},
{ // query only Gene Ontology
queryOptions: {
filter: { dictID: [ 'http://data.bioontology.org/ontologies/GO' ] }
},
placeholder: 'interaction',
maxWidth: 600,
str: 'RNA binding',
classID: 'http://purl.obolibrary.org/obo/GO_0003723',
instID: null
},
{ // query only ensembl-genomes and RNAcentral
queryOptions: {
filter: { dictID: [ 'http://www.ensemblgenomes.org', 'https://www.rnacentral.org' ] }
},
placeholder: 'rna'
}
],
conns: [
{ type: 'T', pos: [ 0, 1, 2 ] },
{ type: 'T', pos: [ 2, 3, 4 ] },
]
};
vsmBox.vsmDictionary = dictionary;
vsmBox.initialValue = initialValue;
vsmBox.queryOptions = queryOptions;
vsmBox.maxStringLengths = { str: 120, strAndDescr: 140 };
vsmBox.sizes = { minWidth: 400 };
setTimeout(() => vsmBox.querySelector('input').focus(), 250);
</script>
</html>