diff --git a/components/report_cards/chemical_probe/ActivityProfileComponents/ActivityDataSingleTab.vue b/components/report_cards/chemical_probe/ActivityProfileComponents/ActivityDataSingleTab.vue index 15d93b0fa741455d78949c6365bd8613acc083a0..ac413a1c9129811980452a5d02fe4a1ec935d0c3 100644 --- a/components/report_cards/chemical_probe/ActivityProfileComponents/ActivityDataSingleTab.vue +++ b/components/report_cards/chemical_probe/ActivityProfileComponents/ActivityDataSingleTab.vue @@ -31,6 +31,10 @@ export default { type: String, default: () => undefined, }, + chemblID: { + type: String, + default: () => undefined, + }, }, data() { return { @@ -60,10 +64,10 @@ export default { query: { bool: { must: [ - { terms: { molecule_chembl_id: [this.itemID] } }, + { terms: { molecule_chembl_id: [this.chemblID] } }, { terms: { - '_metadata.eubopen_assay_type.aidx_prefix.keyword': [ + '_metadata.eubopen_assay_type.aidx_prefix': [ this.tabConfig.key, ], }, diff --git a/components/report_cards/chemical_probe/ActivityProfileComponents/ActivityDataTabs.vue b/components/report_cards/chemical_probe/ActivityProfileComponents/ActivityDataTabs.vue index 5b941c94dbd5a93ce0e0c87fc6cce04b5c831c0d..435482e4060e43038dbb07b488d20503b15f9231 100644 --- a/components/report_cards/chemical_probe/ActivityProfileComponents/ActivityDataTabs.vue +++ b/components/report_cards/chemical_probe/ActivityProfileComponents/ActivityDataTabs.vue @@ -7,7 +7,11 @@ </v-alert> </template> <template v-else> - <DownloadButton :item-i-d="itemID" :section-key="sectionKey" /> + <DownloadButton + :item-i-d="itemID" + :chembl-i-d="chemblID" + :section-key="sectionKey" + /> <v-tabs v-model="tab" show-arrows> <v-tab v-for="item in shownSections" :key="item.key"> {{ item.title }} @@ -16,7 +20,11 @@ <v-tabs-items v-model="tab"> <v-tab-item v-for="item in shownSections" :key="item.key"> - <ActivityDataSingleTab :tab-config="item" :item-i-d="itemID" /> + <ActivityDataSingleTab + :tab-config="item" + :item-i-d="itemID" + :chembl-i-d="chemblID" + /> </v-tab-item> </v-tabs-items> </template> @@ -41,6 +49,10 @@ export default { type: String, default: () => undefined, }, + chemblID: { + type: String, + default: () => undefined, + }, }, data() { return { @@ -146,10 +158,10 @@ export default { query: { bool: { must: [ - { terms: { molecule_chembl_id: [this.itemID] } }, + { terms: { molecule_chembl_id: [this.chemblID] } }, { terms: { - '_metadata.eubopen_assay_type.aidx_prefix.keyword': aidxPrefixes, + '_metadata.eubopen_assay_type.aidx_prefix': aidxPrefixes, }, }, ], diff --git a/components/report_cards/chemical_probe/ActivityProfileComponents/DownloadButton.vue b/components/report_cards/chemical_probe/ActivityProfileComponents/DownloadButton.vue index 5446879e12432ea7670b77794e4765e661ce1f9e..b06501a58b296bd6cc8ee17d0c04937924d7425a 100644 --- a/components/report_cards/chemical_probe/ActivityProfileComponents/DownloadButton.vue +++ b/components/report_cards/chemical_probe/ActivityProfileComponents/DownloadButton.vue @@ -30,6 +30,10 @@ export default { type: String, default: () => undefined, }, + chemblID: { + type: String, + default: () => undefined, + }, sectionKey: { type: String, default: () => undefined, @@ -58,12 +62,12 @@ export default { }, starterParams() { return { - chemblID: this.itemID, + chemblID: this.chemblID, propertiesGroups: this.propertiesGroups, initialQuery: { query: { bool: { - must: [{ terms: { molecule_chembl_id: [this.itemID] } }], + must: [{ terms: { molecule_chembl_id: [this.chemblID] } }], }, }, }, diff --git a/components/report_cards/chemical_probe/CellViabilityAndHealthData.vue b/components/report_cards/chemical_probe/CellViabilityAndHealthData.vue index 4a3c158a64f0266cc4bf362ce61eb4ec375f93e0..49b73fc27a0aca04925d9318963150801c8fa4e0 100644 --- a/components/report_cards/chemical_probe/CellViabilityAndHealthData.vue +++ b/components/report_cards/chemical_probe/CellViabilityAndHealthData.vue @@ -63,6 +63,10 @@ export default { type: String, default: () => undefined, }, + chemblID: { + type: String, + default: () => undefined, + }, }, data() { return { @@ -72,7 +76,7 @@ export default { }, computed: { csvURL() { - return `${process.env.esProxyBaseUrl}/eubopen/visualisations/compound/cell_viability_and_health_data/download/CHEMBL180022` + return `${process.env.esProxyBaseUrl}/eubopen/visualisations/compound/cell_viability_and_health_data/download/${this.chemblID}` }, }, mounted() { @@ -80,7 +84,7 @@ export default { }, methods: { loadData() { - const visualisationPath = `/eubopen/visualisations/compound/cell_viability_and_health_data/${this.itemID}` + const visualisationPath = `/eubopen/visualisations/compound/cell_viability_and_health_data/${this.chemblID}` ESProxyService.getGenericData(visualisationPath) .then((response) => { diff --git a/components/report_cards/chemical_probe/CompoundActivityProfile.vue b/components/report_cards/chemical_probe/CompoundActivityProfile.vue index f8c9b51409fd3f4011b88aed51301aeb553909b9..621f33fb6d8eea30df82ae149b3c0df54bc1f106 100644 --- a/components/report_cards/chemical_probe/CompoundActivityProfile.vue +++ b/components/report_cards/chemical_probe/CompoundActivityProfile.vue @@ -2,7 +2,11 @@ <div> <v-card> <v-card-text> - <ActivityDataTabs :item-i-d="itemID" section-key="ActivityProfile" /> + <ActivityDataTabs + :item-i-d="itemID" + section-key="ActivityProfile" + :chembl-i-d="chemblID" + /> </v-card-text> </v-card> </div> @@ -19,6 +23,10 @@ export default { type: String, default: () => undefined, }, + chemblID: { + type: String, + default: () => undefined, + }, }, } </script> diff --git a/components/report_cards/chemical_probe/CompoundCrystalStructures.vue b/components/report_cards/chemical_probe/CompoundCrystalStructures.vue index 5db5bb1f24dedaf3b133eeccd5794cb9db3403cc..58444fee8921525b92020b50d9c186f7f291b4e2 100644 --- a/components/report_cards/chemical_probe/CompoundCrystalStructures.vue +++ b/components/report_cards/chemical_probe/CompoundCrystalStructures.vue @@ -41,6 +41,10 @@ export default { type: String, default: () => undefined, }, + chemblID: { + type: String, + default: () => undefined, + }, }, data() { return { @@ -64,7 +68,7 @@ export default { const unichemPropertyPath = '_metadata.unichem' const docSource = [unichemPropertyPath] - ESProxyService.getESDocument(indexName, this.itemID, docSource) + ESProxyService.getESDocument(indexName, this.chemblID, docSource) .then((response) => { const sourceObtained = response.data._source const unichemRefs = ObjectPropertyAccess.getPropertyPalue( diff --git a/components/report_cards/chemical_probe/EubopenCompoundReportCard.vue b/components/report_cards/chemical_probe/EubopenCompoundReportCard.vue index b6751539b19ea2c1b5df7d956fc952c1698bf5e0..53dd089036232e9cbcf1dd9ce8790997e127c544 100644 --- a/components/report_cards/chemical_probe/EubopenCompoundReportCard.vue +++ b/components/report_cards/chemical_probe/EubopenCompoundReportCard.vue @@ -40,14 +40,24 @@ export default { async mounted() { try { const paramsFromCompound = await this.getOptionalSectionsParams() - const showCellHeatlhAndViabilityData = await this.hasCellHeatlhAndViabilityData() + const chemblID = await this.getChEMBLID() + const showCellHeatlhAndViabilityData = await this.hasCellHeatlhAndViabilityData( + chemblID + ) + const showQualityControlData = await this.hasQualityControlData(chemblID) + const showActivityProfileData = await this.hasActivityProfileData( + chemblID + ) const reportCardStructure = CompoundReportCardGenerator.generateReportCardStructure( - this.itemID, - paramsFromCompound.prefName, { + itemID: this.itemID, + chemblID, + prefName: paramsFromCompound.prefName, isChemicalProbe: paramsFromCompound.isChemicalProbe, isNegativeControl: paramsFromCompound.isNegativeControl, showCellHeatlhAndViabilityData, + showQualityControlData, + showActivityProfileData, } ) @@ -107,7 +117,7 @@ export default { isNegativeControl, } }, - async hasCellHeatlhAndViabilityData() { + async getChEMBLID() { const chemblIDResponse = await ESProxyService.getESDocument( IndexNames.getIndexNameFromEntityID( EntityNames.EubopenCompound.entityID @@ -116,7 +126,9 @@ export default { ['molecule_chembl_id'] ) - const chemblID = chemblIDResponse.data._source.molecule_chembl_id + return chemblIDResponse.data._source.molecule_chembl_id + }, + async hasCellHeatlhAndViabilityData(chemblID) { const cellHeatlhAndViabilityDataPath = `/eubopen/visualisations/compound/cell_viability_and_health_data/${chemblID}` const cellHealthAndViabilityData = await ESProxyService.getGenericData( cellHeatlhAndViabilityDataPath @@ -125,6 +137,68 @@ export default { const numDataPoints = cellHealthAndViabilityData.data.num_datapoints return numDataPoints > 0 }, + async hasQualityControlData(chemblID) { + const entityID = EntityNames.EubopenActivity.entityID + const indexName = IndexNames.getIndexNameFromEntityID(entityID) + const aidxPrefixes = ['MULTI', 'INCU', 'LIABILITY'] + + const query = { + size: 0, + query: { + bool: { + must: [ + { terms: { molecule_chembl_id: [chemblID] } }, + { + terms: { + '_metadata.eubopen_assay_type.aidx_prefix': aidxPrefixes, + }, + }, + ], + }, + }, + } + + const qtData = await ESProxyService.getESData(indexName, query) + const numHits = qtData.data.es_response.hits.total.value + + return numHits > 0 + }, + async hasActivityProfileData(chemblID) { + const entityID = EntityNames.EubopenActivity.entityID + const indexName = IndexNames.getIndexNameFromEntityID(entityID) + const aidxPrefixes = [ + 'AB', + 'AOT', + 'AP', + 'S', + 'ASIC50', + 'ASSS', + 'GPCR', + 'NanoBRET', + 'ITC', + 'HTRF', + ] + + const query = { + size: 0, + query: { + bool: { + must: [ + { terms: { molecule_chembl_id: [chemblID] } }, + { + terms: { + '_metadata.eubopen_assay_type.aidx_prefix': aidxPrefixes, + }, + }, + ], + }, + }, + } + + const qtData = await ESProxyService.getESData(indexName, query) + const numHits = qtData.data.es_response.hits.total.value + return numHits > 0 + }, }, } </script> diff --git a/components/report_cards/chemical_probe/QualityControl.vue b/components/report_cards/chemical_probe/QualityControl.vue index 0f60effb1d388c22ab27d69a59bf6f67acbbb1be..eb108e77d6fc65b4c4c6796b7a171cf700c6226e 100644 --- a/components/report_cards/chemical_probe/QualityControl.vue +++ b/components/report_cards/chemical_probe/QualityControl.vue @@ -2,7 +2,7 @@ <div> <v-card> <v-card-text> - <ActivityDataTabs :item-i-d="itemID" /> + <ActivityDataTabs :item-i-d="itemID" :chembl-i-d="chemblID" /> </v-card-text> </v-card> </div> @@ -19,6 +19,10 @@ export default { type: String, default: () => undefined, }, + chemblID: { + type: String, + default: () => undefined, + }, }, } </script> diff --git a/report_cards_structure/CompoundReportCardGenerator.js b/report_cards_structure/CompoundReportCardGenerator.js index 39e60db027e7528eea8533028b025d015ecd7c61..a3c47312d8a27c5a6bbbe3bde8d9dad9fba39521 100644 --- a/report_cards_structure/CompoundReportCardGenerator.js +++ b/report_cards_structure/CompoundReportCardGenerator.js @@ -10,11 +10,16 @@ import EntityNames from '~/web-components-submodule/standardisation/EntityNames. import CellViabilityAndHealthData from '~/components/report_cards/chemical_probe/CellViabilityAndHealthData.vue' const methods = { - generateReportCardStructure( + generateReportCardStructure({ itemID, + chemblID, prefName, - { isChemicalProbe, isNegativeControl, showCellHeatlhAndViabilityData } - ) { + isChemicalProbe, + isNegativeControl, + showCellHeatlhAndViabilityData, + showQualityControlData, + showActivityProfileData, + }) { const basePageStructure = [ { id: 'Summary', @@ -44,18 +49,27 @@ const methods = { id: 'QualityControl', title: 'Quality Control', component: QualityControl, - include: true, + componentParams: { + chemblID, + }, + include: showQualityControlData, }, { id: 'ActivityProfile', title: 'Activity Profile', component: CompoundActivityProfile, - include: true, + componentParams: { + chemblID, + }, + include: showActivityProfileData, }, { id: 'CellViabilityAndHealthData', title: 'Cell Health Data', component: CellViabilityAndHealthData, + componentParams: { + chemblID, + }, include: showCellHeatlhAndViabilityData, }, { @@ -71,6 +85,9 @@ const methods = { id: 'CrystalStructures', title: 'PDB Ligand Codes', component: CompoundCrystalStructures, + componentParams: { + chemblID, + }, include: true, }, ] diff --git a/web-components-submodule b/web-components-submodule index 4a0daf4316804616b68774a5d777c39865cfe599..918874fc1fe49e86fd578e0630d8f08cc74be8b0 160000 --- a/web-components-submodule +++ b/web-components-submodule @@ -1 +1 @@ -Subproject commit 4a0daf4316804616b68774a5d777c39865cfe599 +Subproject commit 918874fc1fe49e86fd578e0630d8f08cc74be8b0