diff --git a/components/report_cards/shared/CrystalStructures/CrystalStructures.vue b/components/report_cards/shared/CrystalStructures/CrystalStructures.vue deleted file mode 100644 index 223d00340d3a599c03760487a6f0572e543ae20b..0000000000000000000000000000000000000000 --- a/components/report_cards/shared/CrystalStructures/CrystalStructures.vue +++ /dev/null @@ -1,109 +0,0 @@ -<template> - <v-card> - <v-skeleton-loader v-if="loading" type="card"></v-skeleton-loader> - <template v-if="!loading && !thereAreRefs"> - <v-card-text> No entires found in PDB for {{ itemID }} </v-card-text> - </template> - <template v-if="!loading && thereAreRefs"> - <v-tabs show-arrows :vertical="makeTabsVertical"> - <v-tab v-for="ref in pdbeRefs" :key="ref.id"> {{ ref.id }} </v-tab> - <v-tab-item v-for="ref in pdbeRefs" :key="`${ref.id}-item`"> - <PDBeVisualisations :ligand-code="ref.id" :ref-link="ref.link" /> - </v-tab-item> - </v-tabs> - </template> - </v-card> -</template> - -<script> -import RequestNotifications from '@/web-components-submodule/utils/RequestNotifications.js' -import ESProxyService from '~/web-components-submodule/services/ESProxyService.js' -import EntityNames from '~/web-components-submodule/standardisation/EntityNames.js' -import IndexNames from '~/web-components-submodule/standardisation/IndexNames.js' -import ObjectPropertyAccess from '~/web-components-submodule/utils/ObjectPropertyAccess.js' -import PDBeVisualisations from '~/components/report_cards/shared/CrystalStructures/PDBeVisualisations.vue' - -export default { - components: { - PDBeVisualisations, - }, - props: { - idType: { - type: String, - default: () => EntityNames.EubopenCompound.entityID, - validator: (value) => - [ - EntityNames.EubopenCompound.entityID, - EntityNames.EubopenTarget.entityID, - ].includes(value), - }, - itemID: { - type: String, - default: () => undefined, - }, - }, - data() { - return { - loading: true, - ligandCode: 'VIA', - pdbeRefs: [], - } - }, - computed: { - makeTabsVertical() { - switch (this.$vuetify.breakpoint.name) { - case 'xs': - return false - case 'sm': - return false - default: - return true - } - }, - thereAreRefs() { - return this.pdbeRefs.length > 0 - }, - }, - mounted() { - if (this.idType === EntityNames.EubopenCompound.entityID) { - this.loadDataForCompounds() - } else { - this.loadDataForTargets() - } - }, - methods: { - loadDataForCompounds() { - const entityID = EntityNames.Compound.entityID - const indexName = IndexNames.getIndexNameFromEntityID(entityID) - const unichemPropertyPath = '_metadata.unichem' - const docSource = [unichemPropertyPath] - - ESProxyService.getESDocument(indexName, this.itemID, docSource) - .then((response) => { - const sourceObtained = response.data._source - const unichemRefs = ObjectPropertyAccess.getPropertyPalue( - sourceObtained, - unichemPropertyPath, - [], - false - ) - const pdbeRefs = unichemRefs.filter((ref) => ref.src_name === 'PDBe') - this.pdbeRefs = pdbeRefs - this.loading = false - }) - .catch((error) => { - RequestNotifications.dispatchRequestErrorNotification( - error, - this.$store.dispatch, - `Crystal Structures: There was an error while loading the unichem references for ${this.itemID}` - ) - }) - }, - loadDataForTargets() { - console.log('Load Data for Targets!') - }, - }, -} -</script> - -<style></style> diff --git a/components/report_cards/shared/CrystalStructures/PDBeVisualisations.vue b/components/report_cards/shared/CrystalStructures/PDBeVisualisations.vue index 61ef99969d9d360e61c4e9db0a8967495f64315f..587ca53f05779cf2e908fd2c0e5226ce4b6daa11 100644 --- a/components/report_cards/shared/CrystalStructures/PDBeVisualisations.vue +++ b/components/report_cards/shared/CrystalStructures/PDBeVisualisations.vue @@ -92,13 +92,12 @@ export default { methods: { loadPDBEntriesForLigand() { const requestURL = `https://www.ebi.ac.uk/pdbe/graph-api/compound/in_pdb/${this.ligandCode}` - console.log('requestURL: ', requestURL) + axios .get(requestURL) .then((response) => { - console.log('response obtained: ', response) const pdbeMolecules = response.data[this.ligandCode] - console.log('pdbeMolecules: ', pdbeMolecules) + this.pdbeMolecules = pdbeMolecules this.loading = false }) diff --git a/report_cards_structure/CompoundReportCardGenerator.js b/report_cards_structure/CompoundReportCardGenerator.js index 3c6cdec44b83352b6c1c3ebc5b4107902f339254..f4d7fabc061408753d8412285398c2966e090ceb 100644 --- a/report_cards_structure/CompoundReportCardGenerator.js +++ b/report_cards_structure/CompoundReportCardGenerator.js @@ -3,7 +3,7 @@ import ControlStructuresAndUse from '~/components/report_cards/chemical_probe/Co import CellularAssayTargetEngagement from '~/components/report_cards/chemical_probe/CellularAssayTargetEngagement.vue' import ProbeProfile from '~/components/report_cards/chemical_probe/ProbeProfile.vue' import ProbeMechanism from '~/components/report_cards/chemical_probe/ProbeMechanism.vue' -import CrystalStructures from '~/components/report_cards/shared/CrystalStructures/CrystalStructures.vue' +import CompoundCrystalStructures from '~/components/report_cards/chemical_probe/CompoundCrystalStructures.vue' import CalculatedProperties from '~/components/report_cards/chemical_probe/CalculatedProperties.vue' import EntityNames from '~/web-components-submodule/standardisation/EntityNames.js' @@ -51,7 +51,7 @@ const methods = { { id: 'CrystalStructures', title: 'Crystal Structures', - component: CrystalStructures, + component: CompoundCrystalStructures, index: 6, }, ], diff --git a/report_cards_structure/TargetReportCardGenerator.js b/report_cards_structure/TargetReportCardGenerator.js index 2739b5f31149d189f8016c5907f72f0a014c86e9..16b11f0731534da86794ae32d039547138f29616 100644 --- a/report_cards_structure/TargetReportCardGenerator.js +++ b/report_cards_structure/TargetReportCardGenerator.js @@ -1,6 +1,7 @@ import NameAndClassification from '~/components/report_cards/target/NameAndClassification.vue' import ActivityCharts from '~/components/report_cards/target/ActivityCharts.vue' import EntityNames from '~/web-components-submodule/standardisation/EntityNames.js' +import TargetCrystalStructures from '~/components/report_cards/target/TargetCrystalStructures.vue' const methods = { generateReportCardStructure(itemID) { @@ -19,6 +20,12 @@ const methods = { component: ActivityCharts, index: 1, }, + { + id: 'CrystalStructures', + title: 'Crystal Structures', + component: TargetCrystalStructures, + index: 2, + }, ], } }, diff --git a/static/favicon.ico b/static/favicon.ico index 3632d0c89129045dc4103e84e59e426c57b8f51a..425ba70067a61cefce723d930a19e927a63ec33f 100644 Binary files a/static/favicon.ico and b/static/favicon.ico differ diff --git a/web-components-submodule b/web-components-submodule index cd0c1a3cb8491bca0ab3225e228069353a1b1604..98ca968e340287d92402a1ebd41622d0f666941e 160000 --- a/web-components-submodule +++ b/web-components-submodule @@ -1 +1 @@ -Subproject commit cd0c1a3cb8491bca0ab3225e228069353a1b1604 +Subproject commit 98ca968e340287d92402a1ebd41622d0f666941e