Newer
Older
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
<template>
<div>
<v-skeleton-loader v-if="loading" type="table" />
<v-card-text v-else-if="showError">
<div class="text-caption error--text">Error: {{ errorMsg }}.</div>
</v-card-text>
<template v-else>
<Heatmap :heatmap-description="heatmapDescription" />
compoundEubopenIDs: {{ compoundEubopenIDs }}
</template>
</div>
</template>
<script>
import Heatmap from '~/web-components-submodule/components/common/Visualisations/Heatmap/Heatmap.vue'
import ESProxyService from '~/web-components-submodule/services/ESProxyService.js'
import EntityNames from '~/web-components-submodule/standardisation/EntityNames.js'
export default {
components: {
Heatmap,
},
props: {
setID: {
type: String,
default: () => undefined,
},
},
data() {
return {
loading: true,
showError: false,
errorMsg: undefined,
compoundEubopenIDs: [],
}
},
computed: {
heatmapDescription() {
return {
yAxis: {
entityID: EntityNames.EubopenCompound.entityID,
initialQuery: {
sort: [{ '_metadata.related_targets.count': 'desc' }],
query: {
terms: {
molecule_eubopen_id: this.compoundEubopenIDs,
},
},
},
headers: {
label_property: 'pref_name',
additional_properties: ['molecule_chembl_id'],
mini_report_card_properties: [
'molecule_synonyms',
'_metadata.eubopen.in_vivo_use',
'molecule_class',
'_metadata.eubopen.is_probe',
'_metadata.eubopen.is_control',
'_metadata.eubopen.is_chemogenomic_probe',
],
},
footers: {
label_properties: [
'molecule_type',
'molecule_properties.mw_freebase',
],
},
},
xAxis: {
entityID: EntityNames.EubopenTarget.entityID,
initialQuery: {
sort: [{ '_metadata.related_compounds.count': 'desc' }],
},
headers: {
label_property: 'pref_name',
additional_properties: ['target_chembl_id'],
mini_report_card_properties: [
'target_synonyms',
'target_type',
'organism',
],
},
footers: {
label_properties: ['organism', 'target_type'],
},
},
cells: {
entityID: EntityNames.EubopenActivity.entityID,
properties: ['num_activities', 'fake_property'],
},
}
},
},
async mounted() {
try {
const setItemsResponse = await ESProxyService.getGenericData(
`eubopen/miscellaneous/dataset/${this.setID}`
)
console.log(setItemsResponse)
const setItems = setItemsResponse.data.setItems
console.log(setItems)
const idsRawList = setItems.map((item) => item.molecule_eubopen_id)
this.compoundEubopenIDs = [...new Set(idsRawList)]
console.log(this.compoundEubopenIDs)
} catch (e) {
this.showError = true
this.errorMsg = e.message
} finally {
this.loading = false
}
},
}
</script>
<style></style>