From bdefe3cdb8d8d221d19202bfd705b8af05b33761 Mon Sep 17 00:00:00 2001 From: Gavin Date: Wed, 16 Aug 2023 10:06:00 -0700 Subject: [PATCH] Add biolog endpoints to service --- .../storage/collection_and_field_names.py | 33 +++++++++++++++++++ src/service/data_product_specs.py | 1 + src/service/data_products/biolog.py | 16 +++++++++ 3 files changed, 50 insertions(+) create mode 100644 src/service/data_products/biolog.py diff --git a/src/common/storage/collection_and_field_names.py b/src/common/storage/collection_and_field_names.py index efd71832f..431f787ad 100644 --- a/src/common/storage/collection_and_field_names.py +++ b/src/common/storage/collection_and_field_names.py @@ -302,3 +302,36 @@ FLD_KB_SAMPLE_ID = "kbase_sample_id" """ Key name for KBase sample id """ + + +### biolog + +_BIOLOG_COLL_PREFIX = COLLECTION_PREFIX + "biolog_" + +COLL_BIOLOG_META: Annotated[ + str, + COLL_ANNOTATION, + { + COLL_ANNOKEY_DESCRIPTION: "A collection holding Biolog heatmap metadata.", + COLL_ANNOKEY_SUGGESTED_SHARDS: 1, + } + +] = _BIOLOG_COLL_PREFIX + "meta" + +COLL_BIOLOG_DATA: Annotated[ + str, + COLL_ANNOTATION, + { + COLL_ANNOKEY_DESCRIPTION: "A collection holding Biolog heatmap data.", + COLL_ANNOKEY_SUGGESTED_SHARDS: 3, + } +] = _BIOLOG_COLL_PREFIX + "data" + +COLL_BIOLOG_CELLS: Annotated[ + str, + COLL_ANNOTATION, + { + COLL_ANNOKEY_DESCRIPTION: "A collection holding Biolog heatmap cell detail data.", + COLL_ANNOKEY_SUGGESTED_SHARDS: 3, + } +] = _BIOLOG_COLL_PREFIX + "cells" diff --git a/src/service/data_product_specs.py b/src/service/data_product_specs.py index 031e4141a..78742c1b5 100644 --- a/src/service/data_product_specs.py +++ b/src/service/data_product_specs.py @@ -20,6 +20,7 @@ "src.service.data_products.taxa_count": "TAXA_COUNT_SPEC", "src.service.data_products.genome_attributes": "GENOME_ATTRIBS_SPEC", "src.service.data_products.microtrait": "MICROTRAIT_SPEC", + "src.service.data_products.biolog": "BIOLOG_SPEC", "src.service.data_products.samples": "SAMPLES_SPEC", } diff --git a/src/service/data_products/biolog.py b/src/service/data_products/biolog.py new file mode 100644 index 000000000..b72c6f590 --- /dev/null +++ b/src/service/data_products/biolog.py @@ -0,0 +1,16 @@ +""" +The Biolog data product. +""" + +import src.common.storage.collection_and_field_names as names +from src.service.data_products.heatmap import HeatMapController + +_BIOLOG_CONTROLLER = HeatMapController( + "biolog", + "Biolog", + names.COLL_BIOLOG_META, + names.COLL_BIOLOG_DATA, + names.COLL_BIOLOG_CELLS, +) + +BIOLOG_SPEC = _BIOLOG_CONTROLLER.get_data_product_spec()