Skip to content
Snippets Groups Projects
Commit 7db71c22 authored by David Mendez's avatar David Mendez
Browse files

Datasets: use targets in list to create heatmap y axis

parent 88ebb2d9
No related branches found
No related tags found
1 merge request!100Add alternative forms and Sets page
......@@ -6,8 +6,9 @@
</v-card-text>
<template v-else>
<Heatmap :heatmap-description="heatmapDescription" />
compoundChEMBLIDs: {{ compoundChEMBLIDs.length }}
{{ compoundChEMBLIDs }}
compoundChEMBLIDs: {{ compoundChEMBLIDs.length }} {{ compoundChEMBLIDs }},
targetChEMBLIDs: {{ targetChEMBLIDs.length }}
{{ targetChEMBLIDs }}
</template>
</div>
</template>
......@@ -32,6 +33,7 @@ export default {
showError: false,
errorMsg: undefined,
compoundChEMBLIDs: [],
targetChEMBLIDs: [],
}
},
computed: {
......@@ -71,10 +73,8 @@ export default {
initialQuery: {
sort: [{ '_metadata.related_compounds.count': 'desc' }],
query: {
query_string: {
query: `_metadata.related_compounds.all_chembl_ids:(${this.compoundChEMBLIDs.join(
' OR '
)})`,
terms: {
target_chembl_id: this.targetChEMBLIDs,
},
},
},
......@@ -103,12 +103,15 @@ export default {
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_chembl_id)
this.compoundChEMBLIDs = [...new Set(idsRawList)]
console.log(this.compoundChEMBLIDs)
const moleculeChEMBLidsRawList = setItems.map(
(item) => item.molecule_chembl_id
)
this.compoundChEMBLIDs = [...new Set(moleculeChEMBLidsRawList)]
const targetChEMBLidsRawList = setItems.map(
(item) => item.target_chembl_id
)
this.targetChEMBLIDs = [...new Set(targetChEMBLidsRawList)]
} catch (e) {
this.showError = true
this.errorMsg = e.message
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment