sennetconsortium / entity-api

A set of web service calls to return information about SenNet entities
MIT License
0 stars 0 forks source link

Create new triggers to support hierarchy in the portal #408

Closed maxsibilla closed 1 month ago

maxsibilla commented 1 month ago

Two new properties need to be added to the provenance schema.

For Sample:

organ_hierarchy:
  type: string
  description: 'The name of the top level of the hierarchy this organ belongs to based on its laterality.'
  on_index_trigger: get_organ_hierarchy

For Dataset:

dataset_type_hierarchy:
  type: string
  description: 'The name of the top level of the hierarchy this dataset type belongs to.'
  on_index_trigger: get_dataset_type_hierarchy
maxsibilla commented 1 month ago

In schema_triggers.py

get_organ_hierarchy will return the organ without the string inside of parenthesis. For instance if the organ is Lung (Left) this trigger will set the property organ_hierarchy to "Lung".

get_dataset_type_hierarchy will have to loop through the response from https://ontology-api.dev.hubmapconsortium.org/assayclasses?application_context=SENNET. If the dataset_type value is for example CODEX [Cytokit + SPRM], the trigger will set the property dataset_type_hierarchy to CODEX. dataset_type can be found in object.value.description while the hierarchy can be found at object.value.dataset_type.dataset_type

Image

libpitt commented 1 month ago

This is ready:

Branch commit: https://github.com/sennetconsortium/entity-api/compare/main...libpitt/408-hierarchy Requires: atlas-consortia-commons 1.0.13 https://test.pypi.org/project/atlas-consortia-commons/ Update app.cfg with new assay_classes property: UBKG_CODES = '{"specimen_categories":"C020076", "dataset_types":{"code": "C003041", "key": "datasets", "endpoint": "valueset?parent_sab=SENNET&parent_code=C003041&child_sabs=SENNET"}, "organ_types":{"code": "C000008", "key": "organs", "endpoint": "organs?application_context=SENNET"}, "entities": "C000012", "source_types":"C050020", "assay_classes":{"code": "C004000", "key": "assay_classes", "endpoint": "assayclasses?application_context=SENNET"}}'

libpitt commented 1 month ago

Results:

Sample: Image

Dataset: Image