Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
EUbOPEN Web
Manage
Activity
Members
Labels
Plan
Issues
15
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ChEMBL
EUbOPEN
EUbOPEN Web
Commits
c6e2fab6
Commit
c6e2fab6
authored
1 year ago
by
David Mendez
Browse files
Options
Downloads
Patches
Plain Diff
eubopen compound: refactor generation of report card structure by using async functions
parent
ed5d846f
No related branches found
No related tags found
1 merge request
!88
Changes for the Midterm Review
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
components/report_cards/chemical_probe/EubopenCompoundReportCard.vue
+80
-65
80 additions, 65 deletions
...report_cards/chemical_probe/EubopenCompoundReportCard.vue
report_cards_structure/CompoundReportCardGenerator.js
+1
-3
1 addition, 3 deletions
report_cards_structure/CompoundReportCardGenerator.js
with
81 additions
and
68 deletions
components/report_cards/chemical_probe/EubopenCompoundReportCard.vue
+
80
−
65
View file @
c6e2fab6
...
...
@@ -37,79 +37,94 @@ export default {
return
state
[
this
.
storeModuleName
].
reportCardStructure
},
}),
mounted
()
{
const
docSource
=
[
'
pref_name
'
,
'
_metadata.eubopen.is_probe
'
,
'
_metadata.eubopen.is_control
'
,
]
const
entityID
=
EntityNames
.
EubopenCompound
.
entityID
const
indexName
=
IndexNames
.
getIndexNameFromEntityID
(
entityID
)
async
mounted
()
{
try
{
const
paramsFromCompound
=
await
this
.
getOptionalSectionsParams
()
const
showCellHeatlhAndViabilityData
=
await
this
.
hasCellHeatlhAndViabilityData
()
const
reportCardStructure
=
CompoundReportCardGenerator
.
generateReportCardStructure
(
this
.
itemID
,
paramsFromCompound
.
prefName
,
{
isChemicalProbe
:
paramsFromCompound
.
isChemicalProbe
,
isNegativeControl
:
paramsFromCompound
.
isNegativeControl
,
showCellHeatlhAndViabilityData
,
}
)
ESProxyService
.
getESDocument
(
indexName
,
this
.
itemID
,
docSource
)
.
then
((
response
)
=>
{
const
sourceObtained
=
response
.
data
.
_source
const
prefName
=
ObjectPropertyAccess
.
getPropertyPalue
(
sourceObtained
,
'
pref_name
'
,
''
,
false
)
this
.
$store
.
dispatch
(
`
${
this
.
storeModuleName
}
/setReportCardStructure`
,
reportCardStructure
)
const
isChemicalProbe
=
ObjectPropertyAccess
.
getPropertyPalue
(
sourceObtained
,
'
_metadata.eubopen.is_probe
'
,
false
)
this
.
$store
.
dispatch
(
`
${
this
.
storeModuleName
}
/setStructureReady`
,
true
)
}
catch
(
error
)
{
ErrorTracking
.
trackError
(
error
,
this
)
const
isNegativeControl
=
ObjectPropertyAccess
.
getPropertyPalue
(
sourceObtained
,
'
_metadata.eubopen.is_control
'
,
false
)
RequestNotifications
.
dispatchRequestErrorNotification
(
error
,
this
.
$store
.
dispatch
,
`There was an error while loading the page structure`
)
}
},
methods
:
{
async
getOptionalSectionsParams
()
{
const
docSource
=
[
'
pref_name
'
,
'
_metadata.eubopen.is_probe
'
,
'
_metadata.eubopen.is_control
'
,
]
const
entityID
=
EntityNames
.
EubopenCompound
.
entityID
const
indexName
=
IndexNames
.
getIndexNameFromEntityID
(
entityID
)
const
compoundData
=
await
ESProxyService
.
getESDocument
(
indexName
,
this
.
itemID
,
docSource
)
const
cellHeatlhAndViabilityDataPath
=
`/eubopen/visualisations/compound/cell_viability_and_health_data/
${
this
.
itemID
}
`
const
prefName
=
ObjectPropertyAccess
.
getPropertyPalue
(
compoundData
,
'
pref_name
'
,
''
)
ESProxyService
.
getGenericData
(
cellHeatlhAndViabilityDataPath
)
.
then
((
response
)
=>
{
const
numDataPoints
=
response
.
data
.
num_datapoints
const
showCellHeatlhAndViabilityData
=
numDataPoints
>
0
const
reportCardStructure
=
CompoundReportCardGenerator
.
generateReportCardStructure
(
this
.
itemID
,
prefName
,
isChemicalProbe
,
isNegativeControl
,
showCellHeatlhAndViabilityData
)
this
.
$store
.
dispatch
(
`
${
this
.
storeModuleName
}
/setReportCardStructure`
,
reportCardStructure
)
const
isChemicalProbe
=
ObjectPropertyAccess
.
getPropertyPalue
(
compoundData
,
'
_metadata.eubopen.is_probe
'
,
false
)
this
.
$store
.
dispatch
(
`
${
this
.
storeModuleName
}
/setStructureReady`
,
true
)
})
.
catch
((
error
)
=>
{
ErrorTracking
.
trackError
(
error
,
this
)
const
isNegativeControl
=
ObjectPropertyAccess
.
getPropertyPalue
(
compoundData
,
'
_metadata.eubopen.is_control
'
,
false
)
RequestNotifications
.
dispatchRequestErrorNotification
(
error
,
this
.
$store
.
dispatch
,
`Target Classifications: There was an error while loading the Cell Viability and Health Data!`
)
})
})
.
catch
((
error
)
=>
{
ErrorTracking
.
trackError
(
error
,
this
)
return
{
prefName
,
isChemicalProbe
,
isNegativeControl
,
}
},
async
hasCellHeatlhAndViabilityData
()
{
const
chemblIDResponse
=
await
ESProxyService
.
getESDocument
(
IndexNames
.
getIndexNameFromEntityID
(
EntityNames
.
EubopenCompound
.
entityID
),
this
.
itemID
,
[
'
molecule_chembl_id
'
]
)
const
chemblID
=
chemblIDResponse
.
data
.
_source
.
molecule_chembl_id
const
cellHeatlhAndViabilityDataPath
=
`/eubopen/visualisations/compound/cell_viability_and_health_data/
${
chemblID
}
`
const
cellHealthAndViabilityData
=
await
ESProxyService
.
getGenericData
(
cellHeatlhAndViabilityDataPath
)
RequestNotifications
.
dispatchRequestErrorNotification
(
error
,
this
.
$store
.
dispatch
,
`There was an error while loading the page structure`
)
})
const
numDataPoints
=
cellHealthAndViabilityData
.
data
.
num_datapoints
return
numDataPoints
>
0
},
},
}
</
script
>
...
...
This diff is collapsed.
Click to expand it.
report_cards_structure/CompoundReportCardGenerator.js
+
1
−
3
View file @
c6e2fab6
...
...
@@ -13,9 +13,7 @@ const methods = {
generateReportCardStructure
(
itemID
,
prefName
,
isChemicalProbe
,
isNegativeControl
,
showCellHeatlhAndViabilityData
{
isChemicalProbe
,
isNegativeControl
,
showCellHeatlhAndViabilityData
}
)
{
const
basePageStructure
=
[
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment