From 17ce62c74970dbd8dfd0a48b7680319a4024a891 Mon Sep 17 00:00:00 2001 From: Nikolay Akhmetov Date: Tue, 12 Dec 2023 16:57:47 -0500 Subject: [PATCH 01/19] Update `get_view_config_builder` to use `get_assaytype` instead of `get_assay` --- src/portal_visualization/assays.py | 1 + src/portal_visualization/builder_factory.py | 39 ++++++++++++++------- 2 files changed, 28 insertions(+), 12 deletions(-) diff --git a/src/portal_visualization/assays.py b/src/portal_visualization/assays.py index 1726ab3..ad6ec9f 100644 --- a/src/portal_visualization/assays.py +++ b/src/portal_visualization/assays.py @@ -11,3 +11,4 @@ SCATAC_SEQ_SCI = "sc_atac_seq_sci" SCATAC_SEQ_SNARE = "sc_atac_seq_snare" SCATAC_SEQ_SN = "sn_atac_seq" +SALMON_RNASSEQ_SLIDE = "salmon_rnaseq_slideseq" \ No newline at end of file diff --git a/src/portal_visualization/builder_factory.py b/src/portal_visualization/builder_factory.py index f45e9f3..82d562a 100644 --- a/src/portal_visualization/builder_factory.py +++ b/src/portal_visualization/builder_factory.py @@ -18,18 +18,33 @@ from .assays import ( SEQFISH, MALDI_IMS, - NANODESI + NANODESI, + SALMON_RNASSEQ_SLIDE ) +# get_assaytype response example: +# { +# "assaytype": "image_pyramid", +# "description": "Image Pyramid", +# "vitessce_hints": [ +# "is_image", +# "pyramid" +# ] +# } -def get_view_config_builder(entity, get_assay): - data_types = entity["data_types"] - assay_objs = [get_assay(dt) for dt in data_types] - assay_names = [assay.name for assay in assay_objs] - hints = [hint for assay in assay_objs for hint in assay.vitessce_hints] + +def get_ancestor_assaytypes(entity, get_assaytype): + return [get_assaytype(ancestor.get('uuid')).get('assaytype') for ancestor in entity['immediate_ancestors']] + + +def get_view_config_builder(entity, get_assaytype): + assay = get_assaytype(entity.get('uuid')) + assay_name = assay.get('assaytype') + hints = assay.get('vitessce_hints', []) dag_provenance_list = entity.get('metadata', {}).get('dag_provenance_list', []) dag_names = [dag['name'] for dag in dag_provenance_list if 'name' in dag] + print(entity.get('uuid'), assay_name) if "is_image" in hints: if 'sprm' in hints and 'anndata' in hints: return MultiImageSPRMAnndataViewConfBuilder @@ -40,17 +55,17 @@ def get_view_config_builder(entity, get_assay): # Both SeqFISH and IMS were submitted very early on, before the # special image pyramid datasets existed. Their assay names should be in # the `entity["data_types"]` while newer ones, like NanoDESI, are in the parents - if SEQFISH in assay_names: + if assay_name == SEQFISH: return SeqFISHViewConfBuilder - if MALDI_IMS in assay_names: + if assay_name == MALDI_IMS: return IMSViewConfBuilder - if NANODESI in [dt for e in entity["immediate_ancestors"] for dt in e["data_types"]]: + if NANODESI in [assaytype for assaytype in get_ancestor_assaytypes(entity, get_assaytype)]: return NanoDESIViewConfBuilder return ImagePyramidViewConfBuilder if "rna" in hints: # This is the zarr-backed anndata pipeline. if "anndata-to-ui.cwl" in dag_names: - if "salmon_rnaseq_slideseq" in data_types: + if assay_name == SALMON_RNASSEQ_SLIDE: return SpatialRNASeqAnnDataZarrViewConfBuilder return RNASeqAnnDataZarrViewConfBuilder return RNASeqViewConfBuilder @@ -59,6 +74,6 @@ def get_view_config_builder(entity, get_assay): return NullViewConfBuilder -def has_visualization(entity, get_assay): - builder = get_view_config_builder(entity, get_assay) +def has_visualization(entity, get_assaytype): + builder = get_view_config_builder(entity, get_assaytype) return builder != NullViewConfBuilder From 09b90bff6c27df9350681f467012038699cbe104 Mon Sep 17 00:00:00 2001 From: Nikolay Akhmetov Date: Wed, 13 Dec 2023 10:27:58 -0500 Subject: [PATCH 02/19] Fix vis-lifted cases --- src/portal_visualization/builder_factory.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/portal_visualization/builder_factory.py b/src/portal_visualization/builder_factory.py index 82d562a..bb287f2 100644 --- a/src/portal_visualization/builder_factory.py +++ b/src/portal_visualization/builder_factory.py @@ -44,7 +44,6 @@ def get_view_config_builder(entity, get_assaytype): dag_provenance_list = entity.get('metadata', {}).get('dag_provenance_list', []) dag_names = [dag['name'] for dag in dag_provenance_list if 'name' in dag] - print(entity.get('uuid'), assay_name) if "is_image" in hints: if 'sprm' in hints and 'anndata' in hints: return MultiImageSPRMAnndataViewConfBuilder @@ -52,14 +51,13 @@ def get_view_config_builder(entity, get_assaytype): if ('sprm-to-anndata.cwl' in dag_names): return StitchedCytokitSPRMViewConfBuilder return TiledSPRMViewConfBuilder - # Both SeqFISH and IMS were submitted very early on, before the - # special image pyramid datasets existed. Their assay names should be in - # the `entity["data_types"]` while newer ones, like NanoDESI, are in the parents - if assay_name == SEQFISH: + # Check types of image pyramid ancestors to determine which builder to use + ancestor_assaytypes = get_ancestor_assaytypes(entity, get_assaytype) + if SEQFISH in [assaytype for assaytype in ancestor_assaytypes]: return SeqFISHViewConfBuilder - if assay_name == MALDI_IMS: + if MALDI_IMS in [assaytype for assaytype in ancestor_assaytypes]: return IMSViewConfBuilder - if NANODESI in [assaytype for assaytype in get_ancestor_assaytypes(entity, get_assaytype)]: + if NANODESI in [assaytype for assaytype in ancestor_assaytypes]: return NanoDESIViewConfBuilder return ImagePyramidViewConfBuilder if "rna" in hints: From 7986337b9c6ec4d47bc7dbdf77bd6e050ad3c53f Mon Sep 17 00:00:00 2001 From: Nikolay Akhmetov Date: Wed, 13 Dec 2023 12:25:39 -0500 Subject: [PATCH 03/19] unannounced switchover from `vitessce_hints` to `vitessce-hints`... --- src/portal_visualization/builder_factory.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/portal_visualization/builder_factory.py b/src/portal_visualization/builder_factory.py index bb287f2..3453577 100644 --- a/src/portal_visualization/builder_factory.py +++ b/src/portal_visualization/builder_factory.py @@ -40,7 +40,7 @@ def get_ancestor_assaytypes(entity, get_assaytype): def get_view_config_builder(entity, get_assaytype): assay = get_assaytype(entity.get('uuid')) assay_name = assay.get('assaytype') - hints = assay.get('vitessce_hints', []) + hints = assay.get('vitessce-hints', []) dag_provenance_list = entity.get('metadata', {}).get('dag_provenance_list', []) dag_names = [dag['name'] for dag in dag_provenance_list if 'name' in dag] From 4d10f459325fb74e7c67091e91454f679e894317 Mon Sep 17 00:00:00 2001 From: Nikolay Akhmetov Date: Wed, 13 Dec 2023 14:25:34 -0500 Subject: [PATCH 04/19] update vis-preview/readme, fix lint errors --- README.md | 26 ++++++++++----------- VERSION.txt | 2 +- src/defaults.json | 4 ++-- src/portal_visualization/assays.py | 2 +- src/portal_visualization/builder_factory.py | 4 +++- src/vis-preview.py | 20 ++++++++-------- test/test_builders.py | 12 +++++++--- 7 files changed, 39 insertions(+), 31 deletions(-) diff --git a/README.md b/README.md index 50fbed6..09d520c 100644 --- a/README.md +++ b/README.md @@ -21,25 +21,25 @@ $ cd portal-visualization $ pip install . ... $ src/vis-preview.py --help -usage: vis-preview.py [-h] (--url URL | --json JSON) [--types_url URL] +usage: vis-preview.py [-h] (--url URL | --json JSON) [--assaytypes_url URL] [--assets_url URL] [--token TOKEN] [--marker MARKER] [--to_json] Given HuBMAP Dataset JSON, generate a Vitessce viewconf, and load vitessce.io. optional arguments: - -h, --help show this help message and exit - --url URL URL which returns Dataset JSON - --json JSON File containing Dataset JSON - --types_url URL Type service; default: - https://search.api.hubmapconsortium.org/v3 - --assets_url URL Assets endpoint; default: - https://assets.hubmapconsortium.org - --token TOKEN Globus groups token; Only needed if data is not public - --marker MARKER Marker to highlight in visualization; Only used in some - visualizations. - --to_json Output viewconf, rather than open in browser. -``` + -h, --help show this help message and exit + --url URL URL which returns Dataset JSON + --json JSON File containing Dataset JSON + --assaytypes_url URL AssayType service; default: https://ingest- + api.dev.hubmapconsortium.org/assaytype/ + --assets_url URL Assets endpoint; default: + https://assets.hubmapconsortium.org + --token TOKEN Globus groups token; Only needed if data is not public + --marker MARKER Marker to highlight in visualization; Only used in + some visualizations. + --to_json Output viewconf, rather than open in browser. + ``` ## Background diff --git a/VERSION.txt b/VERSION.txt index 43b2961..6e8bf73 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -0.0.13 +0.1.0 diff --git a/src/defaults.json b/src/defaults.json index 32fbf25..60cd613 100644 --- a/src/defaults.json +++ b/src/defaults.json @@ -1,4 +1,4 @@ { - "types_url": "https://search.api.hubmapconsortium.org/v3", - "assets_url": "https://assets.hubmapconsortium.org" + "assets_url": "https://assets.hubmapconsortium.org", + "assaytypes_url": "https://ingest-api.dev.hubmapconsortium.org/assaytype/" } \ No newline at end of file diff --git a/src/portal_visualization/assays.py b/src/portal_visualization/assays.py index ad6ec9f..748c4bc 100644 --- a/src/portal_visualization/assays.py +++ b/src/portal_visualization/assays.py @@ -11,4 +11,4 @@ SCATAC_SEQ_SCI = "sc_atac_seq_sci" SCATAC_SEQ_SNARE = "sc_atac_seq_snare" SCATAC_SEQ_SN = "sn_atac_seq" -SALMON_RNASSEQ_SLIDE = "salmon_rnaseq_slideseq" \ No newline at end of file +SALMON_RNASSEQ_SLIDE = "salmon_rnaseq_slideseq" diff --git a/src/portal_visualization/builder_factory.py b/src/portal_visualization/builder_factory.py index 3453577..35645bd 100644 --- a/src/portal_visualization/builder_factory.py +++ b/src/portal_visualization/builder_factory.py @@ -34,7 +34,9 @@ def get_ancestor_assaytypes(entity, get_assaytype): - return [get_assaytype(ancestor.get('uuid')).get('assaytype') for ancestor in entity['immediate_ancestors']] + return [get_assaytype(ancestor.get('uuid')).get('assaytype') + for ancestor + in entity['immediate_ancestors']] def get_view_config_builder(entity, get_assaytype): diff --git a/src/vis-preview.py b/src/vis-preview.py index 807f374..c6faf29 100755 --- a/src/vis-preview.py +++ b/src/vis-preview.py @@ -9,15 +9,13 @@ import requests -from hubmap_commons.type_client import TypeClient - from portal_visualization.builder_factory import get_view_config_builder def main(): # pragma: no cover defaults = json.load((Path(__file__).parent / 'defaults.json').open()) - types_default_url = defaults['types_url'] assets_default_url = defaults['assets_url'] + assaytypes_default_url = defaults['assaytypes_url'] parser = argparse.ArgumentParser(description=''' Given HuBMAP Dataset JSON, generate a Vitessce viewconf, and load vitessce.io.''') @@ -28,9 +26,9 @@ def main(): # pragma: no cover '--json', type=Path, help='File containing Dataset JSON') parser.add_argument( - '--types_url', metavar='URL', - help=f'Type service; default: {types_default_url}', - default=types_default_url) + '--assaytypes_url', metavar='URL', + help=f'AssayType service; default: {assaytypes_default_url}', + default=assaytypes_default_url) parser.add_argument( '--assets_url', metavar='URL', help=f'Assets endpoint; default: {assets_default_url}', @@ -60,11 +58,13 @@ def main(): # pragma: no cover json_str = args.json.read_text() entity = json.loads(json_str) - def get_assay(name): - type_client = TypeClient(args.types_url) - return type_client.getAssayType(name) + def get_assaytype(uuid): + headers = {} + if args.token: + headers['Authorization'] = f'Bearer {args.token}' + requests.get(f'{defaults["assaytypes_url"]}/{uuid}', headers=headers).json() - Builder = get_view_config_builder(entity=entity, get_assay=get_assay) + Builder = get_view_config_builder(entity, get_assaytype) builder = Builder(entity, args.token, args.assets_url) print(f'Using: {builder.__class__.__name__}', file=stderr) conf_cells = builder.get_conf_cells(marker=marker) diff --git a/test/test_builders.py b/test/test_builders.py index c246770..31d154a 100644 --- a/test/test_builders.py +++ b/test/test_builders.py @@ -2,6 +2,7 @@ import argparse import yaml import json +import requests from pathlib import Path from os import environ from dataclasses import dataclass @@ -35,21 +36,26 @@ class MockResponse: bad_entity_paths = list((Path(__file__).parent / 'bad-fixtures').glob("*-entity.json")) assert len(bad_entity_paths) > 0 +defaults = json.load((Path(__file__).parent.parent / 'src/defaults.json').open()) + def get_assay(name): # This code could also be used in portal-ui. # search-api might skip the REST interface. - defaults = json.load((Path(__file__).parent.parent / 'src/defaults.json').open()) type_client = TypeClient(defaults['types_url']) return type_client.getAssayType(name) +def get_assaytype(uuid): + requests.get(f'{defaults["assaytypes_url"]}/{uuid}').json() + + @pytest.mark.parametrize( "has_vis_entity", [ - (False, {'data_types': [], 'metadata': {'dag_provenance_list': []}}), + (False, {'uuid': "1", 'data_types': [], 'metadata': {'dag_provenance_list': []}}), (True, json.loads(Path.read_text(good_entity_paths[0]))), - (False, {'data_types': []}) + (False, {'uuid': "2", 'data_types': []}) # If the first fixture returns a Null builder this would break. ], ids=lambda has_vis_entity: f'has_visualization={has_vis_entity[0]}') From 53f8f761df7fe264ff6448c2f44b04d745367cc9 Mon Sep 17 00:00:00 2001 From: Nikolay Akhmetov Date: Wed, 13 Dec 2023 14:59:46 -0500 Subject: [PATCH 05/19] prefer .get for safety --- src/portal_visualization/builder_factory.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/portal_visualization/builder_factory.py b/src/portal_visualization/builder_factory.py index 35645bd..3b0b3a2 100644 --- a/src/portal_visualization/builder_factory.py +++ b/src/portal_visualization/builder_factory.py @@ -36,7 +36,7 @@ def get_ancestor_assaytypes(entity, get_assaytype): return [get_assaytype(ancestor.get('uuid')).get('assaytype') for ancestor - in entity['immediate_ancestors']] + in entity.get('immediate_ancestors')] def get_view_config_builder(entity, get_assaytype): From a9c78fe7beec339502bd45ce97975f69308ec87d Mon Sep 17 00:00:00 2001 From: Nikolay Akhmetov Date: Wed, 13 Dec 2023 15:56:56 -0500 Subject: [PATCH 06/19] remove `get_assay`, track down sample datasets for each builder --- src/portal_visualization/builder_factory.py | 27 ++++++++++++++++++--- test/test_builders.py | 20 ++++----------- 2 files changed, 29 insertions(+), 18 deletions(-) diff --git a/src/portal_visualization/builder_factory.py b/src/portal_visualization/builder_factory.py index 3b0b3a2..23a08d6 100644 --- a/src/portal_visualization/builder_factory.py +++ b/src/portal_visualization/builder_factory.py @@ -26,7 +26,7 @@ # { # "assaytype": "image_pyramid", # "description": "Image Pyramid", -# "vitessce_hints": [ +# "vitessce-hints": [ # "is_image", # "pyramid" # ] @@ -34,13 +34,20 @@ def get_ancestor_assaytypes(entity, get_assaytype): - return [get_assaytype(ancestor.get('uuid')).get('assaytype') + return [get_assaytype(ancestor).get('assaytype') for ancestor in entity.get('immediate_ancestors')] +# +# This function is the main entrypoint for the builder factory. +# It returns the correct builder for the given entity. +# +# The entity is a dict that contains the entity UUID and metadata. +# `get_assaytype` is a function which takes an entity UUID and returns +# the assaytype and vitessce-hints for that entity. def get_view_config_builder(entity, get_assaytype): - assay = get_assaytype(entity.get('uuid')) + assay = get_assaytype(entity) assay_name = assay.get('assaytype') hints = assay.get('vitessce-hints', []) dag_provenance_list = entity.get('metadata', {}).get('dag_provenance_list', []) @@ -48,17 +55,26 @@ def get_view_config_builder(entity, get_assaytype): for dag in dag_provenance_list if 'name' in dag] if "is_image" in hints: if 'sprm' in hints and 'anndata' in hints: + # e.g. CellDIVE [DeepCell + SPRM] + # sample entity: c3be5650e93907b68ddbdb22b948db32 return MultiImageSPRMAnndataViewConfBuilder if "codex" in hints: if ('sprm-to-anndata.cwl' in dag_names): + # e.g. 'CODEX [Cytokit + SPRM] + # sample entity: 43213991a54ce196d406707ffe2e86bd return StitchedCytokitSPRMViewConfBuilder + # Cannot find an example of this in the wild, every CODEX entity has the + # sprm-to-anndata.cwl in its dag_provenance_list return TiledSPRMViewConfBuilder # Check types of image pyramid ancestors to determine which builder to use ancestor_assaytypes = get_ancestor_assaytypes(entity, get_assaytype) + # e.g. c6a254b2dc2ed46b002500ade163a7cc if SEQFISH in [assaytype for assaytype in ancestor_assaytypes]: return SeqFISHViewConfBuilder + # e.g. 3bc3ad124014a632d558255626bf38c9 if MALDI_IMS in [assaytype for assaytype in ancestor_assaytypes]: return IMSViewConfBuilder + # e.g. 6b93107731199733f266bbd0f3bc9747 if NANODESI in [assaytype for assaytype in ancestor_assaytypes]: return NanoDESIViewConfBuilder return ImagePyramidViewConfBuilder @@ -66,11 +82,16 @@ def get_view_config_builder(entity, get_assaytype): # This is the zarr-backed anndata pipeline. if "anndata-to-ui.cwl" in dag_names: if assay_name == SALMON_RNASSEQ_SLIDE: + # e.g. 2a590db3d7ab1e1512816b165d95cdcf return SpatialRNASeqAnnDataZarrViewConfBuilder + # e.g. e65175561b4b17da5352e3837aa0e497 return RNASeqAnnDataZarrViewConfBuilder + # e.g. c019a1cd35aab4d2b4a6ff221e92aaab return RNASeqViewConfBuilder if "atac" in hints: + # e.g. d4493657cde29702c5ed73932da5317c return ATACSeqViewConfBuilder + # any entity with no hints, e.g. 2c2179ea741d3bbb47772172a316a2bf return NullViewConfBuilder diff --git a/test/test_builders.py b/test/test_builders.py index 31d154a..b065b29 100644 --- a/test/test_builders.py +++ b/test/test_builders.py @@ -10,8 +10,6 @@ import pytest import zarr -from hubmap_commons.type_client import TypeClient - from src.portal_visualization.builder_factory import get_view_config_builder, has_visualization @@ -38,18 +36,10 @@ class MockResponse: defaults = json.load((Path(__file__).parent.parent / 'src/defaults.json').open()) - -def get_assay(name): - # This code could also be used in portal-ui. - # search-api might skip the REST interface. - type_client = TypeClient(defaults['types_url']) - return type_client.getAssayType(name) - - + def get_assaytype(uuid): requests.get(f'{defaults["assaytypes_url"]}/{uuid}').json() - @pytest.mark.parametrize( "has_vis_entity", [ @@ -61,7 +51,7 @@ def get_assaytype(uuid): ids=lambda has_vis_entity: f'has_visualization={has_vis_entity[0]}') def test_has_visualization(has_vis_entity): has_vis, entity = has_vis_entity - assert has_vis == has_visualization(entity, get_assay) + assert has_vis == has_visualization(entity, get_assaytype) def mock_zarr_store(entity_path, mocker): @@ -97,7 +87,7 @@ def test_entity_to_vitessce_conf(entity_path, mocker): else None) entity = json.loads(entity_path.read_text()) - Builder = get_view_config_builder(entity, get_assay) + Builder = get_view_config_builder(entity, get_assaytype) assert Builder.__name__ == entity_path.parent.name # Envvars should not be set during normal test runs, @@ -130,7 +120,7 @@ def test_entity_to_error(entity_path, mocker): entity = json.loads(entity_path.read_text()) with pytest.raises(Exception) as error_info: - Builder = get_view_config_builder(entity, get_assay) + Builder = get_view_config_builder(entity, get_assaytype) builder = Builder(entity, 'groups_token', 'https://example.com/') builder.get_conf_cells() actual_error = f'{error_info.type.__name__}: {error_info.value.args[0]}' @@ -157,7 +147,7 @@ def clean_cells(cells): args = parser.parse_args() entity = json.loads(args.input.read_text()) - Builder = get_view_config_builder(entity, get_assay) + Builder = get_view_config_builder(entity, get_assaytype) builder = Builder(entity, 'groups_token', 'https://example.com/') conf, cells = builder.get_conf_cells() From 9d60b6fd68f6f4f99a1688b849ad91df21963309 Mon Sep 17 00:00:00 2001 From: Nikolay Akhmetov Date: Wed, 13 Dec 2023 16:34:45 -0500 Subject: [PATCH 07/19] add fixtures for assaytypes --- .../2a590db3d7ab1e1512816b165d95cdcf.json | 10 ++++++++++ .../2c2179ea741d3bbb47772172a316a2bf.json | 9 +++++++++ .../3bc3ad124014a632d558255626bf38c9.json | 11 +++++++++++ .../43213991a54ce196d406707ffe2e86bd.json | 11 +++++++++++ .../6b93107731199733f266bbd0f3bc9747.json | 9 +++++++++ .../c019a1cd35aab4d2b4a6ff221e92aaab.json | 10 ++++++++++ .../c3be5650e93907b68ddbdb22b948db32.json | 12 ++++++++++++ .../c6a254b2dc2ed46b002500ade163a7cc.json | 9 +++++++++ .../d4493657cde29702c5ed73932da5317c.json | 10 ++++++++++ .../e65175561b4b17da5352e3837aa0e497.json | 10 ++++++++++ test/test_builders.py | 19 ++++++++++++++++--- 11 files changed, 117 insertions(+), 3 deletions(-) create mode 100644 test/assaytype-fixtures/2a590db3d7ab1e1512816b165d95cdcf.json create mode 100644 test/assaytype-fixtures/2c2179ea741d3bbb47772172a316a2bf.json create mode 100644 test/assaytype-fixtures/3bc3ad124014a632d558255626bf38c9.json create mode 100644 test/assaytype-fixtures/43213991a54ce196d406707ffe2e86bd.json create mode 100644 test/assaytype-fixtures/6b93107731199733f266bbd0f3bc9747.json create mode 100644 test/assaytype-fixtures/c019a1cd35aab4d2b4a6ff221e92aaab.json create mode 100644 test/assaytype-fixtures/c3be5650e93907b68ddbdb22b948db32.json create mode 100644 test/assaytype-fixtures/c6a254b2dc2ed46b002500ade163a7cc.json create mode 100644 test/assaytype-fixtures/d4493657cde29702c5ed73932da5317c.json create mode 100644 test/assaytype-fixtures/e65175561b4b17da5352e3837aa0e497.json diff --git a/test/assaytype-fixtures/2a590db3d7ab1e1512816b165d95cdcf.json b/test/assaytype-fixtures/2a590db3d7ab1e1512816b165d95cdcf.json new file mode 100644 index 0000000..7c83925 --- /dev/null +++ b/test/assaytype-fixtures/2a590db3d7ab1e1512816b165d95cdcf.json @@ -0,0 +1,10 @@ +{ + "assaytype": "salmon_rnaseq_slideseq", + "contains-pii": false, + "description": "Slide-seq [Salmon]", + "primary": false, + "vitessce-hints": [ + "is_sc", + "rna" + ] + } \ No newline at end of file diff --git a/test/assaytype-fixtures/2c2179ea741d3bbb47772172a316a2bf.json b/test/assaytype-fixtures/2c2179ea741d3bbb47772172a316a2bf.json new file mode 100644 index 0000000..65875e4 --- /dev/null +++ b/test/assaytype-fixtures/2c2179ea741d3bbb47772172a316a2bf.json @@ -0,0 +1,9 @@ +{ + "assaytype": "bulk-RNA", + "contains-pii": true, + "description": "Bulk RNA-seq", + "dir-schema": "bulkrnaseq-v0", + "primary": true, + "tbl-schema": "bulkrnaseq-v0", + "vitessce-hints": [] + } \ No newline at end of file diff --git a/test/assaytype-fixtures/3bc3ad124014a632d558255626bf38c9.json b/test/assaytype-fixtures/3bc3ad124014a632d558255626bf38c9.json new file mode 100644 index 0000000..5ec9ffb --- /dev/null +++ b/test/assaytype-fixtures/3bc3ad124014a632d558255626bf38c9.json @@ -0,0 +1,11 @@ +{ + "assaytype": "MALDI-IMS", + "contains-pii": false, + "description": "MALDI IMS", + "dir-schema": "ims-v0", + "primary": true, + "tbl-schema": "ims-v2", + "vitessce-hints": [ + "maldi" + ] + } \ No newline at end of file diff --git a/test/assaytype-fixtures/43213991a54ce196d406707ffe2e86bd.json b/test/assaytype-fixtures/43213991a54ce196d406707ffe2e86bd.json new file mode 100644 index 0000000..c0398c4 --- /dev/null +++ b/test/assaytype-fixtures/43213991a54ce196d406707ffe2e86bd.json @@ -0,0 +1,11 @@ +{ + "assaytype": "codex_cytokit_v1", + "contains-pii": false, + "description": "CODEX [Cytokit + SPRM]", + "primary": false, + "vitessce-hints": [ + "codex", + "is_image", + "is_tiled" + ] +} \ No newline at end of file diff --git a/test/assaytype-fixtures/6b93107731199733f266bbd0f3bc9747.json b/test/assaytype-fixtures/6b93107731199733f266bbd0f3bc9747.json new file mode 100644 index 0000000..3dc9a01 --- /dev/null +++ b/test/assaytype-fixtures/6b93107731199733f266bbd0f3bc9747.json @@ -0,0 +1,9 @@ +{ + "assaytype": "NanoDESI", + "contains-pii": false, + "description": "NanoDESI", + "dir-schema": "ims-v0", + "primary": true, + "tbl-schema": "ims-v2", + "vitessce-hints": [] +} \ No newline at end of file diff --git a/test/assaytype-fixtures/c019a1cd35aab4d2b4a6ff221e92aaab.json b/test/assaytype-fixtures/c019a1cd35aab4d2b4a6ff221e92aaab.json new file mode 100644 index 0000000..b5ecda7 --- /dev/null +++ b/test/assaytype-fixtures/c019a1cd35aab4d2b4a6ff221e92aaab.json @@ -0,0 +1,10 @@ +{ + "assaytype": "salmon_sn_rnaseq_10x", + "contains-pii": false, + "description": "snRNA-seq [Salmon]", + "primary": false, + "vitessce-hints": [ + "is_sc", + "rna" + ] + } \ No newline at end of file diff --git a/test/assaytype-fixtures/c3be5650e93907b68ddbdb22b948db32.json b/test/assaytype-fixtures/c3be5650e93907b68ddbdb22b948db32.json new file mode 100644 index 0000000..5cd7eed --- /dev/null +++ b/test/assaytype-fixtures/c3be5650e93907b68ddbdb22b948db32.json @@ -0,0 +1,12 @@ +{ + "assaytype": "celldive_deepcell", + "contains-pii": false, + "description": "CellDIVE [DeepCell + SPRM]", + "primary": false, + "vitessce-hints": [ + "sprm", + "anndata", + "is_image", + "is_tiled" + ] + } \ No newline at end of file diff --git a/test/assaytype-fixtures/c6a254b2dc2ed46b002500ade163a7cc.json b/test/assaytype-fixtures/c6a254b2dc2ed46b002500ade163a7cc.json new file mode 100644 index 0000000..7269a62 --- /dev/null +++ b/test/assaytype-fixtures/c6a254b2dc2ed46b002500ade163a7cc.json @@ -0,0 +1,9 @@ +{ + "assaytype": "seqFish", + "contains-pii": false, + "description": "seqFISH", + "dir-schema": "seqfish-v0", + "primary": true, + "tbl-schema": "seqfish-v0", + "vitessce-hints": [] + } \ No newline at end of file diff --git a/test/assaytype-fixtures/d4493657cde29702c5ed73932da5317c.json b/test/assaytype-fixtures/d4493657cde29702c5ed73932da5317c.json new file mode 100644 index 0000000..f924f64 --- /dev/null +++ b/test/assaytype-fixtures/d4493657cde29702c5ed73932da5317c.json @@ -0,0 +1,10 @@ +{ + "assaytype": "sc_atac_seq_sci", + "contains-pii": false, + "description": "sciATAC-seq [SnapATAC]", + "primary": false, + "vitessce-hints": [ + "is_sc", + "atac" + ] + } \ No newline at end of file diff --git a/test/assaytype-fixtures/e65175561b4b17da5352e3837aa0e497.json b/test/assaytype-fixtures/e65175561b4b17da5352e3837aa0e497.json new file mode 100644 index 0000000..b5ecda7 --- /dev/null +++ b/test/assaytype-fixtures/e65175561b4b17da5352e3837aa0e497.json @@ -0,0 +1,10 @@ +{ + "assaytype": "salmon_sn_rnaseq_10x", + "contains-pii": false, + "description": "snRNA-seq [Salmon]", + "primary": false, + "vitessce-hints": [ + "is_sc", + "rna" + ] + } \ No newline at end of file diff --git a/test/test_builders.py b/test/test_builders.py index b065b29..bbc59d7 100644 --- a/test/test_builders.py +++ b/test/test_builders.py @@ -34,11 +34,24 @@ class MockResponse: bad_entity_paths = list((Path(__file__).parent / 'bad-fixtures').glob("*-entity.json")) assert len(bad_entity_paths) > 0 +assaytypes_path = Path(__file__).parent / 'assaytypes' +assert assaytypes_path.is_dir() + defaults = json.load((Path(__file__).parent.parent / 'src/defaults.json').open()) - -def get_assaytype(uuid): - requests.get(f'{defaults["assaytypes_url"]}/{uuid}').json() +default_assaytype = { + 'assaytype': 'Null', + 'vitessce-hints': [], +} + +def get_assaytype(entity): + uuid = entity.get('uuid') + if uuid is None: + return default_assaytype + assay = json.loads(assaytypes_path.joinpath(f'{uuid}.json')) + if assay is None: + return default_assaytype + return assay @pytest.mark.parametrize( "has_vis_entity", From 22247e9090e70292025835629957210c8055f146 Mon Sep 17 00:00:00 2001 From: Nikolay Akhmetov Date: Wed, 13 Dec 2023 16:58:02 -0500 Subject: [PATCH 08/19] update fixtures to UUID's from comments in builder factory --- src/portal_visualization/builder_factory.py | 1 + .../04e7385339167e541ad42a2636e18398.json | 11 ++++++++++ .../ea4cfecb8495b36694d9a951510dc3c6.json | 10 ++++++++++ .../f9ae931b8b49252f150d7f8bf1d2d13f.json | 10 ++++++++++ .../ATACSeqViewConfBuilder/fake-conf.json | 8 ++++---- .../ATACSeqViewConfBuilder/fake-entity.json | 2 +- .../IMSViewConfBuilder/fake-conf.json | 4 ++-- .../IMSViewConfBuilder/fake-entity.json | 2 +- .../fake-marker=gene123-conf.json | 20 +++++++++---------- .../fake-marker=gene123-entity.json | 2 +- .../NanoDESIViewConfBuilder/fake-conf.json | 4 ++-- .../NanoDESIViewConfBuilder/fake-entity.json | 2 +- .../NullViewConfBuilder/empty-entity.json | 3 ++- ...fake-asct-is-annotated-published-conf.json | 6 +++--- ...ke-asct-is-annotated-published-entity.json | 2 +- .../fake-asct-is-annotated-qa-conf.json | 6 +++--- .../fake-asct-is-annotated-qa-entity.json | 2 +- .../fake-is-not-annotated-published-conf.json | 6 +++--- ...ake-is-not-annotated-published-entity.json | 2 +- .../fake-is-not-annotated-qa-conf.json | 6 +++--- .../fake-is-not-annotated-qa-entity.json | 2 +- ...ted-label-is-annotated-published-conf.json | 6 +++--- ...d-label-is-annotated-published-entity.json | 2 +- ...-predicted-label-is-annotated-qa-conf.json | 6 +++--- ...redicted-label-is-annotated-qa-entity.json | 2 +- .../RNASeqViewConfBuilder/fake-conf.json | 8 ++++---- .../RNASeqViewConfBuilder/fake-entity.json | 2 +- .../SeqFISHViewConfBuilder/fake-conf.json | 16 +++++++-------- .../SeqFISHViewConfBuilder/fake-entity.json | 2 +- .../no-cells-conf.json | 4 ++-- .../no-cells-entity.json | 2 +- .../with-cells-conf.json | 10 +++++----- .../with-cells-entity.json | 2 +- test/test_builders.py | 2 +- 34 files changed, 104 insertions(+), 71 deletions(-) create mode 100644 test/assaytype-fixtures/04e7385339167e541ad42a2636e18398.json create mode 100644 test/assaytype-fixtures/ea4cfecb8495b36694d9a951510dc3c6.json create mode 100644 test/assaytype-fixtures/f9ae931b8b49252f150d7f8bf1d2d13f.json diff --git a/src/portal_visualization/builder_factory.py b/src/portal_visualization/builder_factory.py index 23a08d6..7cf6f8e 100644 --- a/src/portal_visualization/builder_factory.py +++ b/src/portal_visualization/builder_factory.py @@ -77,6 +77,7 @@ def get_view_config_builder(entity, get_assaytype): # e.g. 6b93107731199733f266bbd0f3bc9747 if NANODESI in [assaytype for assaytype in ancestor_assaytypes]: return NanoDESIViewConfBuilder + # e.g. f9ae931b8b49252f150d7f8bf1d2d13f return ImagePyramidViewConfBuilder if "rna" in hints: # This is the zarr-backed anndata pipeline. diff --git a/test/assaytype-fixtures/04e7385339167e541ad42a2636e18398.json b/test/assaytype-fixtures/04e7385339167e541ad42a2636e18398.json new file mode 100644 index 0000000..a90bf37 --- /dev/null +++ b/test/assaytype-fixtures/04e7385339167e541ad42a2636e18398.json @@ -0,0 +1,11 @@ +{ + "assaytype": "codex_cytokit_v1", + "contains-pii": false, + "description": "CODEX [Cytokit + SPRM]", + "primary": false, + "vitessce-hints": [ + "codex", + "is_image", + "is_tiled" + ] + } \ No newline at end of file diff --git a/test/assaytype-fixtures/ea4cfecb8495b36694d9a951510dc3c6.json b/test/assaytype-fixtures/ea4cfecb8495b36694d9a951510dc3c6.json new file mode 100644 index 0000000..7c83925 --- /dev/null +++ b/test/assaytype-fixtures/ea4cfecb8495b36694d9a951510dc3c6.json @@ -0,0 +1,10 @@ +{ + "assaytype": "salmon_rnaseq_slideseq", + "contains-pii": false, + "description": "Slide-seq [Salmon]", + "primary": false, + "vitessce-hints": [ + "is_sc", + "rna" + ] + } \ No newline at end of file diff --git a/test/assaytype-fixtures/f9ae931b8b49252f150d7f8bf1d2d13f.json b/test/assaytype-fixtures/f9ae931b8b49252f150d7f8bf1d2d13f.json new file mode 100644 index 0000000..98dc749 --- /dev/null +++ b/test/assaytype-fixtures/f9ae931b8b49252f150d7f8bf1d2d13f.json @@ -0,0 +1,10 @@ +{ + "assaytype": "image_pyramid", + "contains-pii": false, + "description": "Image Pyramid", + "primary": false, + "vitessce-hints": [ + "is_image", + "pyramid" + ] + } \ No newline at end of file diff --git a/test/good-fixtures/ATACSeqViewConfBuilder/fake-conf.json b/test/good-fixtures/ATACSeqViewConfBuilder/fake-conf.json index 9125afe..f751076 100644 --- a/test/good-fixtures/ATACSeqViewConfBuilder/fake-conf.json +++ b/test/good-fixtures/ATACSeqViewConfBuilder/fake-conf.json @@ -15,14 +15,14 @@ "obsType": "cell" }, "fileType": "obsSegmentations.cells.json", - "url": "https://example.com/210d118a14c8624b6bb9610a9062656e/output/umap_coords_clusters.cells.json?token=groups_token" + "url": "https://example.com/d4493657cde29702c5ed73932da5317c/output/umap_coords_clusters.cells.json?token=groups_token" }, { "coordinationValues": { "obsType": "cell" }, "fileType": "obsLocations.cells.json", - "url": "https://example.com/210d118a14c8624b6bb9610a9062656e/output/umap_coords_clusters.cells.json?token=groups_token" + "url": "https://example.com/d4493657cde29702c5ed73932da5317c/output/umap_coords_clusters.cells.json?token=groups_token" }, { "coordinationValues": { @@ -30,14 +30,14 @@ "obsType": "cell" }, "fileType": "obsEmbedding.cells.json", - "url": "https://example.com/210d118a14c8624b6bb9610a9062656e/output/umap_coords_clusters.cells.json?token=groups_token" + "url": "https://example.com/d4493657cde29702c5ed73932da5317c/output/umap_coords_clusters.cells.json?token=groups_token" }, { "coordinationValues": { "obsType": "cell" }, "fileType": "obsSets.cell-sets.json", - "url": "https://example.com/210d118a14c8624b6bb9610a9062656e/output/umap_coords_clusters.cell-sets.json?token=groups_token" + "url": "https://example.com/d4493657cde29702c5ed73932da5317c/output/umap_coords_clusters.cell-sets.json?token=groups_token" } ], "name": "Visualization Files", diff --git a/test/good-fixtures/ATACSeqViewConfBuilder/fake-entity.json b/test/good-fixtures/ATACSeqViewConfBuilder/fake-entity.json index ef8df4e..fed0ed5 100644 --- a/test/good-fixtures/ATACSeqViewConfBuilder/fake-entity.json +++ b/test/good-fixtures/ATACSeqViewConfBuilder/fake-entity.json @@ -86,6 +86,6 @@ "rel_path": "umap_coords_clusters.csv" } ], - "uuid": "210d118a14c8624b6bb9610a9062656e", + "uuid": "d4493657cde29702c5ed73932da5317c", "metadata": {"dag_provenance_list": []} } \ No newline at end of file diff --git a/test/good-fixtures/IMSViewConfBuilder/fake-conf.json b/test/good-fixtures/IMSViewConfBuilder/fake-conf.json index 32c9ef9..86577ad 100644 --- a/test/good-fixtures/IMSViewConfBuilder/fake-conf.json +++ b/test/good-fixtures/IMSViewConfBuilder/fake-conf.json @@ -14,11 +14,11 @@ { "metadata": { "isBitmask": false, - "omeTiffOffsetsUrl": "https://example.com/954281e9fd8732adfa4479e0d238ce8d/output_offsets/ometiffs/VAN0003-LK-32-21-IMS_NegMode_multilayer.offsets.json?token=groups_token" + "omeTiffOffsetsUrl": "https://example.com/3bc3ad124014a632d558255626bf38c9/output_offsets/ometiffs/VAN0003-LK-32-21-IMS_NegMode_multilayer.offsets.json?token=groups_token" }, "name": "VAN0003-LK-32-21-IMS_NegMode_multilayer.ome.tif", "type": "ome-tiff", - "url": "https://example.com/954281e9fd8732adfa4479e0d238ce8d/ometiff-pyramids/ometiffs/VAN0003-LK-32-21-IMS_NegMode_multilayer.ome.tif?token=groups_token" + "url": "https://example.com/3bc3ad124014a632d558255626bf38c9/ometiff-pyramids/ometiffs/VAN0003-LK-32-21-IMS_NegMode_multilayer.ome.tif?token=groups_token" } ], "schemaVersion": "0.0.2", diff --git a/test/good-fixtures/IMSViewConfBuilder/fake-entity.json b/test/good-fixtures/IMSViewConfBuilder/fake-entity.json index 33de1c1..95559ea 100644 --- a/test/good-fixtures/IMSViewConfBuilder/fake-entity.json +++ b/test/good-fixtures/IMSViewConfBuilder/fake-entity.json @@ -29,6 +29,6 @@ "rel_path": "output_offsets/ometiffs/VAN0003-LK-32-21-IMS_NegMode_multilayer.offsets.json" } ], - "uuid": "954281e9fd8732adfa4479e0d238ce8d", + "uuid": "3bc3ad124014a632d558255626bf38c9", "metadata": {"dag_provenance_list": []} } \ No newline at end of file diff --git a/test/good-fixtures/MultiImageSPRMAnndataViewConfBuilder/fake-marker=gene123-conf.json b/test/good-fixtures/MultiImageSPRMAnndataViewConfBuilder/fake-marker=gene123-conf.json index 5924ee3..3915bc4 100644 --- a/test/good-fixtures/MultiImageSPRMAnndataViewConfBuilder/fake-marker=gene123-conf.json +++ b/test/good-fixtures/MultiImageSPRMAnndataViewConfBuilder/fake-marker=gene123-conf.json @@ -69,7 +69,7 @@ "Authorization": "Bearer groups_token" } }, - "url": "https://example.com/2f8d43199ca3167e991b320038024b77/anndata-zarr/reg001_S20030085_region_001_expr-anndata.zarr" + "url": "https://example.com/c3be5650e93907b68ddbdb22b948db32/anndata-zarr/reg001_S20030085_region_001_expr-anndata.zarr" }, { "fileType": "raster.json", @@ -78,20 +78,20 @@ { "metadata": { "isBitmask": false, - "omeTiffOffsetsUrl": "https://example.com/2f8d43199ca3167e991b320038024b77/output_offsets/pipeline_output/expr/reg001_S20030085_region_001_expr.offsets.json?token=groups_token" + "omeTiffOffsetsUrl": "https://example.com/c3be5650e93907b68ddbdb22b948db32/output_offsets/pipeline_output/expr/reg001_S20030085_region_001_expr.offsets.json?token=groups_token" }, "name": "reg001_S20030085_region_001_expr", "type": "ome-tiff", - "url": "https://example.com/2f8d43199ca3167e991b320038024b77/ometiff-pyramids/pipeline_output/expr/reg001_S20030085_region_001_expr.ome.tif?token=groups_token" + "url": "https://example.com/c3be5650e93907b68ddbdb22b948db32/ometiff-pyramids/pipeline_output/expr/reg001_S20030085_region_001_expr.ome.tif?token=groups_token" }, { "metadata": { "isBitmask": true, - "omeTiffOffsetsUrl": "https://example.com/2f8d43199ca3167e991b320038024b77/output_offsets/pipeline_output/mask/reg001_S20030085_region_001_mask.offsets.json?token=groups_token" + "omeTiffOffsetsUrl": "https://example.com/c3be5650e93907b68ddbdb22b948db32/output_offsets/pipeline_output/mask/reg001_S20030085_region_001_mask.offsets.json?token=groups_token" }, "name": "reg001_S20030085_region_001_mask", "type": "ome-tiff", - "url": "https://example.com/2f8d43199ca3167e991b320038024b77/ometiff-pyramids/pipeline_output/mask/reg001_S20030085_region_001_mask.ome.tif?token=groups_token" + "url": "https://example.com/c3be5650e93907b68ddbdb22b948db32/ometiff-pyramids/pipeline_output/mask/reg001_S20030085_region_001_mask.ome.tif?token=groups_token" } ], "renderLayers": [ @@ -276,7 +276,7 @@ "Authorization": "Bearer groups_token" } }, - "url": "https://example.com/2f8d43199ca3167e991b320038024b77/anndata-zarr/reg001_S20030086_region_001_expr-anndata.zarr" + "url": "https://example.com/c3be5650e93907b68ddbdb22b948db32/anndata-zarr/reg001_S20030086_region_001_expr-anndata.zarr" }, { "fileType": "raster.json", @@ -285,20 +285,20 @@ { "metadata": { "isBitmask": false, - "omeTiffOffsetsUrl": "https://example.com/2f8d43199ca3167e991b320038024b77/output_offsets/pipeline_output/expr/reg001_S20030086_region_001_expr.offsets.json?token=groups_token" + "omeTiffOffsetsUrl": "https://example.com/c3be5650e93907b68ddbdb22b948db32/output_offsets/pipeline_output/expr/reg001_S20030086_region_001_expr.offsets.json?token=groups_token" }, "name": "reg001_S20030086_region_001_expr", "type": "ome-tiff", - "url": "https://example.com/2f8d43199ca3167e991b320038024b77/ometiff-pyramids/pipeline_output/expr/reg001_S20030086_region_001_expr.ome.tif?token=groups_token" + "url": "https://example.com/c3be5650e93907b68ddbdb22b948db32/ometiff-pyramids/pipeline_output/expr/reg001_S20030086_region_001_expr.ome.tif?token=groups_token" }, { "metadata": { "isBitmask": true, - "omeTiffOffsetsUrl": "https://example.com/2f8d43199ca3167e991b320038024b77/output_offsets/pipeline_output/mask/reg001_S20030086_region_001_mask.offsets.json?token=groups_token" + "omeTiffOffsetsUrl": "https://example.com/c3be5650e93907b68ddbdb22b948db32/output_offsets/pipeline_output/mask/reg001_S20030086_region_001_mask.offsets.json?token=groups_token" }, "name": "reg001_S20030086_region_001_mask", "type": "ome-tiff", - "url": "https://example.com/2f8d43199ca3167e991b320038024b77/ometiff-pyramids/pipeline_output/mask/reg001_S20030086_region_001_mask.ome.tif?token=groups_token" + "url": "https://example.com/c3be5650e93907b68ddbdb22b948db32/ometiff-pyramids/pipeline_output/mask/reg001_S20030086_region_001_mask.ome.tif?token=groups_token" } ], "renderLayers": [ diff --git a/test/good-fixtures/MultiImageSPRMAnndataViewConfBuilder/fake-marker=gene123-entity.json b/test/good-fixtures/MultiImageSPRMAnndataViewConfBuilder/fake-marker=gene123-entity.json index 0dd73b7..6d6c32d 100644 --- a/test/good-fixtures/MultiImageSPRMAnndataViewConfBuilder/fake-marker=gene123-entity.json +++ b/test/good-fixtures/MultiImageSPRMAnndataViewConfBuilder/fake-marker=gene123-entity.json @@ -55,5 +55,5 @@ } ], "status": "QA", - "uuid": "2f8d43199ca3167e991b320038024b77" + "uuid": "c3be5650e93907b68ddbdb22b948db32" } \ No newline at end of file diff --git a/test/good-fixtures/NanoDESIViewConfBuilder/fake-conf.json b/test/good-fixtures/NanoDESIViewConfBuilder/fake-conf.json index 6015b81..180c3cc 100644 --- a/test/good-fixtures/NanoDESIViewConfBuilder/fake-conf.json +++ b/test/good-fixtures/NanoDESIViewConfBuilder/fake-conf.json @@ -14,11 +14,11 @@ { "metadata": { "isBitmask": false, - "omeTiffOffsetsUrl": "https://example.com/954281e9fd8732adfa4479e0d238ce8d/output_offsets/ometiffs/VAN0003-LK-32-21-IMS_NegMode_multilayer.offsets.json?token=groups_token" + "omeTiffOffsetsUrl": "https://example.com/6b93107731199733f266bbd0f3bc9747/output_offsets/ometiffs/VAN0003-LK-32-21-IMS_NegMode_multilayer.offsets.json?token=groups_token" }, "name": "VAN0003-LK-32-21-IMS_NegMode_multilayer.ome.tif", "type": "ome-tiff", - "url": "https://example.com/954281e9fd8732adfa4479e0d238ce8d/ometiff-pyramids/ometiffs/VAN0003-LK-32-21-IMS_NegMode_multilayer.ome.tif?token=groups_token" + "url": "https://example.com/6b93107731199733f266bbd0f3bc9747/ometiff-pyramids/ometiffs/VAN0003-LK-32-21-IMS_NegMode_multilayer.ome.tif?token=groups_token" } ], "schemaVersion": "0.0.2", diff --git a/test/good-fixtures/NanoDESIViewConfBuilder/fake-entity.json b/test/good-fixtures/NanoDESIViewConfBuilder/fake-entity.json index 1533deb..7e70e0e 100644 --- a/test/good-fixtures/NanoDESIViewConfBuilder/fake-entity.json +++ b/test/good-fixtures/NanoDESIViewConfBuilder/fake-entity.json @@ -16,6 +16,6 @@ "rel_path": "output_offsets/ometiffs/VAN0003-LK-32-21-IMS_NegMode_multilayer.offsets.json" } ], - "uuid": "954281e9fd8732adfa4479e0d238ce8d", + "uuid": "6b93107731199733f266bbd0f3bc9747", "metadata": {"dag_provenance_list": []} } \ No newline at end of file diff --git a/test/good-fixtures/NullViewConfBuilder/empty-entity.json b/test/good-fixtures/NullViewConfBuilder/empty-entity.json index 1dce765..1d80e2c 100644 --- a/test/good-fixtures/NullViewConfBuilder/empty-entity.json +++ b/test/good-fixtures/NullViewConfBuilder/empty-entity.json @@ -1,4 +1,5 @@ { "data_types": [], - "metadata": {"dag_provenance_list": []} + "metadata": {"dag_provenance_list": []}, + "uuid": "2c2179ea741d3bbb47772172a316a2bf" } \ No newline at end of file diff --git a/test/good-fixtures/RNASeqAnnDataZarrViewConfBuilder/fake-asct-is-annotated-published-conf.json b/test/good-fixtures/RNASeqAnnDataZarrViewConfBuilder/fake-asct-is-annotated-published-conf.json index ecd0096..672f960 100644 --- a/test/good-fixtures/RNASeqAnnDataZarrViewConfBuilder/fake-asct-is-annotated-published-conf.json +++ b/test/good-fixtures/RNASeqAnnDataZarrViewConfBuilder/fake-asct-is-annotated-published-conf.json @@ -67,10 +67,10 @@ } ] }, - "url": "https://example.com/503f9caeffb9ee1e1324793c977d2342/hubmap_ui/anndata-zarr/secondary_analysis.zarr" + "url": "https://example.com/e65175561b4b17da5352e3837aa0e497/hubmap_ui/anndata-zarr/secondary_analysis.zarr" } ], - "name": "503f9caeffb9ee1e1324793c977d2342", + "name": "e65175561b4b17da5352e3837aa0e497", "uid": "A" } ], @@ -164,6 +164,6 @@ "y": 6 } ], - "name": "503f9caeffb9ee1e1324793c977d2342", + "name": "e65175561b4b17da5352e3837aa0e497", "version": "1.0.15" } \ No newline at end of file diff --git a/test/good-fixtures/RNASeqAnnDataZarrViewConfBuilder/fake-asct-is-annotated-published-entity.json b/test/good-fixtures/RNASeqAnnDataZarrViewConfBuilder/fake-asct-is-annotated-published-entity.json index cebe17d..2d83af4 100644 --- a/test/good-fixtures/RNASeqAnnDataZarrViewConfBuilder/fake-asct-is-annotated-published-entity.json +++ b/test/good-fixtures/RNASeqAnnDataZarrViewConfBuilder/fake-asct-is-annotated-published-entity.json @@ -21,5 +21,5 @@ ] }, "status": "Published", - "uuid": "503f9caeffb9ee1e1324793c977d2342" + "uuid": "e65175561b4b17da5352e3837aa0e497" } diff --git a/test/good-fixtures/RNASeqAnnDataZarrViewConfBuilder/fake-asct-is-annotated-qa-conf.json b/test/good-fixtures/RNASeqAnnDataZarrViewConfBuilder/fake-asct-is-annotated-qa-conf.json index 1292244..84a5ad7 100644 --- a/test/good-fixtures/RNASeqAnnDataZarrViewConfBuilder/fake-asct-is-annotated-qa-conf.json +++ b/test/good-fixtures/RNASeqAnnDataZarrViewConfBuilder/fake-asct-is-annotated-qa-conf.json @@ -72,10 +72,10 @@ "Authorization": "Bearer groups_token" } }, - "url": "https://example.com/503f9caeffb9ee1e1324793c977d2342/hubmap_ui/anndata-zarr/secondary_analysis.zarr" + "url": "https://example.com/e65175561b4b17da5352e3837aa0e497/hubmap_ui/anndata-zarr/secondary_analysis.zarr" } ], - "name": "503f9caeffb9ee1e1324793c977d2342", + "name": "e65175561b4b17da5352e3837aa0e497", "uid": "A" } ], @@ -169,6 +169,6 @@ "y": 6 } ], - "name": "503f9caeffb9ee1e1324793c977d2342", + "name": "e65175561b4b17da5352e3837aa0e497", "version": "1.0.15" } \ No newline at end of file diff --git a/test/good-fixtures/RNASeqAnnDataZarrViewConfBuilder/fake-asct-is-annotated-qa-entity.json b/test/good-fixtures/RNASeqAnnDataZarrViewConfBuilder/fake-asct-is-annotated-qa-entity.json index 8bdf23c..ef45960 100644 --- a/test/good-fixtures/RNASeqAnnDataZarrViewConfBuilder/fake-asct-is-annotated-qa-entity.json +++ b/test/good-fixtures/RNASeqAnnDataZarrViewConfBuilder/fake-asct-is-annotated-qa-entity.json @@ -21,5 +21,5 @@ ] }, "status": "QA", - "uuid": "503f9caeffb9ee1e1324793c977d2342" + "uuid": "e65175561b4b17da5352e3837aa0e497" } diff --git a/test/good-fixtures/RNASeqAnnDataZarrViewConfBuilder/fake-is-not-annotated-published-conf.json b/test/good-fixtures/RNASeqAnnDataZarrViewConfBuilder/fake-is-not-annotated-published-conf.json index df00630..545ee44 100644 --- a/test/good-fixtures/RNASeqAnnDataZarrViewConfBuilder/fake-is-not-annotated-published-conf.json +++ b/test/good-fixtures/RNASeqAnnDataZarrViewConfBuilder/fake-is-not-annotated-published-conf.json @@ -63,10 +63,10 @@ } ] }, - "url": "https://example.com/503f9caeffb9ee1e1324793c977d2342/hubmap_ui/anndata-zarr/secondary_analysis.zarr" + "url": "https://example.com/e65175561b4b17da5352e3837aa0e497/hubmap_ui/anndata-zarr/secondary_analysis.zarr" } ], - "name": "503f9caeffb9ee1e1324793c977d2342", + "name": "e65175561b4b17da5352e3837aa0e497", "uid": "A" } ], @@ -160,6 +160,6 @@ "y": 6 } ], - "name": "503f9caeffb9ee1e1324793c977d2342", + "name": "e65175561b4b17da5352e3837aa0e497", "version": "1.0.15" } \ No newline at end of file diff --git a/test/good-fixtures/RNASeqAnnDataZarrViewConfBuilder/fake-is-not-annotated-published-entity.json b/test/good-fixtures/RNASeqAnnDataZarrViewConfBuilder/fake-is-not-annotated-published-entity.json index cebe17d..2d83af4 100644 --- a/test/good-fixtures/RNASeqAnnDataZarrViewConfBuilder/fake-is-not-annotated-published-entity.json +++ b/test/good-fixtures/RNASeqAnnDataZarrViewConfBuilder/fake-is-not-annotated-published-entity.json @@ -21,5 +21,5 @@ ] }, "status": "Published", - "uuid": "503f9caeffb9ee1e1324793c977d2342" + "uuid": "e65175561b4b17da5352e3837aa0e497" } diff --git a/test/good-fixtures/RNASeqAnnDataZarrViewConfBuilder/fake-is-not-annotated-qa-conf.json b/test/good-fixtures/RNASeqAnnDataZarrViewConfBuilder/fake-is-not-annotated-qa-conf.json index c92bef1..4cdb66f 100644 --- a/test/good-fixtures/RNASeqAnnDataZarrViewConfBuilder/fake-is-not-annotated-qa-conf.json +++ b/test/good-fixtures/RNASeqAnnDataZarrViewConfBuilder/fake-is-not-annotated-qa-conf.json @@ -68,10 +68,10 @@ "Authorization": "Bearer groups_token" } }, - "url": "https://example.com/503f9caeffb9ee1e1324793c977d2342/hubmap_ui/anndata-zarr/secondary_analysis.zarr" + "url": "https://example.com/e65175561b4b17da5352e3837aa0e497/hubmap_ui/anndata-zarr/secondary_analysis.zarr" } ], - "name": "503f9caeffb9ee1e1324793c977d2342", + "name": "e65175561b4b17da5352e3837aa0e497", "uid": "A" } ], @@ -165,6 +165,6 @@ "y": 6 } ], - "name": "503f9caeffb9ee1e1324793c977d2342", + "name": "e65175561b4b17da5352e3837aa0e497", "version": "1.0.15" } \ No newline at end of file diff --git a/test/good-fixtures/RNASeqAnnDataZarrViewConfBuilder/fake-is-not-annotated-qa-entity.json b/test/good-fixtures/RNASeqAnnDataZarrViewConfBuilder/fake-is-not-annotated-qa-entity.json index 8bdf23c..ef45960 100644 --- a/test/good-fixtures/RNASeqAnnDataZarrViewConfBuilder/fake-is-not-annotated-qa-entity.json +++ b/test/good-fixtures/RNASeqAnnDataZarrViewConfBuilder/fake-is-not-annotated-qa-entity.json @@ -21,5 +21,5 @@ ] }, "status": "QA", - "uuid": "503f9caeffb9ee1e1324793c977d2342" + "uuid": "e65175561b4b17da5352e3837aa0e497" } diff --git a/test/good-fixtures/RNASeqAnnDataZarrViewConfBuilder/fake-predicted-label-is-annotated-published-conf.json b/test/good-fixtures/RNASeqAnnDataZarrViewConfBuilder/fake-predicted-label-is-annotated-published-conf.json index 812be12..ae37109 100644 --- a/test/good-fixtures/RNASeqAnnDataZarrViewConfBuilder/fake-predicted-label-is-annotated-published-conf.json +++ b/test/good-fixtures/RNASeqAnnDataZarrViewConfBuilder/fake-predicted-label-is-annotated-published-conf.json @@ -67,10 +67,10 @@ } ] }, - "url": "https://example.com/503f9caeffb9ee1e1324793c977d2342/hubmap_ui/anndata-zarr/secondary_analysis.zarr" + "url": "https://example.com/e65175561b4b17da5352e3837aa0e497/hubmap_ui/anndata-zarr/secondary_analysis.zarr" } ], - "name": "503f9caeffb9ee1e1324793c977d2342", + "name": "e65175561b4b17da5352e3837aa0e497", "uid": "A" } ], @@ -164,6 +164,6 @@ "y": 6 } ], - "name": "503f9caeffb9ee1e1324793c977d2342", + "name": "e65175561b4b17da5352e3837aa0e497", "version": "1.0.15" } \ No newline at end of file diff --git a/test/good-fixtures/RNASeqAnnDataZarrViewConfBuilder/fake-predicted-label-is-annotated-published-entity.json b/test/good-fixtures/RNASeqAnnDataZarrViewConfBuilder/fake-predicted-label-is-annotated-published-entity.json index cebe17d..2d83af4 100644 --- a/test/good-fixtures/RNASeqAnnDataZarrViewConfBuilder/fake-predicted-label-is-annotated-published-entity.json +++ b/test/good-fixtures/RNASeqAnnDataZarrViewConfBuilder/fake-predicted-label-is-annotated-published-entity.json @@ -21,5 +21,5 @@ ] }, "status": "Published", - "uuid": "503f9caeffb9ee1e1324793c977d2342" + "uuid": "e65175561b4b17da5352e3837aa0e497" } diff --git a/test/good-fixtures/RNASeqAnnDataZarrViewConfBuilder/fake-predicted-label-is-annotated-qa-conf.json b/test/good-fixtures/RNASeqAnnDataZarrViewConfBuilder/fake-predicted-label-is-annotated-qa-conf.json index f8e8f0b..4a9e6ec 100644 --- a/test/good-fixtures/RNASeqAnnDataZarrViewConfBuilder/fake-predicted-label-is-annotated-qa-conf.json +++ b/test/good-fixtures/RNASeqAnnDataZarrViewConfBuilder/fake-predicted-label-is-annotated-qa-conf.json @@ -72,10 +72,10 @@ "Authorization": "Bearer groups_token" } }, - "url": "https://example.com/503f9caeffb9ee1e1324793c977d2342/hubmap_ui/anndata-zarr/secondary_analysis.zarr" + "url": "https://example.com/e65175561b4b17da5352e3837aa0e497/hubmap_ui/anndata-zarr/secondary_analysis.zarr" } ], - "name": "503f9caeffb9ee1e1324793c977d2342", + "name": "e65175561b4b17da5352e3837aa0e497", "uid": "A" } ], @@ -169,6 +169,6 @@ "y": 6 } ], - "name": "503f9caeffb9ee1e1324793c977d2342", + "name": "e65175561b4b17da5352e3837aa0e497", "version": "1.0.15" } \ No newline at end of file diff --git a/test/good-fixtures/RNASeqAnnDataZarrViewConfBuilder/fake-predicted-label-is-annotated-qa-entity.json b/test/good-fixtures/RNASeqAnnDataZarrViewConfBuilder/fake-predicted-label-is-annotated-qa-entity.json index 8bdf23c..ef45960 100644 --- a/test/good-fixtures/RNASeqAnnDataZarrViewConfBuilder/fake-predicted-label-is-annotated-qa-entity.json +++ b/test/good-fixtures/RNASeqAnnDataZarrViewConfBuilder/fake-predicted-label-is-annotated-qa-entity.json @@ -21,5 +21,5 @@ ] }, "status": "QA", - "uuid": "503f9caeffb9ee1e1324793c977d2342" + "uuid": "e65175561b4b17da5352e3837aa0e497" } diff --git a/test/good-fixtures/RNASeqViewConfBuilder/fake-conf.json b/test/good-fixtures/RNASeqViewConfBuilder/fake-conf.json index c7c5157..0daaeb4 100644 --- a/test/good-fixtures/RNASeqViewConfBuilder/fake-conf.json +++ b/test/good-fixtures/RNASeqViewConfBuilder/fake-conf.json @@ -15,14 +15,14 @@ "obsType": "cell" }, "fileType": "obsSegmentations.cells.json", - "url": "https://example.com/based on ea4cfecb8495b36694d9a951510dc3c6/cluster-marker-genes/output/cluster_marker_genes.cells.json?token=groups_token" + "url": "https://example.com/c019a1cd35aab4d2b4a6ff221e92aaab/cluster-marker-genes/output/cluster_marker_genes.cells.json?token=groups_token" }, { "coordinationValues": { "obsType": "cell" }, "fileType": "obsLocations.cells.json", - "url": "https://example.com/based on ea4cfecb8495b36694d9a951510dc3c6/cluster-marker-genes/output/cluster_marker_genes.cells.json?token=groups_token" + "url": "https://example.com/c019a1cd35aab4d2b4a6ff221e92aaab/cluster-marker-genes/output/cluster_marker_genes.cells.json?token=groups_token" }, { "coordinationValues": { @@ -30,14 +30,14 @@ "obsType": "cell" }, "fileType": "obsEmbedding.cells.json", - "url": "https://example.com/based on ea4cfecb8495b36694d9a951510dc3c6/cluster-marker-genes/output/cluster_marker_genes.cells.json?token=groups_token" + "url": "https://example.com/c019a1cd35aab4d2b4a6ff221e92aaab/cluster-marker-genes/output/cluster_marker_genes.cells.json?token=groups_token" }, { "coordinationValues": { "obsType": "cell" }, "fileType": "obsSets.cell-sets.json", - "url": "https://example.com/based on ea4cfecb8495b36694d9a951510dc3c6/cluster-marker-genes/output/cluster_marker_genes.cell-sets.json?token=groups_token" + "url": "https://example.com/c019a1cd35aab4d2b4a6ff221e92aaab/cluster-marker-genes/output/cluster_marker_genes.cell-sets.json?token=groups_token" } ], "name": "Visualization Files", diff --git a/test/good-fixtures/RNASeqViewConfBuilder/fake-entity.json b/test/good-fixtures/RNASeqViewConfBuilder/fake-entity.json index 3469893..6fb4fbc 100644 --- a/test/good-fixtures/RNASeqViewConfBuilder/fake-entity.json +++ b/test/good-fixtures/RNASeqViewConfBuilder/fake-entity.json @@ -13,5 +13,5 @@ "dag_provenance_list": [] }, "status": "Published", - "uuid": "based on ea4cfecb8495b36694d9a951510dc3c6" + "uuid": "c019a1cd35aab4d2b4a6ff221e92aaab" } diff --git a/test/good-fixtures/SeqFISHViewConfBuilder/fake-conf.json b/test/good-fixtures/SeqFISHViewConfBuilder/fake-conf.json index d89c633..a5aef8f 100644 --- a/test/good-fixtures/SeqFISHViewConfBuilder/fake-conf.json +++ b/test/good-fixtures/SeqFISHViewConfBuilder/fake-conf.json @@ -15,20 +15,20 @@ { "metadata": { "isBitmask": false, - "omeTiffOffsetsUrl": "https://example.com/9db61adfc017670a196ea9b3ca1852a0/output_offsets/HybCycle_12/MMStack_Pos12.offsets.json?token=groups_token" + "omeTiffOffsetsUrl": "https://example.com/c6a254b2dc2ed46b002500ade163a7cc/output_offsets/HybCycle_12/MMStack_Pos12.offsets.json?token=groups_token" }, "name": "HybCycle_12", "type": "ome-tiff", - "url": "https://example.com/9db61adfc017670a196ea9b3ca1852a0/ometiff-pyramids/HybCycle_12/MMStack_Pos12.ome.tif?token=groups_token" + "url": "https://example.com/c6a254b2dc2ed46b002500ade163a7cc/ometiff-pyramids/HybCycle_12/MMStack_Pos12.ome.tif?token=groups_token" }, { "metadata": { "isBitmask": false, - "omeTiffOffsetsUrl": "https://example.com/9db61adfc017670a196ea9b3ca1852a0/output_offsets/final_mRNA_background/MMStack_Pos12.offsets.json?token=groups_token" + "omeTiffOffsetsUrl": "https://example.com/c6a254b2dc2ed46b002500ade163a7cc/output_offsets/final_mRNA_background/MMStack_Pos12.offsets.json?token=groups_token" }, "name": "final_mRNA_background", "type": "ome-tiff", - "url": "https://example.com/9db61adfc017670a196ea9b3ca1852a0/ometiff-pyramids/final_mRNA_background/MMStack_Pos12.ome.tif?token=groups_token" + "url": "https://example.com/c6a254b2dc2ed46b002500ade163a7cc/ometiff-pyramids/final_mRNA_background/MMStack_Pos12.ome.tif?token=groups_token" } ], "schemaVersion": "0.0.2", @@ -100,20 +100,20 @@ { "metadata": { "isBitmask": false, - "omeTiffOffsetsUrl": "https://example.com/9db61adfc017670a196ea9b3ca1852a0/output_offsets/HybCycle_12/MMStack_Pos13.offsets.json?token=groups_token" + "omeTiffOffsetsUrl": "https://example.com/c6a254b2dc2ed46b002500ade163a7cc/output_offsets/HybCycle_12/MMStack_Pos13.offsets.json?token=groups_token" }, "name": "HybCycle_12", "type": "ome-tiff", - "url": "https://example.com/9db61adfc017670a196ea9b3ca1852a0/ometiff-pyramids/HybCycle_12/MMStack_Pos13.ome.tif?token=groups_token" + "url": "https://example.com/c6a254b2dc2ed46b002500ade163a7cc/ometiff-pyramids/HybCycle_12/MMStack_Pos13.ome.tif?token=groups_token" }, { "metadata": { "isBitmask": false, - "omeTiffOffsetsUrl": "https://example.com/9db61adfc017670a196ea9b3ca1852a0/output_offsets/final_mRNA_background/MMStack_Pos13.offsets.json?token=groups_token" + "omeTiffOffsetsUrl": "https://example.com/c6a254b2dc2ed46b002500ade163a7cc/output_offsets/final_mRNA_background/MMStack_Pos13.offsets.json?token=groups_token" }, "name": "final_mRNA_background", "type": "ome-tiff", - "url": "https://example.com/9db61adfc017670a196ea9b3ca1852a0/ometiff-pyramids/final_mRNA_background/MMStack_Pos13.ome.tif?token=groups_token" + "url": "https://example.com/c6a254b2dc2ed46b002500ade163a7cc/ometiff-pyramids/final_mRNA_background/MMStack_Pos13.ome.tif?token=groups_token" } ], "schemaVersion": "0.0.2", diff --git a/test/good-fixtures/SeqFISHViewConfBuilder/fake-entity.json b/test/good-fixtures/SeqFISHViewConfBuilder/fake-entity.json index df3d7ed..6780f9c 100644 --- a/test/good-fixtures/SeqFISHViewConfBuilder/fake-entity.json +++ b/test/good-fixtures/SeqFISHViewConfBuilder/fake-entity.json @@ -35,6 +35,6 @@ "rel_path": "output_offsets/HybCycle_12/MMStack_Pos13.offsets.json" } ], - "uuid": "9db61adfc017670a196ea9b3ca1852a0", + "uuid": "c6a254b2dc2ed46b002500ade163a7cc", "metadata": {"dag_provenance_list": []} } \ No newline at end of file diff --git a/test/good-fixtures/TiledSPRMViewConfBuilder/no-cells-conf.json b/test/good-fixtures/TiledSPRMViewConfBuilder/no-cells-conf.json index 193554b..eccbde9 100644 --- a/test/good-fixtures/TiledSPRMViewConfBuilder/no-cells-conf.json +++ b/test/good-fixtures/TiledSPRMViewConfBuilder/no-cells-conf.json @@ -15,11 +15,11 @@ { "metadata": { "isBitmask": false, - "omeTiffOffsetsUrl": "https://example.com/based on 04e7385339167e541ad42a2636e18398/output_offsets/reg1.offsets.json?token=groups_token" + "omeTiffOffsetsUrl": "https://example.com/04e7385339167e541ad42a2636e18398/output_offsets/reg1.offsets.json?token=groups_token" }, "name": "reg1", "type": "ome-tiff", - "url": "https://example.com/based on 04e7385339167e541ad42a2636e18398/output/extract/expressions/ome-tiff/reg1.ome.tiff?token=groups_token" + "url": "https://example.com/04e7385339167e541ad42a2636e18398/output/extract/expressions/ome-tiff/reg1.ome.tiff?token=groups_token" } ], "schemaVersion": "0.0.2" diff --git a/test/good-fixtures/TiledSPRMViewConfBuilder/no-cells-entity.json b/test/good-fixtures/TiledSPRMViewConfBuilder/no-cells-entity.json index bc67bc9..26f5c81 100644 --- a/test/good-fixtures/TiledSPRMViewConfBuilder/no-cells-entity.json +++ b/test/good-fixtures/TiledSPRMViewConfBuilder/no-cells-entity.json @@ -19,5 +19,5 @@ "dag_provenance_list": [] }, "status": "Published", - "uuid": "based on 04e7385339167e541ad42a2636e18398" + "uuid": "04e7385339167e541ad42a2636e18398" } diff --git a/test/good-fixtures/TiledSPRMViewConfBuilder/with-cells-conf.json b/test/good-fixtures/TiledSPRMViewConfBuilder/with-cells-conf.json index fc0fb63..eac4e3e 100644 --- a/test/good-fixtures/TiledSPRMViewConfBuilder/with-cells-conf.json +++ b/test/good-fixtures/TiledSPRMViewConfBuilder/with-cells-conf.json @@ -13,21 +13,21 @@ "obsType": "cell" }, "fileType": "cells.json", - "url": "https://example.com/based on 04e7385339167e541ad42a2636e18398/output_json/reg1.cells.json?token=groups_token" + "url": "https://example.com/04e7385339167e541ad42a2636e18398/output_json/reg1.cells.json?token=groups_token" }, { "coordinationValues": { "obsType": "cell" }, "fileType": "cell-sets.json", - "url": "https://example.com/based on 04e7385339167e541ad42a2636e18398/output_json/reg1.cell-sets.json?token=groups_token" + "url": "https://example.com/04e7385339167e541ad42a2636e18398/output_json/reg1.cell-sets.json?token=groups_token" }, { "coordinationValues": { "obsType": "cell" }, "fileType": "clusters.json", - "url": "https://example.com/based on 04e7385339167e541ad42a2636e18398/output_json/reg1.clusters.json?token=groups_token" + "url": "https://example.com/04e7385339167e541ad42a2636e18398/output_json/reg1.clusters.json?token=groups_token" }, { "fileType": "raster.json", @@ -36,11 +36,11 @@ { "metadata": { "isBitmask": false, - "omeTiffOffsetsUrl": "https://example.com/based on 04e7385339167e541ad42a2636e18398/output_offsets/reg1.offsets.json?token=groups_token" + "omeTiffOffsetsUrl": "https://example.com/04e7385339167e541ad42a2636e18398/output_offsets/reg1.offsets.json?token=groups_token" }, "name": "reg1", "type": "ome-tiff", - "url": "https://example.com/based on 04e7385339167e541ad42a2636e18398/output/extract/expressions/ome-tiff/reg1.ome.tiff?token=groups_token" + "url": "https://example.com/04e7385339167e541ad42a2636e18398/output/extract/expressions/ome-tiff/reg1.ome.tiff?token=groups_token" } ], "schemaVersion": "0.0.2" diff --git a/test/good-fixtures/TiledSPRMViewConfBuilder/with-cells-entity.json b/test/good-fixtures/TiledSPRMViewConfBuilder/with-cells-entity.json index e76f94f..c282866 100644 --- a/test/good-fixtures/TiledSPRMViewConfBuilder/with-cells-entity.json +++ b/test/good-fixtures/TiledSPRMViewConfBuilder/with-cells-entity.json @@ -23,5 +23,5 @@ "dag_provenance_list": [] }, "status": "Published", - "uuid": "based on 04e7385339167e541ad42a2636e18398" + "uuid": "04e7385339167e541ad42a2636e18398" } diff --git a/test/test_builders.py b/test/test_builders.py index bbc59d7..180ab60 100644 --- a/test/test_builders.py +++ b/test/test_builders.py @@ -34,7 +34,7 @@ class MockResponse: bad_entity_paths = list((Path(__file__).parent / 'bad-fixtures').glob("*-entity.json")) assert len(bad_entity_paths) > 0 -assaytypes_path = Path(__file__).parent / 'assaytypes' +assaytypes_path = Path(__file__).parent / 'assaytype-fixtures' assert assaytypes_path.is_dir() defaults = json.load((Path(__file__).parent.parent / 'src/defaults.json').open()) From 3c4ffa04c29bbf9c1dc122754aff207a3e08303e Mon Sep 17 00:00:00 2001 From: Nikolay Akhmetov Date: Mon, 18 Dec 2023 15:01:52 -0500 Subject: [PATCH 09/19] Fix `has_vis_entity` tests --- test/test_builders.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/test_builders.py b/test/test_builders.py index 180ab60..3a28e57 100644 --- a/test/test_builders.py +++ b/test/test_builders.py @@ -48,7 +48,7 @@ def get_assaytype(entity): uuid = entity.get('uuid') if uuid is None: return default_assaytype - assay = json.loads(assaytypes_path.joinpath(f'{uuid}.json')) + assay = json.loads(assaytypes_path.joinpath(f'{uuid}.json').read_text()) if assay is None: return default_assaytype return assay @@ -56,9 +56,9 @@ def get_assaytype(entity): @pytest.mark.parametrize( "has_vis_entity", [ - (False, {'uuid': "1", 'data_types': [], 'metadata': {'dag_provenance_list': []}}), + (False, {'uuid': "2c2179ea741d3bbb47772172a316a2bf", 'data_types': [], 'metadata': {'dag_provenance_list': []}}), (True, json.loads(Path.read_text(good_entity_paths[0]))), - (False, {'uuid': "2", 'data_types': []}) + (False, {'uuid': "2c2179ea741d3bbb47772172a316a2bf", 'data_types': []}) # If the first fixture returns a Null builder this would break. ], ids=lambda has_vis_entity: f'has_visualization={has_vis_entity[0]}') From 91e760fe69d080d97703baf90994903c1c22c2eb Mon Sep 17 00:00:00 2001 From: Nikolay Akhmetov Date: Mon, 18 Dec 2023 15:41:38 -0500 Subject: [PATCH 10/19] Fix "good entity" tests --- src/portal_visualization/builder_factory.py | 14 +------------- .../9db61adfc017670a196ea9b3ca1852a0.json | 11 +++++++++++ .../a6116772446f6d1c1f6b3d2e9735cfe0.json | 11 +++++++++++ .../e1c4370da5523ab5c9be581d1d76ca20.json | 11 +++++++++++ .../IMSViewConfBuilder/fake-conf.json | 4 ++-- .../IMSViewConfBuilder/fake-entity.json | 3 ++- .../NanoDESIViewConfBuilder/fake-conf.json | 4 ++-- .../NanoDESIViewConfBuilder/fake-entity.json | 3 ++- .../SeqFISHViewConfBuilder/fake-conf.json | 16 ++++++++-------- .../SeqFISHViewConfBuilder/fake-entity.json | 3 ++- 10 files changed, 52 insertions(+), 28 deletions(-) create mode 100644 test/assaytype-fixtures/9db61adfc017670a196ea9b3ca1852a0.json create mode 100644 test/assaytype-fixtures/a6116772446f6d1c1f6b3d2e9735cfe0.json create mode 100644 test/assaytype-fixtures/e1c4370da5523ab5c9be581d1d76ca20.json diff --git a/src/portal_visualization/builder_factory.py b/src/portal_visualization/builder_factory.py index 7cf6f8e..9aab6d8 100644 --- a/src/portal_visualization/builder_factory.py +++ b/src/portal_visualization/builder_factory.py @@ -22,30 +22,18 @@ SALMON_RNASSEQ_SLIDE ) -# get_assaytype response example: -# { -# "assaytype": "image_pyramid", -# "description": "Image Pyramid", -# "vitessce-hints": [ -# "is_image", -# "pyramid" -# ] -# } - - def get_ancestor_assaytypes(entity, get_assaytype): return [get_assaytype(ancestor).get('assaytype') for ancestor in entity.get('immediate_ancestors')] -# # This function is the main entrypoint for the builder factory. # It returns the correct builder for the given entity. # # The entity is a dict that contains the entity UUID and metadata. # `get_assaytype` is a function which takes an entity UUID and returns -# the assaytype and vitessce-hints for that entity. +# a dict containing the assaytype and vitessce-hints for that entity. def get_view_config_builder(entity, get_assaytype): assay = get_assaytype(entity) assay_name = assay.get('assaytype') diff --git a/test/assaytype-fixtures/9db61adfc017670a196ea9b3ca1852a0.json b/test/assaytype-fixtures/9db61adfc017670a196ea9b3ca1852a0.json new file mode 100644 index 0000000..22fd1ec --- /dev/null +++ b/test/assaytype-fixtures/9db61adfc017670a196ea9b3ca1852a0.json @@ -0,0 +1,11 @@ +{ + "assaytype": "image_pyramid", + "contains-pii": false, + "description": "Image Pyramid", + "primary": false, + "vitessce-hints": [ + "is_image", + "pyramid", + "is_support" + ] + } \ No newline at end of file diff --git a/test/assaytype-fixtures/a6116772446f6d1c1f6b3d2e9735cfe0.json b/test/assaytype-fixtures/a6116772446f6d1c1f6b3d2e9735cfe0.json new file mode 100644 index 0000000..22fd1ec --- /dev/null +++ b/test/assaytype-fixtures/a6116772446f6d1c1f6b3d2e9735cfe0.json @@ -0,0 +1,11 @@ +{ + "assaytype": "image_pyramid", + "contains-pii": false, + "description": "Image Pyramid", + "primary": false, + "vitessce-hints": [ + "is_image", + "pyramid", + "is_support" + ] + } \ No newline at end of file diff --git a/test/assaytype-fixtures/e1c4370da5523ab5c9be581d1d76ca20.json b/test/assaytype-fixtures/e1c4370da5523ab5c9be581d1d76ca20.json new file mode 100644 index 0000000..22fd1ec --- /dev/null +++ b/test/assaytype-fixtures/e1c4370da5523ab5c9be581d1d76ca20.json @@ -0,0 +1,11 @@ +{ + "assaytype": "image_pyramid", + "contains-pii": false, + "description": "Image Pyramid", + "primary": false, + "vitessce-hints": [ + "is_image", + "pyramid", + "is_support" + ] + } \ No newline at end of file diff --git a/test/good-fixtures/IMSViewConfBuilder/fake-conf.json b/test/good-fixtures/IMSViewConfBuilder/fake-conf.json index 86577ad..7ae8f5d 100644 --- a/test/good-fixtures/IMSViewConfBuilder/fake-conf.json +++ b/test/good-fixtures/IMSViewConfBuilder/fake-conf.json @@ -14,11 +14,11 @@ { "metadata": { "isBitmask": false, - "omeTiffOffsetsUrl": "https://example.com/3bc3ad124014a632d558255626bf38c9/output_offsets/ometiffs/VAN0003-LK-32-21-IMS_NegMode_multilayer.offsets.json?token=groups_token" + "omeTiffOffsetsUrl": "https://example.com/a6116772446f6d1c1f6b3d2e9735cfe0/output_offsets/ometiffs/VAN0003-LK-32-21-IMS_NegMode_multilayer.offsets.json?token=groups_token" }, "name": "VAN0003-LK-32-21-IMS_NegMode_multilayer.ome.tif", "type": "ome-tiff", - "url": "https://example.com/3bc3ad124014a632d558255626bf38c9/ometiff-pyramids/ometiffs/VAN0003-LK-32-21-IMS_NegMode_multilayer.ome.tif?token=groups_token" + "url": "https://example.com/a6116772446f6d1c1f6b3d2e9735cfe0/ometiff-pyramids/ometiffs/VAN0003-LK-32-21-IMS_NegMode_multilayer.ome.tif?token=groups_token" } ], "schemaVersion": "0.0.2", diff --git a/test/good-fixtures/IMSViewConfBuilder/fake-entity.json b/test/good-fixtures/IMSViewConfBuilder/fake-entity.json index 95559ea..60cee41 100644 --- a/test/good-fixtures/IMSViewConfBuilder/fake-entity.json +++ b/test/good-fixtures/IMSViewConfBuilder/fake-entity.json @@ -6,6 +6,7 @@ "status": "QA", "immediate_ancestors": [ { + "uuid": "3bc3ad124014a632d558255626bf38c9", "data_types": ["MALDI-IMS-neg"] } ], @@ -29,6 +30,6 @@ "rel_path": "output_offsets/ometiffs/VAN0003-LK-32-21-IMS_NegMode_multilayer.offsets.json" } ], - "uuid": "3bc3ad124014a632d558255626bf38c9", + "uuid": "a6116772446f6d1c1f6b3d2e9735cfe0", "metadata": {"dag_provenance_list": []} } \ No newline at end of file diff --git a/test/good-fixtures/NanoDESIViewConfBuilder/fake-conf.json b/test/good-fixtures/NanoDESIViewConfBuilder/fake-conf.json index 180c3cc..fd83da7 100644 --- a/test/good-fixtures/NanoDESIViewConfBuilder/fake-conf.json +++ b/test/good-fixtures/NanoDESIViewConfBuilder/fake-conf.json @@ -14,11 +14,11 @@ { "metadata": { "isBitmask": false, - "omeTiffOffsetsUrl": "https://example.com/6b93107731199733f266bbd0f3bc9747/output_offsets/ometiffs/VAN0003-LK-32-21-IMS_NegMode_multilayer.offsets.json?token=groups_token" + "omeTiffOffsetsUrl": "https://example.com/e1c4370da5523ab5c9be581d1d76ca20/output_offsets/ometiffs/VAN0003-LK-32-21-IMS_NegMode_multilayer.offsets.json?token=groups_token" }, "name": "VAN0003-LK-32-21-IMS_NegMode_multilayer.ome.tif", "type": "ome-tiff", - "url": "https://example.com/6b93107731199733f266bbd0f3bc9747/ometiff-pyramids/ometiffs/VAN0003-LK-32-21-IMS_NegMode_multilayer.ome.tif?token=groups_token" + "url": "https://example.com/e1c4370da5523ab5c9be581d1d76ca20/ometiff-pyramids/ometiffs/VAN0003-LK-32-21-IMS_NegMode_multilayer.ome.tif?token=groups_token" } ], "schemaVersion": "0.0.2", diff --git a/test/good-fixtures/NanoDESIViewConfBuilder/fake-entity.json b/test/good-fixtures/NanoDESIViewConfBuilder/fake-entity.json index 7e70e0e..1dd4866 100644 --- a/test/good-fixtures/NanoDESIViewConfBuilder/fake-entity.json +++ b/test/good-fixtures/NanoDESIViewConfBuilder/fake-entity.json @@ -4,6 +4,7 @@ ], "immediate_ancestors": [ { + "uuid": "6b93107731199733f266bbd0f3bc9747", "data_types": ["NanoDESI"] } ], @@ -16,6 +17,6 @@ "rel_path": "output_offsets/ometiffs/VAN0003-LK-32-21-IMS_NegMode_multilayer.offsets.json" } ], - "uuid": "6b93107731199733f266bbd0f3bc9747", + "uuid": "e1c4370da5523ab5c9be581d1d76ca20", "metadata": {"dag_provenance_list": []} } \ No newline at end of file diff --git a/test/good-fixtures/SeqFISHViewConfBuilder/fake-conf.json b/test/good-fixtures/SeqFISHViewConfBuilder/fake-conf.json index a5aef8f..d89c633 100644 --- a/test/good-fixtures/SeqFISHViewConfBuilder/fake-conf.json +++ b/test/good-fixtures/SeqFISHViewConfBuilder/fake-conf.json @@ -15,20 +15,20 @@ { "metadata": { "isBitmask": false, - "omeTiffOffsetsUrl": "https://example.com/c6a254b2dc2ed46b002500ade163a7cc/output_offsets/HybCycle_12/MMStack_Pos12.offsets.json?token=groups_token" + "omeTiffOffsetsUrl": "https://example.com/9db61adfc017670a196ea9b3ca1852a0/output_offsets/HybCycle_12/MMStack_Pos12.offsets.json?token=groups_token" }, "name": "HybCycle_12", "type": "ome-tiff", - "url": "https://example.com/c6a254b2dc2ed46b002500ade163a7cc/ometiff-pyramids/HybCycle_12/MMStack_Pos12.ome.tif?token=groups_token" + "url": "https://example.com/9db61adfc017670a196ea9b3ca1852a0/ometiff-pyramids/HybCycle_12/MMStack_Pos12.ome.tif?token=groups_token" }, { "metadata": { "isBitmask": false, - "omeTiffOffsetsUrl": "https://example.com/c6a254b2dc2ed46b002500ade163a7cc/output_offsets/final_mRNA_background/MMStack_Pos12.offsets.json?token=groups_token" + "omeTiffOffsetsUrl": "https://example.com/9db61adfc017670a196ea9b3ca1852a0/output_offsets/final_mRNA_background/MMStack_Pos12.offsets.json?token=groups_token" }, "name": "final_mRNA_background", "type": "ome-tiff", - "url": "https://example.com/c6a254b2dc2ed46b002500ade163a7cc/ometiff-pyramids/final_mRNA_background/MMStack_Pos12.ome.tif?token=groups_token" + "url": "https://example.com/9db61adfc017670a196ea9b3ca1852a0/ometiff-pyramids/final_mRNA_background/MMStack_Pos12.ome.tif?token=groups_token" } ], "schemaVersion": "0.0.2", @@ -100,20 +100,20 @@ { "metadata": { "isBitmask": false, - "omeTiffOffsetsUrl": "https://example.com/c6a254b2dc2ed46b002500ade163a7cc/output_offsets/HybCycle_12/MMStack_Pos13.offsets.json?token=groups_token" + "omeTiffOffsetsUrl": "https://example.com/9db61adfc017670a196ea9b3ca1852a0/output_offsets/HybCycle_12/MMStack_Pos13.offsets.json?token=groups_token" }, "name": "HybCycle_12", "type": "ome-tiff", - "url": "https://example.com/c6a254b2dc2ed46b002500ade163a7cc/ometiff-pyramids/HybCycle_12/MMStack_Pos13.ome.tif?token=groups_token" + "url": "https://example.com/9db61adfc017670a196ea9b3ca1852a0/ometiff-pyramids/HybCycle_12/MMStack_Pos13.ome.tif?token=groups_token" }, { "metadata": { "isBitmask": false, - "omeTiffOffsetsUrl": "https://example.com/c6a254b2dc2ed46b002500ade163a7cc/output_offsets/final_mRNA_background/MMStack_Pos13.offsets.json?token=groups_token" + "omeTiffOffsetsUrl": "https://example.com/9db61adfc017670a196ea9b3ca1852a0/output_offsets/final_mRNA_background/MMStack_Pos13.offsets.json?token=groups_token" }, "name": "final_mRNA_background", "type": "ome-tiff", - "url": "https://example.com/c6a254b2dc2ed46b002500ade163a7cc/ometiff-pyramids/final_mRNA_background/MMStack_Pos13.ome.tif?token=groups_token" + "url": "https://example.com/9db61adfc017670a196ea9b3ca1852a0/ometiff-pyramids/final_mRNA_background/MMStack_Pos13.ome.tif?token=groups_token" } ], "schemaVersion": "0.0.2", diff --git a/test/good-fixtures/SeqFISHViewConfBuilder/fake-entity.json b/test/good-fixtures/SeqFISHViewConfBuilder/fake-entity.json index 6780f9c..d68fdef 100644 --- a/test/good-fixtures/SeqFISHViewConfBuilder/fake-entity.json +++ b/test/good-fixtures/SeqFISHViewConfBuilder/fake-entity.json @@ -6,6 +6,7 @@ "status": "QA", "immediate_ancestors": [ { + "uuid": "c6a254b2dc2ed46b002500ade163a7cc", "data_types": ["seqFish"] } ], @@ -35,6 +36,6 @@ "rel_path": "output_offsets/HybCycle_12/MMStack_Pos13.offsets.json" } ], - "uuid": "c6a254b2dc2ed46b002500ade163a7cc", + "uuid": "9db61adfc017670a196ea9b3ca1852a0", "metadata": {"dag_provenance_list": []} } \ No newline at end of file From a4d333080589f24101f66d892fd19f84c622aa29 Mon Sep 17 00:00:00 2001 From: Nikolay Akhmetov Date: Mon, 18 Dec 2023 16:47:54 -0500 Subject: [PATCH 11/19] Fix "bad entity" tests --- src/portal_visualization/builder_factory.py | 4 ++ .../210d118a14c8624b6bb9610a9062656e.json | 10 ++++ test/bad-fixtures/empty-error.txt | 2 +- ...t-annotated-published-no-files-entity.json | 2 +- ...not-annotated-published-no-files-error.txt | 2 +- test/bad-fixtures/scatterplot-entity.json | 2 +- test/bad-fixtures/scatterplot-error.txt | 2 +- .../seqfish-missing-ometiff-entity.json | 46 ++++++++++--------- .../stitched-cytokit-missing-reg-entity.json | 2 - .../stitched-cytokit-missing-reg-error.txt | 2 +- .../stitched-cytokit-missing-zgroup-error.txt | 2 +- test/bad-fixtures/with-cells-entity.json | 2 +- test/bad-fixtures/with-cells-error.txt | 2 +- .../SeqFISHViewConfBuilder/fake-entity.json | 3 +- test/test_builders.py | 2 + 15 files changed, 50 insertions(+), 35 deletions(-) create mode 100644 test/assaytype-fixtures/210d118a14c8624b6bb9610a9062656e.json diff --git a/src/portal_visualization/builder_factory.py b/src/portal_visualization/builder_factory.py index 9aab6d8..df6902b 100644 --- a/src/portal_visualization/builder_factory.py +++ b/src/portal_visualization/builder_factory.py @@ -28,6 +28,7 @@ def get_ancestor_assaytypes(entity, get_assaytype): in entity.get('immediate_ancestors')] + # This function is the main entrypoint for the builder factory. # It returns the correct builder for the given entity. # @@ -35,9 +36,12 @@ def get_ancestor_assaytypes(entity, get_assaytype): # `get_assaytype` is a function which takes an entity UUID and returns # a dict containing the assaytype and vitessce-hints for that entity. def get_view_config_builder(entity, get_assaytype): + if (entity.get('uuid') is None): + raise ValueError("Provided entity does not have a uuid") assay = get_assaytype(entity) assay_name = assay.get('assaytype') hints = assay.get('vitessce-hints', []) + dag_provenance_list = entity.get('metadata', {}).get('dag_provenance_list', []) dag_names = [dag['name'] for dag in dag_provenance_list if 'name' in dag] diff --git a/test/assaytype-fixtures/210d118a14c8624b6bb9610a9062656e.json b/test/assaytype-fixtures/210d118a14c8624b6bb9610a9062656e.json new file mode 100644 index 0000000..f4428c7 --- /dev/null +++ b/test/assaytype-fixtures/210d118a14c8624b6bb9610a9062656e.json @@ -0,0 +1,10 @@ +{ + "assaytype": "sn_atac_seq", + "contains-pii": false, + "description": "snATAC-seq [SnapATAC]", + "primary": false, + "vitessce-hints": [ + "is_sc", + "atac" + ] + } \ No newline at end of file diff --git a/test/bad-fixtures/empty-error.txt b/test/bad-fixtures/empty-error.txt index 22e36cf..8887b4e 100644 --- a/test/bad-fixtures/empty-error.txt +++ b/test/bad-fixtures/empty-error.txt @@ -1 +1 @@ -KeyError: data_types +ValueError: Provided entity does not have a uuid \ No newline at end of file diff --git a/test/bad-fixtures/fake-is-not-annotated-published-no-files-entity.json b/test/bad-fixtures/fake-is-not-annotated-published-no-files-entity.json index 704f3d5..83b032c 100644 --- a/test/bad-fixtures/fake-is-not-annotated-published-no-files-entity.json +++ b/test/bad-fixtures/fake-is-not-annotated-published-no-files-entity.json @@ -16,5 +16,5 @@ ] }, "status": "Published", - "uuid": "503f9caeffb9ee1e1324793c977d2342" + "uuid": "2a590db3d7ab1e1512816b165d95cdcf" } diff --git a/test/bad-fixtures/fake-is-not-annotated-published-no-files-error.txt b/test/bad-fixtures/fake-is-not-annotated-published-no-files-error.txt index f9c5773..98e0ee4 100644 --- a/test/bad-fixtures/fake-is-not-annotated-published-no-files-error.txt +++ b/test/bad-fixtures/fake-is-not-annotated-published-no-files-error.txt @@ -1 +1 @@ -FileNotFoundError: RNA-seq assay with uuid 503f9caeffb9ee1e1324793c977d2342 has no .zarr store at hubmap_ui/anndata-zarr/secondary_analysis.zarr \ No newline at end of file +FileNotFoundError: RNA-seq assay with uuid 2a590db3d7ab1e1512816b165d95cdcf has no .zarr store at hubmap_ui/anndata-zarr/secondary_analysis.zarr \ No newline at end of file diff --git a/test/bad-fixtures/scatterplot-entity.json b/test/bad-fixtures/scatterplot-entity.json index 3978eb2..0e97e6c 100644 --- a/test/bad-fixtures/scatterplot-entity.json +++ b/test/bad-fixtures/scatterplot-entity.json @@ -10,5 +10,5 @@ "dag_provenance_list": [] }, "status": "Published", - "uuid": "based on ea4cfecb8495b36694d9a951510dc3c6" + "uuid": "ea4cfecb8495b36694d9a951510dc3c6" } diff --git a/test/bad-fixtures/scatterplot-error.txt b/test/bad-fixtures/scatterplot-error.txt index 848069a..1c9dc0c 100644 --- a/test/bad-fixtures/scatterplot-error.txt +++ b/test/bad-fixtures/scatterplot-error.txt @@ -1 +1 @@ -FileNotFoundError: Files for uuid "based on ea4cfecb8495b36694d9a951510dc3c6" not found as expected: Expected: ['cluster-marker-genes/output/cluster_marker_genes.cells.json', 'cluster-marker-genes/output/cluster_marker_genes.cells.json', 'cluster-marker-genes/output/cluster_marker_genes.cells.json', 'cluster-marker-genes/output/cluster_marker_genes.cell-sets.json']; Found: ['cluster-marker-genes/output/cluster_marker_genes.cells.json'] \ No newline at end of file +FileNotFoundError: Files for uuid "ea4cfecb8495b36694d9a951510dc3c6" not found as expected: Expected: ['cluster-marker-genes/output/cluster_marker_genes.cells.json', 'cluster-marker-genes/output/cluster_marker_genes.cells.json', 'cluster-marker-genes/output/cluster_marker_genes.cells.json', 'cluster-marker-genes/output/cluster_marker_genes.cell-sets.json']; Found: ['cluster-marker-genes/output/cluster_marker_genes.cells.json'] \ No newline at end of file diff --git a/test/bad-fixtures/seqfish-missing-ometiff-entity.json b/test/bad-fixtures/seqfish-missing-ometiff-entity.json index d0a5048..32fb581 100644 --- a/test/bad-fixtures/seqfish-missing-ometiff-entity.json +++ b/test/bad-fixtures/seqfish-missing-ometiff-entity.json @@ -1,23 +1,25 @@ { - "data_types": [ - "image_pyramid", - "seqFish" - ], - "status": "QA", - "files": [ - { - "rel_path": "output_offsets/final_mRNA_background/MMStack_Pos12.offsets.json" - }, - { - "rel_path": "output_offsets/final_mRNA_background/MMStack_Pos13.offsets.json" - }, - { - "rel_path": "output_offsets/HybCycle_12/MMStack_Pos12.offsets.json" - }, - { - "rel_path": "output_offsets/HybCycle_12/MMStack_Pos13.offsets.json" - } - ], - "uuid": "9db61adfc017670a196ea9b3ca1852a0", - "metadata": {"dag_provenance_list": []} -} \ No newline at end of file + "data_types": ["image_pyramid", "seqFish"], + "status": "QA", + "immediate_ancestors": [ + { + "uuid": "c6a254b2dc2ed46b002500ade163a7cc" + } + ], + "files": [ + { + "rel_path": "output_offsets/final_mRNA_background/MMStack_Pos12.offsets.json" + }, + { + "rel_path": "output_offsets/final_mRNA_background/MMStack_Pos13.offsets.json" + }, + { + "rel_path": "output_offsets/HybCycle_12/MMStack_Pos12.offsets.json" + }, + { + "rel_path": "output_offsets/HybCycle_12/MMStack_Pos13.offsets.json" + } + ], + "uuid": "9db61adfc017670a196ea9b3ca1852a0", + "metadata": { "dag_provenance_list": [] } +} diff --git a/test/bad-fixtures/stitched-cytokit-missing-reg-entity.json b/test/bad-fixtures/stitched-cytokit-missing-reg-entity.json index e51cfa6..5f5a624 100644 --- a/test/bad-fixtures/stitched-cytokit-missing-reg-entity.json +++ b/test/bad-fixtures/stitched-cytokit-missing-reg-entity.json @@ -15,7 +15,6 @@ "description": "OME-TIFF pyramid file", "edam_term": "EDAM_1.24.format_3727", "is_qa_qc": false, - "rel_path": "ometiff-pyramids/stitched/expressions/regXXX_stitched_expressions.ome.tif", "size": 5179858585, "type": "unknown" }, @@ -23,7 +22,6 @@ "description": "OME-TIFF pyramid file", "edam_term": "EDAM_1.24.format_3727", "is_qa_qc": false, - "rel_path": "ometiff-pyramids/stitched/mask/regXXX_stitched_mask.ome.tif", "size": 41470943, "type": "unknown" } diff --git a/test/bad-fixtures/stitched-cytokit-missing-reg-error.txt b/test/bad-fixtures/stitched-cytokit-missing-reg-error.txt index 1ce9dbc..879c675 100644 --- a/test/bad-fixtures/stitched-cytokit-missing-reg-error.txt +++ b/test/bad-fixtures/stitched-cytokit-missing-reg-error.txt @@ -1 +1 @@ -FileNotFoundError: Could not find images of the SPRM analysis with uuid 04e7385339167e541ad42a2636e18398 \ No newline at end of file +KeyError: rel_path \ No newline at end of file diff --git a/test/bad-fixtures/stitched-cytokit-missing-zgroup-error.txt b/test/bad-fixtures/stitched-cytokit-missing-zgroup-error.txt index 1ce9dbc..2a31fed 100644 --- a/test/bad-fixtures/stitched-cytokit-missing-zgroup-error.txt +++ b/test/bad-fixtures/stitched-cytokit-missing-zgroup-error.txt @@ -1 +1 @@ -FileNotFoundError: Could not find images of the SPRM analysis with uuid 04e7385339167e541ad42a2636e18398 \ No newline at end of file +FileNotFoundError: SPRM assay with uuid 04e7385339167e541ad42a2636e18398 has no .zarr store at anndata-zarr/reg1_stitched_expressions-anndata.zarr \ No newline at end of file diff --git a/test/bad-fixtures/with-cells-entity.json b/test/bad-fixtures/with-cells-entity.json index f59ebfb..3e547ed 100644 --- a/test/bad-fixtures/with-cells-entity.json +++ b/test/bad-fixtures/with-cells-entity.json @@ -17,5 +17,5 @@ "dag_provenance_list": [] }, "status": "Published", - "uuid": "based on 04e7385339167e541ad42a2636e18398" + "uuid": "04e7385339167e541ad42a2636e18398" } diff --git a/test/bad-fixtures/with-cells-error.txt b/test/bad-fixtures/with-cells-error.txt index 4156083..fc8d5ab 100644 --- a/test/bad-fixtures/with-cells-error.txt +++ b/test/bad-fixtures/with-cells-error.txt @@ -1 +1 @@ -FileNotFoundError: SPRM file output_json/reg1.cell-sets.json with uuid "based on 04e7385339167e541ad42a2636e18398" not found as expected. \ No newline at end of file +FileNotFoundError: SPRM file output_json/reg1.cell-sets.json with uuid "04e7385339167e541ad42a2636e18398" not found as expected. \ No newline at end of file diff --git a/test/good-fixtures/SeqFISHViewConfBuilder/fake-entity.json b/test/good-fixtures/SeqFISHViewConfBuilder/fake-entity.json index d68fdef..5f2fa42 100644 --- a/test/good-fixtures/SeqFISHViewConfBuilder/fake-entity.json +++ b/test/good-fixtures/SeqFISHViewConfBuilder/fake-entity.json @@ -6,8 +6,7 @@ "status": "QA", "immediate_ancestors": [ { - "uuid": "c6a254b2dc2ed46b002500ade163a7cc", - "data_types": ["seqFish"] + "uuid": "c6a254b2dc2ed46b002500ade163a7cc" } ], "files": [ diff --git a/test/test_builders.py b/test/test_builders.py index 3a28e57..d7631b0 100644 --- a/test/test_builders.py +++ b/test/test_builders.py @@ -138,6 +138,8 @@ def test_entity_to_error(entity_path, mocker): builder.get_conf_cells() actual_error = f'{error_info.type.__name__}: {error_info.value.args[0]}' + print(error_info.traceback) + error_expected_path = ( entity_path.parent / entity_path.name.replace('-entity.json', '-error.txt')) expected_error = error_expected_path.read_text().strip() From b03ddeec4b7cac37c0617b85036c7ca2aa6bf21a Mon Sep 17 00:00:00 2001 From: Nikolay Akhmetov Date: Mon, 18 Dec 2023 16:49:47 -0500 Subject: [PATCH 12/19] remove added print statement --- test/test_builders.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/test/test_builders.py b/test/test_builders.py index d7631b0..bceee96 100644 --- a/test/test_builders.py +++ b/test/test_builders.py @@ -44,6 +44,7 @@ class MockResponse: 'vitessce-hints': [], } + def get_assaytype(entity): uuid = entity.get('uuid') if uuid is None: @@ -53,10 +54,12 @@ def get_assaytype(entity): return default_assaytype return assay + @pytest.mark.parametrize( "has_vis_entity", [ - (False, {'uuid': "2c2179ea741d3bbb47772172a316a2bf", 'data_types': [], 'metadata': {'dag_provenance_list': []}}), + (False, {'uuid': "2c2179ea741d3bbb47772172a316a2bf", + 'data_types': [], 'metadata': {'dag_provenance_list': []}}), (True, json.loads(Path.read_text(good_entity_paths[0]))), (False, {'uuid': "2c2179ea741d3bbb47772172a316a2bf", 'data_types': []}) # If the first fixture returns a Null builder this would break. @@ -138,8 +141,6 @@ def test_entity_to_error(entity_path, mocker): builder.get_conf_cells() actual_error = f'{error_info.type.__name__}: {error_info.value.args[0]}' - print(error_info.traceback) - error_expected_path = ( entity_path.parent / entity_path.name.replace('-entity.json', '-error.txt')) expected_error = error_expected_path.read_text().strip() From 146a70d837a1723059c96874159c048cf56d5a48 Mon Sep 17 00:00:00 2001 From: Nikolay Akhmetov Date: Mon, 18 Dec 2023 16:50:18 -0500 Subject: [PATCH 13/19] lint fixes --- src/portal_visualization/builder_factory.py | 4 ++-- test/test_builders.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/portal_visualization/builder_factory.py b/src/portal_visualization/builder_factory.py index df6902b..6551a2f 100644 --- a/src/portal_visualization/builder_factory.py +++ b/src/portal_visualization/builder_factory.py @@ -22,13 +22,13 @@ SALMON_RNASSEQ_SLIDE ) + def get_ancestor_assaytypes(entity, get_assaytype): return [get_assaytype(ancestor).get('assaytype') for ancestor in entity.get('immediate_ancestors')] - # This function is the main entrypoint for the builder factory. # It returns the correct builder for the given entity. # @@ -41,7 +41,7 @@ def get_view_config_builder(entity, get_assaytype): assay = get_assaytype(entity) assay_name = assay.get('assaytype') hints = assay.get('vitessce-hints', []) - + dag_provenance_list = entity.get('metadata', {}).get('dag_provenance_list', []) dag_names = [dag['name'] for dag in dag_provenance_list if 'name' in dag] diff --git a/test/test_builders.py b/test/test_builders.py index bceee96..a732729 100644 --- a/test/test_builders.py +++ b/test/test_builders.py @@ -59,7 +59,7 @@ def get_assaytype(entity): "has_vis_entity", [ (False, {'uuid': "2c2179ea741d3bbb47772172a316a2bf", - 'data_types': [], 'metadata': {'dag_provenance_list': []}}), + 'data_types': [], 'metadata': {'dag_provenance_list': []}}), (True, json.loads(Path.read_text(good_entity_paths[0]))), (False, {'uuid': "2c2179ea741d3bbb47772172a316a2bf", 'data_types': []}) # If the first fixture returns a Null builder this would break. From dc79923ba50db1391e4546389dc49f2b33292952 Mon Sep 17 00:00:00 2001 From: Nikolay Akhmetov Date: Mon, 18 Dec 2023 16:56:25 -0500 Subject: [PATCH 14/19] remove unused import --- test/test_builders.py | 1 - 1 file changed, 1 deletion(-) diff --git a/test/test_builders.py b/test/test_builders.py index a732729..f84ad9d 100644 --- a/test/test_builders.py +++ b/test/test_builders.py @@ -2,7 +2,6 @@ import argparse import yaml import json -import requests from pathlib import Path from os import environ from dataclasses import dataclass From af33d61364d68e880c99479f37dc77cbc3c90e07 Mon Sep 17 00:00:00 2001 From: Nikolay Akhmetov Date: Tue, 19 Dec 2023 10:18:04 -0500 Subject: [PATCH 15/19] add test for `get_ancestor_assaytype` --- test/test_builders.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/test/test_builders.py b/test/test_builders.py index f84ad9d..dfc1b71 100644 --- a/test/test_builders.py +++ b/test/test_builders.py @@ -9,7 +9,7 @@ import pytest import zarr -from src.portal_visualization.builder_factory import get_view_config_builder, has_visualization +from src.portal_visualization.builder_factory import get_ancestor_assaytypes, get_view_config_builder, has_visualization def str_presenter(dumper, data): @@ -30,6 +30,10 @@ class MockResponse: good_entity_paths = list((Path(__file__).parent / 'good-fixtures').glob("*/*-entity.json")) assert len(good_entity_paths) > 0 +image_pyramids = ["IMSViewConfBuilder", "SeqFISHViewConfBuilder", "NanoDESIViewConfBuilder"] +image_pyramid_paths = [path for path in good_entity_paths if path.parent.name in image_pyramids] +assert len(image_pyramid_paths) > 0 + bad_entity_paths = list((Path(__file__).parent / 'bad-fixtures').glob("*-entity.json")) assert len(bad_entity_paths) > 0 @@ -155,6 +159,14 @@ def clean_cells(cells): ] +@pytest.mark.parametrize( + "entity_path", image_pyramid_paths, ids=lambda path: f'{path.parent.name}/{path.name}') +def test_get_ancestor_assaytype(entity_path): + entity = json.loads(entity_path.read_text()) + ancestor_assaytypes = get_ancestor_assaytypes(entity, get_assaytype) + assert len(ancestor_assaytypes) > 0 + + if __name__ == '__main__': # pragma: no cover parser = argparse.ArgumentParser(description='Generate fixtures') parser.add_argument( From 7e8b65581fb2ca66e545ddadce829592ba09a84b Mon Sep 17 00:00:00 2001 From: Nikolay Akhmetov Date: Tue, 19 Dec 2023 10:22:18 -0500 Subject: [PATCH 16/19] lint --- test/test_builders.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/test_builders.py b/test/test_builders.py index dfc1b71..e99b1d8 100644 --- a/test/test_builders.py +++ b/test/test_builders.py @@ -9,7 +9,8 @@ import pytest import zarr -from src.portal_visualization.builder_factory import get_ancestor_assaytypes, get_view_config_builder, has_visualization +from src.portal_visualization.builder_factory \ + import get_ancestor_assaytypes, get_view_config_builder, has_visualization def str_presenter(dumper, data): From 68685c60f31cb3c917b66280fb02243ab9774abf Mon Sep 17 00:00:00 2001 From: Nikolay Akhmetov Date: Tue, 19 Dec 2023 10:33:05 -0500 Subject: [PATCH 17/19] remove unused line from get_assaytype --- test/test_builders.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/test/test_builders.py b/test/test_builders.py index e99b1d8..351303b 100644 --- a/test/test_builders.py +++ b/test/test_builders.py @@ -54,8 +54,6 @@ def get_assaytype(entity): if uuid is None: return default_assaytype assay = json.loads(assaytypes_path.joinpath(f'{uuid}.json').read_text()) - if assay is None: - return default_assaytype return assay From c09da0542ce950c21d7fb8958270ea2e5b612527 Mon Sep 17 00:00:00 2001 From: Nikolay Akhmetov Date: Tue, 19 Dec 2023 13:00:39 -0500 Subject: [PATCH 18/19] update default API endpoint to prod --- src/defaults.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/defaults.json b/src/defaults.json index 60cd613..16ce4d4 100644 --- a/src/defaults.json +++ b/src/defaults.json @@ -1,4 +1,4 @@ { "assets_url": "https://assets.hubmapconsortium.org", - "assaytypes_url": "https://ingest-api.dev.hubmapconsortium.org/assaytype/" + "assaytypes_url": "https://ingest.api.hubmapconsortium.org/assaytype/" } \ No newline at end of file From 011c2f7334065c4f7fe37ed5ae222bb7608ce39c Mon Sep 17 00:00:00 2001 From: Nikolay Akhmetov Date: Tue, 19 Dec 2023 13:07:22 -0500 Subject: [PATCH 19/19] update readme --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 09d520c..9c5f66e 100644 --- a/README.md +++ b/README.md @@ -31,8 +31,8 @@ optional arguments: -h, --help show this help message and exit --url URL URL which returns Dataset JSON --json JSON File containing Dataset JSON - --assaytypes_url URL AssayType service; default: https://ingest- - api.dev.hubmapconsortium.org/assaytype/ + --assaytypes_url URL AssayType service; default: + https://ingest.api.hubmapconsortium.org/assaytype/ --assets_url URL Assets endpoint; default: https://assets.hubmapconsortium.org --token TOKEN Globus groups token; Only needed if data is not public