From 62ca8c9b903d52af865d0349e1dc98efdd9a45a9 Mon Sep 17 00:00:00 2001 From: John Conroy <62477388+john-conroy@users.noreply.github.com> Date: Thu, 12 Dec 2024 09:48:23 -0500 Subject: [PATCH 1/6] John conroy/get assay replacement (#100) * Get assay type from doc not soft assay * Update readme * Update fixtures * handle case where epic fixture gets pulled in to `has_visualization` test --------- Co-authored-by: John Conroy Co-authored-by: Nikolay Akhmetov --- README.md | 32 ++++++------ src/defaults.json | 1 - src/portal_visualization/builder_factory.py | 15 +++--- src/portal_visualization/client.py | 38 +------------- src/vis-preview.py | 21 +------- .../04e7385339167e541ad42a2636e18398.json | 5 +- .../210d118a14c8624b6bb9610a9062656e.json | 5 +- .../272789a950b2b5d4b9387a1cf66ad487.json | 6 +-- .../2a590db3d7ab1e1512816b165d95cdcf.json | 5 +- .../2c2179ea741d3bbb47772172a316a2bf.json | 7 +-- .../3bc3ad124014a632d558255626bf38c9.json | 7 +-- .../43213991a54ce196d406707ffe2e86bd.json | 5 +- .../6b93107731199733f266bbd0f3bc9747.json | 7 +-- .../72ec02cf1390428c1e9dc2c88928f5f5.json | 6 +-- .../8adc3c31ca84ec4b958ed20a7c4f4919.json | 8 +-- .../9db61adfc017670a196ea9b3ca1852a0.json | 5 +- .../a6116772446f6d1c1f6b3d2e9735cfe0.json | 5 +- .../b69d1e2ad1bf1455eee991fce301b191.json | 5 +- .../c019a1cd35aab4d2b4a6ff221e92aaab.json | 5 +- .../c3be5650e93907b68ddbdb22b948db32.json | 5 +- .../c6a254b2dc2ed46b002500ade163a7cc.json | 7 +-- .../d4493657cde29702c5ed73932da5317c.json | 5 +- .../df7cac7cb67a822f7007b57c4d8f5e7d.json | 10 +--- .../e1c4370da5523ab5c9be581d1d76ca20.json | 5 +- .../e65175561b4b17da5352e3837aa0e497.json | 5 +- .../ea4cfecb8495b36694d9a951510dc3c6.json | 5 +- .../f9ae931b8b49252f150d7f8bf1d2d13f-bad.json | 5 +- .../f9ae931b8b49252f150d7f8bf1d2d13f.json | 5 +- ...t-annotated-published-no-files-entity.json | 7 ++- .../image-pyramid-missing-ometiff-entity.json | 8 ++- test/bad-fixtures/missing-files-entity.json | 7 ++- test/bad-fixtures/scatterplot-entity.json | 8 ++- .../seqfish-missing-ometiff-entity.json | 8 ++- ...itched-cytokit-missing-ometiff-entity.json | 8 ++- .../stitched-cytokit-missing-reg-entity.json | 8 ++- ...titched-cytokit-missing-zgroup-entity.json | 8 ++- test/bad-fixtures/with-cells-entity.json | 9 +++- .../ATACSeqViewConfBuilder/fake-entity.json | 7 ++- .../IMSViewConfBuilder/fake-entity.json | 4 +- .../fake-entity.json | 49 +++++++++---------- .../fake-marker=gene123-entity.json | 4 +- .../fake-multiome-entity.json | 9 +++- .../fake-multiome-is-annotated-entity.json | 9 +++- .../NanoDESIViewConfBuilder/fake-entity.json | 8 ++- .../NullViewConfBuilder/empty-entity.json | 4 +- .../fake-no-support-entity.json | 4 +- ...ke-asct-is-annotated-published-entity.json | 7 ++- .../fake-asct-is-annotated-qa-entity.json | 7 ++- ...ake-is-not-annotated-published-entity.json | 7 ++- .../fake-is-not-annotated-qa-entity.json | 7 ++- ...d-label-is-annotated-published-entity.json | 7 ++- ...redicted-label-is-annotated-qa-entity.json | 7 ++- .../RNASeqViewConfBuilder/fake-entity.json | 8 ++- .../SegmentationMaskBuilder/fake-entity.json | 3 +- .../SeqFISHViewConfBuilder/fake-entity.json | 8 ++- .../fake-visium-entity.json | 9 +++- ...4d9a951510dc3c6-marker=gene123-entity.json | 7 ++- ...e7385339167e541ad42a2636e18398-entity.json | 8 ++- .../no-cells-entity.json | 9 +++- .../with-cells-entity.json | 9 +++- test/test_builders.py | 41 +++++++++------- 61 files changed, 287 insertions(+), 266 deletions(-) diff --git a/README.md b/README.md index 9df0233..1e736b6 100644 --- a/README.md +++ b/README.md @@ -21,27 +21,25 @@ $ cd portal-visualization $ pip install . ... $ src/vis-preview.py --help -usage: vis-preview.py [-h] (--url URL | --json JSON) [--assaytypes_url URL] - [--assets_url URL] [--token TOKEN] [--marker MARKER] - [--to_json] [--epic_uuid UUID] [--parent_uuid UUID] +usage: vis-preview.py [-h] (--url URL | --json JSON) [--assets_url URL] + [--token TOKEN] [--marker MARKER] [--to_json] + [--epic_uuid UUID] [--parent_uuid UUID] 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 - --assaytypes_url URL AssayType service; default: https://ingest- - api.dev.hubmapconsortium.org/assaytype/ - --assets_url URL Assets endpoint; default: - https://assets.dev.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. - --epic_uuid UUID uuid of the EPIC dataset. - --parent_uuid UUID Parent uuid - Only needed for an image-pyramid support - dataset. + -h, --help show this help message and exit + --url URL URL which returns Dataset JSON + --json JSON File containing Dataset JSON + --assets_url URL Assets endpoint; default: + https://assets.dev.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. + --epic_uuid UUID uuid of the EPIC dataset. + --parent_uuid UUID Parent uuid - Only needed for an image-pyramid support + dataset. ``` diff --git a/src/defaults.json b/src/defaults.json index 2750767..46f9564 100644 --- a/src/defaults.json +++ b/src/defaults.json @@ -1,5 +1,4 @@ { "assets_url": "https://assets.dev.hubmapconsortium.org", - "assaytypes_url": "https://ingest-api.dev.hubmapconsortium.org/assaytype/", "dataset_url":"https://portal.dev.hubmapconsortium.org/browse/dataset/" } \ No newline at end of file diff --git a/src/portal_visualization/builder_factory.py b/src/portal_visualization/builder_factory.py index e6c6705..9e6c61b 100644 --- a/src/portal_visualization/builder_factory.py +++ b/src/portal_visualization/builder_factory.py @@ -52,14 +52,11 @@ def process_hints(hints): # 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 -# a dict containing the assaytype and vitessce-hints for that entity. -def get_view_config_builder(entity, get_assaytype, parent=None, epic_uuid=None): +def get_view_config_builder(entity, get_entity, parent=None, epic_uuid=None): if entity.get("uuid") is None: raise ValueError("Provided entity does not have a uuid") - assay = get_assaytype(entity.get('uuid')) - assay_name = assay.get("assaytype") - hints = assay.get("vitessce-hints", []) + assay_name = entity.get("soft_assaytype") + hints = entity.get("vitessce-hints", []) ( is_image, is_rna, @@ -79,7 +76,7 @@ def get_view_config_builder(entity, get_assaytype, parent=None, epic_uuid=None): return SegImagePyramidViewConfBuilder elif is_support and is_image: - ancestor_assaytype = get_assaytype(parent).get("assaytype") + ancestor_assaytype = get_entity(parent).get("soft_assaytype") if SEQFISH == ancestor_assaytype: # e.g. parent = c6a254b2dc2ed46b002500ade163a7cc # e.g. support = 9db61adfc017670a196ea9b3ca1852a0 @@ -138,6 +135,6 @@ def get_view_config_builder(entity, get_assaytype, parent=None, epic_uuid=None): return NullViewConfBuilder -def has_visualization(entity, get_assaytype, parent=None, epic_uuid=None): - builder = get_view_config_builder(entity, get_assaytype, parent, epic_uuid) +def has_visualization(entity, get_entity, parent=None, epic_uuid=None): + builder = get_view_config_builder(entity, get_entity, parent, epic_uuid) return builder != NullViewConfBuilder diff --git a/src/portal_visualization/client.py b/src/portal_visualization/client.py index 007520b..e377e95 100644 --- a/src/portal_visualization/client.py +++ b/src/portal_visualization/client.py @@ -246,7 +246,7 @@ def get_vitessce_conf_cells_and_lifted_uuid( # Otherwise, just try to visualize the data for the entity itself: else: # pragma: no cover # We have separate tests for the builder logic try: - Builder = get_view_config_builder(entity, self._get_assaytype(), parent, epic_uuid) + Builder = get_view_config_builder(entity, self.get_entity(), parent, epic_uuid) builder = Builder(entity, self.groups_token, self.assets_endpoint) vitessce_conf = builder.get_conf_cells(marker=marker) except Exception as e: @@ -272,42 +272,6 @@ def get_vitessce_conf_cells_and_lifted_uuid( vitessce_conf=vitessce_conf, vis_lifted_uuid=vis_lifted_uuid ) - # Helper to create a function that fetches assaytype from the API with current headers - def _get_assaytype(self): # pragma: no cover - def get_assaytype(param): - if isinstance(param, str): - uuid = param - else: - uuid = param.get("uuid") - - url = f"{self.soft_assay_url}/{uuid}" - headers = self._get_headers() - try: - response = requests.get(url, headers=headers) - return response.json() - except Exception as e: - # Redact Authorization header from logs - cleaned_headers = self._clean_headers(headers) - if response: - status = response.status_code - else: - status = None - current_app.logger.error( - { - "source": "get_assaytype", - "url": url, - "headers": cleaned_headers, - "status": status, - "error": str(e), - } - ) - current_app.logger.error( - f"Fetching assaytype threw error: {traceback.format_exc()}" - ) - raise e - - return get_assaytype - def _file_request(self, url): headers = ( {"Authorization": "Bearer " + self.groups_token} diff --git a/src/vis-preview.py b/src/vis-preview.py index 4fd0bc8..86ca999 100755 --- a/src/vis-preview.py +++ b/src/vis-preview.py @@ -16,7 +16,6 @@ def main(): # pragma: no cover defaults = json.load((Path(__file__).parent / 'defaults.json').open()) 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.''') @@ -26,10 +25,6 @@ def main(): # pragma: no cover input.add_argument( '--json', type=Path, help='File containing Dataset JSON') - parser.add_argument( - '--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,21 +55,7 @@ def main(): # pragma: no cover headers = get_headers(args.token) entity = get_entity(args.url, args.json, headers) - def get_assaytype(uuid): - try: - response = requests.get(f'{defaults["assaytypes_url"]}{uuid}', headers=headers) - if response.status_code != 200: - print(f"Error: Received status code {response.status_code}") - else: - try: - data = response.json() - return data - except Exception as e: - print(f"Error in parsing the response {str(e)}") - except Exception as e: - print(f"Error accessing {defaults['assaytypes_url']}{uuid}: {str(e)}") - - Builder = get_view_config_builder(entity, get_assaytype, parent_uuid, epic_uuid) + Builder = get_view_config_builder(entity, get_entity, parent_uuid, epic_uuid) 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/assaytype-fixtures/04e7385339167e541ad42a2636e18398.json b/test/assaytype-fixtures/04e7385339167e541ad42a2636e18398.json index a90bf37..e55f76e 100644 --- a/test/assaytype-fixtures/04e7385339167e541ad42a2636e18398.json +++ b/test/assaytype-fixtures/04e7385339167e541ad42a2636e18398.json @@ -1,8 +1,5 @@ { - "assaytype": "codex_cytokit_v1", - "contains-pii": false, - "description": "CODEX [Cytokit + SPRM]", - "primary": false, + "soft_assaytype": "codex_cytokit_v1", "vitessce-hints": [ "codex", "is_image", diff --git a/test/assaytype-fixtures/210d118a14c8624b6bb9610a9062656e.json b/test/assaytype-fixtures/210d118a14c8624b6bb9610a9062656e.json index f4428c7..ce77055 100644 --- a/test/assaytype-fixtures/210d118a14c8624b6bb9610a9062656e.json +++ b/test/assaytype-fixtures/210d118a14c8624b6bb9610a9062656e.json @@ -1,8 +1,5 @@ { - "assaytype": "sn_atac_seq", - "contains-pii": false, - "description": "snATAC-seq [SnapATAC]", - "primary": false, + "soft_assaytype": "sn_atac_seq", "vitessce-hints": [ "is_sc", "atac" diff --git a/test/assaytype-fixtures/272789a950b2b5d4b9387a1cf66ad487.json b/test/assaytype-fixtures/272789a950b2b5d4b9387a1cf66ad487.json index d20ebff..66153c9 100644 --- a/test/assaytype-fixtures/272789a950b2b5d4b9387a1cf66ad487.json +++ b/test/assaytype-fixtures/272789a950b2b5d4b9387a1cf66ad487.json @@ -1,9 +1,5 @@ { - "assaytype": "multiome-10x", - "contains-pii": false, - "description": "10X Multiome [Salmon + ArchR + Muon]", - "is-multi-assay": true, - "primary": false, + "soft_assaytype": "multiome-10x", "vitessce-hints": [ "is_sc", "rna", diff --git a/test/assaytype-fixtures/2a590db3d7ab1e1512816b165d95cdcf.json b/test/assaytype-fixtures/2a590db3d7ab1e1512816b165d95cdcf.json index 7c83925..ab4a9dd 100644 --- a/test/assaytype-fixtures/2a590db3d7ab1e1512816b165d95cdcf.json +++ b/test/assaytype-fixtures/2a590db3d7ab1e1512816b165d95cdcf.json @@ -1,8 +1,5 @@ { - "assaytype": "salmon_rnaseq_slideseq", - "contains-pii": false, - "description": "Slide-seq [Salmon]", - "primary": false, + "soft_assaytype": "salmon_rnaseq_slideseq", "vitessce-hints": [ "is_sc", "rna" diff --git a/test/assaytype-fixtures/2c2179ea741d3bbb47772172a316a2bf.json b/test/assaytype-fixtures/2c2179ea741d3bbb47772172a316a2bf.json index 65875e4..929f918 100644 --- a/test/assaytype-fixtures/2c2179ea741d3bbb47772172a316a2bf.json +++ b/test/assaytype-fixtures/2c2179ea741d3bbb47772172a316a2bf.json @@ -1,9 +1,4 @@ { - "assaytype": "bulk-RNA", - "contains-pii": true, - "description": "Bulk RNA-seq", - "dir-schema": "bulkrnaseq-v0", - "primary": true, - "tbl-schema": "bulkrnaseq-v0", + "soft_assaytype": "bulk-RNA", "vitessce-hints": [] } \ No newline at end of file diff --git a/test/assaytype-fixtures/3bc3ad124014a632d558255626bf38c9.json b/test/assaytype-fixtures/3bc3ad124014a632d558255626bf38c9.json index 5ec9ffb..fe09e20 100644 --- a/test/assaytype-fixtures/3bc3ad124014a632d558255626bf38c9.json +++ b/test/assaytype-fixtures/3bc3ad124014a632d558255626bf38c9.json @@ -1,10 +1,5 @@ { - "assaytype": "MALDI-IMS", - "contains-pii": false, - "description": "MALDI IMS", - "dir-schema": "ims-v0", - "primary": true, - "tbl-schema": "ims-v2", + "soft_assaytype": "MALDI-IMS", "vitessce-hints": [ "maldi" ] diff --git a/test/assaytype-fixtures/43213991a54ce196d406707ffe2e86bd.json b/test/assaytype-fixtures/43213991a54ce196d406707ffe2e86bd.json index c0398c4..bacd74c 100644 --- a/test/assaytype-fixtures/43213991a54ce196d406707ffe2e86bd.json +++ b/test/assaytype-fixtures/43213991a54ce196d406707ffe2e86bd.json @@ -1,8 +1,5 @@ { - "assaytype": "codex_cytokit_v1", - "contains-pii": false, - "description": "CODEX [Cytokit + SPRM]", - "primary": false, + "soft_assaytype": "codex_cytokit_v1", "vitessce-hints": [ "codex", "is_image", diff --git a/test/assaytype-fixtures/6b93107731199733f266bbd0f3bc9747.json b/test/assaytype-fixtures/6b93107731199733f266bbd0f3bc9747.json index 3dc9a01..fff7202 100644 --- a/test/assaytype-fixtures/6b93107731199733f266bbd0f3bc9747.json +++ b/test/assaytype-fixtures/6b93107731199733f266bbd0f3bc9747.json @@ -1,9 +1,4 @@ { - "assaytype": "NanoDESI", - "contains-pii": false, - "description": "NanoDESI", - "dir-schema": "ims-v0", - "primary": true, - "tbl-schema": "ims-v2", + "soft_assaytype": "NanoDESI", "vitessce-hints": [] } \ No newline at end of file diff --git a/test/assaytype-fixtures/72ec02cf1390428c1e9dc2c88928f5f5.json b/test/assaytype-fixtures/72ec02cf1390428c1e9dc2c88928f5f5.json index f8e2ba1..8cfdf43 100644 --- a/test/assaytype-fixtures/72ec02cf1390428c1e9dc2c88928f5f5.json +++ b/test/assaytype-fixtures/72ec02cf1390428c1e9dc2c88928f5f5.json @@ -1,9 +1,5 @@ { - "assaytype": "visium-no-probes", - "contains-pii": false, - "description": "Visium (no probes) [Salmon + Scanpy]", - "is-multi-assay": true, - "primary": false, + "soft_assaytype": "visium-no-probes", "vitessce-hints": [ "rna", "is_image", diff --git a/test/assaytype-fixtures/8adc3c31ca84ec4b958ed20a7c4f4919.json b/test/assaytype-fixtures/8adc3c31ca84ec4b958ed20a7c4f4919.json index 2c5ad7a..70ecab8 100644 --- a/test/assaytype-fixtures/8adc3c31ca84ec4b958ed20a7c4f4919.json +++ b/test/assaytype-fixtures/8adc3c31ca84ec4b958ed20a7c4f4919.json @@ -1,10 +1,4 @@ { - "assaytype": "PAS", - "contains-pii": false, - "dataset-type": "Histology", - "description": "PAS Stained Microscopy", - "dir-schema": "stained-v0", - "primary": true, - "tbl-schema": "stained-v0", + "soft_assaytype": "PAS", "vitessce-hints": [] } \ No newline at end of file diff --git a/test/assaytype-fixtures/9db61adfc017670a196ea9b3ca1852a0.json b/test/assaytype-fixtures/9db61adfc017670a196ea9b3ca1852a0.json index 22fd1ec..e9917a9 100644 --- a/test/assaytype-fixtures/9db61adfc017670a196ea9b3ca1852a0.json +++ b/test/assaytype-fixtures/9db61adfc017670a196ea9b3ca1852a0.json @@ -1,8 +1,5 @@ { - "assaytype": "image_pyramid", - "contains-pii": false, - "description": "Image Pyramid", - "primary": false, + "soft_assaytype": "image_pyramid", "vitessce-hints": [ "is_image", "pyramid", diff --git a/test/assaytype-fixtures/a6116772446f6d1c1f6b3d2e9735cfe0.json b/test/assaytype-fixtures/a6116772446f6d1c1f6b3d2e9735cfe0.json index 22fd1ec..e9917a9 100644 --- a/test/assaytype-fixtures/a6116772446f6d1c1f6b3d2e9735cfe0.json +++ b/test/assaytype-fixtures/a6116772446f6d1c1f6b3d2e9735cfe0.json @@ -1,8 +1,5 @@ { - "assaytype": "image_pyramid", - "contains-pii": false, - "description": "Image Pyramid", - "primary": false, + "soft_assaytype": "image_pyramid", "vitessce-hints": [ "is_image", "pyramid", diff --git a/test/assaytype-fixtures/b69d1e2ad1bf1455eee991fce301b191.json b/test/assaytype-fixtures/b69d1e2ad1bf1455eee991fce301b191.json index 7ec00d7..fd42205 100644 --- a/test/assaytype-fixtures/b69d1e2ad1bf1455eee991fce301b191.json +++ b/test/assaytype-fixtures/b69d1e2ad1bf1455eee991fce301b191.json @@ -1,8 +1,5 @@ { - "assaytype": "codex_cytokit_v1", - "contains-pii": false, - "description": "CODEX [Cytokit + SPRM]", - "primary": false, + "soft_assaytype": "codex_cytokit_v1", "vitessce-hints": [ "codex", "is_image", diff --git a/test/assaytype-fixtures/c019a1cd35aab4d2b4a6ff221e92aaab.json b/test/assaytype-fixtures/c019a1cd35aab4d2b4a6ff221e92aaab.json index 0ad1c34..c07fecd 100644 --- a/test/assaytype-fixtures/c019a1cd35aab4d2b4a6ff221e92aaab.json +++ b/test/assaytype-fixtures/c019a1cd35aab4d2b4a6ff221e92aaab.json @@ -1,8 +1,5 @@ { - "assaytype": "salmon_sn_rnaseq_10x", - "contains-pii": false, - "description": "snRNA-seq [Salmon]", - "primary": false, + "soft_assaytype": "salmon_sn_rnaseq_10x", "vitessce-hints": [ "is_sc", "rna", diff --git a/test/assaytype-fixtures/c3be5650e93907b68ddbdb22b948db32.json b/test/assaytype-fixtures/c3be5650e93907b68ddbdb22b948db32.json index 5cd7eed..2066903 100644 --- a/test/assaytype-fixtures/c3be5650e93907b68ddbdb22b948db32.json +++ b/test/assaytype-fixtures/c3be5650e93907b68ddbdb22b948db32.json @@ -1,8 +1,5 @@ { - "assaytype": "celldive_deepcell", - "contains-pii": false, - "description": "CellDIVE [DeepCell + SPRM]", - "primary": false, + "soft_assaytype": "celldive_deepcell", "vitessce-hints": [ "sprm", "anndata", diff --git a/test/assaytype-fixtures/c6a254b2dc2ed46b002500ade163a7cc.json b/test/assaytype-fixtures/c6a254b2dc2ed46b002500ade163a7cc.json index 7269a62..84451c3 100644 --- a/test/assaytype-fixtures/c6a254b2dc2ed46b002500ade163a7cc.json +++ b/test/assaytype-fixtures/c6a254b2dc2ed46b002500ade163a7cc.json @@ -1,9 +1,4 @@ { - "assaytype": "seqFish", - "contains-pii": false, - "description": "seqFISH", - "dir-schema": "seqfish-v0", - "primary": true, - "tbl-schema": "seqfish-v0", + "soft_assaytype": "seqFish", "vitessce-hints": [] } \ No newline at end of file diff --git a/test/assaytype-fixtures/d4493657cde29702c5ed73932da5317c.json b/test/assaytype-fixtures/d4493657cde29702c5ed73932da5317c.json index f924f64..ad5a39a 100644 --- a/test/assaytype-fixtures/d4493657cde29702c5ed73932da5317c.json +++ b/test/assaytype-fixtures/d4493657cde29702c5ed73932da5317c.json @@ -1,8 +1,5 @@ { - "assaytype": "sc_atac_seq_sci", - "contains-pii": false, - "description": "sciATAC-seq [SnapATAC]", - "primary": false, + "soft_assaytype": "sc_atac_seq_sci", "vitessce-hints": [ "is_sc", "atac" diff --git a/test/assaytype-fixtures/df7cac7cb67a822f7007b57c4d8f5e7d.json b/test/assaytype-fixtures/df7cac7cb67a822f7007b57c4d8f5e7d.json index 42fa57b..b54b535 100644 --- a/test/assaytype-fixtures/df7cac7cb67a822f7007b57c4d8f5e7d.json +++ b/test/assaytype-fixtures/df7cac7cb67a822f7007b57c4d8f5e7d.json @@ -1,9 +1,3 @@ { - "contains-pii": false, - "dataset-type": "Histology", - "description": "Segmentation Mask", - "dir-schema": "stained-v0", - "primary": true, - "tbl-schema": "stained-v0", - "vitessce-hints": ["segmentation_mask","is_image","pyramid"] - } \ No newline at end of file + "vitessce-hints": ["segmentation_mask", "is_image", "pyramid"] +} diff --git a/test/assaytype-fixtures/e1c4370da5523ab5c9be581d1d76ca20.json b/test/assaytype-fixtures/e1c4370da5523ab5c9be581d1d76ca20.json index 22fd1ec..e9917a9 100644 --- a/test/assaytype-fixtures/e1c4370da5523ab5c9be581d1d76ca20.json +++ b/test/assaytype-fixtures/e1c4370da5523ab5c9be581d1d76ca20.json @@ -1,8 +1,5 @@ { - "assaytype": "image_pyramid", - "contains-pii": false, - "description": "Image Pyramid", - "primary": false, + "soft_assaytype": "image_pyramid", "vitessce-hints": [ "is_image", "pyramid", diff --git a/test/assaytype-fixtures/e65175561b4b17da5352e3837aa0e497.json b/test/assaytype-fixtures/e65175561b4b17da5352e3837aa0e497.json index b5ecda7..c1f3296 100644 --- a/test/assaytype-fixtures/e65175561b4b17da5352e3837aa0e497.json +++ b/test/assaytype-fixtures/e65175561b4b17da5352e3837aa0e497.json @@ -1,8 +1,5 @@ { - "assaytype": "salmon_sn_rnaseq_10x", - "contains-pii": false, - "description": "snRNA-seq [Salmon]", - "primary": false, + "soft_assaytype": "salmon_sn_rnaseq_10x", "vitessce-hints": [ "is_sc", "rna" diff --git a/test/assaytype-fixtures/ea4cfecb8495b36694d9a951510dc3c6.json b/test/assaytype-fixtures/ea4cfecb8495b36694d9a951510dc3c6.json index 7c83925..ab4a9dd 100644 --- a/test/assaytype-fixtures/ea4cfecb8495b36694d9a951510dc3c6.json +++ b/test/assaytype-fixtures/ea4cfecb8495b36694d9a951510dc3c6.json @@ -1,8 +1,5 @@ { - "assaytype": "salmon_rnaseq_slideseq", - "contains-pii": false, - "description": "Slide-seq [Salmon]", - "primary": false, + "soft_assaytype": "salmon_rnaseq_slideseq", "vitessce-hints": [ "is_sc", "rna" diff --git a/test/assaytype-fixtures/f9ae931b8b49252f150d7f8bf1d2d13f-bad.json b/test/assaytype-fixtures/f9ae931b8b49252f150d7f8bf1d2d13f-bad.json index 7f71a34..e281c91 100644 --- a/test/assaytype-fixtures/f9ae931b8b49252f150d7f8bf1d2d13f-bad.json +++ b/test/assaytype-fixtures/f9ae931b8b49252f150d7f8bf1d2d13f-bad.json @@ -1,7 +1,4 @@ { - "assaytype": "image_pyramid", - "contains-pii": false, - "description": "Image Pyramid", - "primary": false, + "soft_assaytype": "image_pyramid", "vitessce-hints": [] } \ No newline at end of file diff --git a/test/assaytype-fixtures/f9ae931b8b49252f150d7f8bf1d2d13f.json b/test/assaytype-fixtures/f9ae931b8b49252f150d7f8bf1d2d13f.json index 220c290..846f2fa 100644 --- a/test/assaytype-fixtures/f9ae931b8b49252f150d7f8bf1d2d13f.json +++ b/test/assaytype-fixtures/f9ae931b8b49252f150d7f8bf1d2d13f.json @@ -1,8 +1,5 @@ { - "assaytype": "image_pyramid", - "contains-pii": false, - "description": "Image Pyramid", - "primary": false, + "soft_assaytype": "image_pyramid", "vitessce-hints": [ "is_image", "is_support", 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 83b032c..02650f2 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,10 @@ ] }, "status": "Published", - "uuid": "2a590db3d7ab1e1512816b165d95cdcf" + "uuid": "2a590db3d7ab1e1512816b165d95cdcf", + "soft_assaytype": "salmon_rnaseq_slideseq", + "vitessce-hints": [ + "is_sc", + "rna" + ] } diff --git a/test/bad-fixtures/image-pyramid-missing-ometiff-entity.json b/test/bad-fixtures/image-pyramid-missing-ometiff-entity.json index 28e3023..9bdcf89 100644 --- a/test/bad-fixtures/image-pyramid-missing-ometiff-entity.json +++ b/test/bad-fixtures/image-pyramid-missing-ometiff-entity.json @@ -6,5 +6,11 @@ } ], "uuid": "f9ae931b8b49252f150d7f8bf1d2d13f", - "parent": { "uuid": "8adc3c31ca84ec4b958ed20a7c4f4919" } + "parent": { "uuid": "8adc3c31ca84ec4b958ed20a7c4f4919" }, + "soft_assaytype": "image_pyramid", + "vitessce-hints": [ + "is_image", + "is_support", + "pyramid" + ] } diff --git a/test/bad-fixtures/missing-files-entity.json b/test/bad-fixtures/missing-files-entity.json index 5b90e45..576b0a0 100644 --- a/test/bad-fixtures/missing-files-entity.json +++ b/test/bad-fixtures/missing-files-entity.json @@ -6,5 +6,10 @@ "files": [ ], "uuid": "210d118a14c8624b6bb9610a9062656e", - "metadata": {"dag_provenance_list": []} + "metadata": {"dag_provenance_list": []}, + "soft_assaytype": "sn_atac_seq", + "vitessce-hints": [ + "is_sc", + "atac" + ] } \ No newline at end of file diff --git a/test/bad-fixtures/scatterplot-entity.json b/test/bad-fixtures/scatterplot-entity.json index a6e9437..1fbdc7f 100644 --- a/test/bad-fixtures/scatterplot-entity.json +++ b/test/bad-fixtures/scatterplot-entity.json @@ -10,5 +10,11 @@ "dag_provenance_list": [] }, "status": "Published", - "uuid": "c019a1cd35aab4d2b4a6ff221e92aaab" + "uuid": "c019a1cd35aab4d2b4a6ff221e92aaab", + "soft_assaytype": "salmon_sn_rnaseq_10x", + "vitessce-hints": [ + "is_sc", + "rna", + "json_based" + ] } diff --git a/test/bad-fixtures/seqfish-missing-ometiff-entity.json b/test/bad-fixtures/seqfish-missing-ometiff-entity.json index 2f7f795..286c3c3 100644 --- a/test/bad-fixtures/seqfish-missing-ometiff-entity.json +++ b/test/bad-fixtures/seqfish-missing-ometiff-entity.json @@ -16,5 +16,11 @@ } ], "uuid": "9db61adfc017670a196ea9b3ca1852a0", - "parent": {"uuid": "c6a254b2dc2ed46b002500ade163a7cc"} + "parent": {"uuid": "c6a254b2dc2ed46b002500ade163a7cc"}, + "soft_assaytype": "image_pyramid", + "vitessce-hints": [ + "is_image", + "pyramid", + "is_support" + ] } diff --git a/test/bad-fixtures/stitched-cytokit-missing-ometiff-entity.json b/test/bad-fixtures/stitched-cytokit-missing-ometiff-entity.json index 8bdbcad..b7aa21e 100644 --- a/test/bad-fixtures/stitched-cytokit-missing-ometiff-entity.json +++ b/test/bad-fixtures/stitched-cytokit-missing-ometiff-entity.json @@ -32,5 +32,11 @@ ] }, "status": "Published", - "uuid": "04e7385339167e541ad42a2636e18398" + "uuid": "04e7385339167e541ad42a2636e18398", + "soft_assaytype": "codex_cytokit_v1", + "vitessce-hints": [ + "codex", + "is_image", + "is_tiled" + ] } diff --git a/test/bad-fixtures/stitched-cytokit-missing-reg-entity.json b/test/bad-fixtures/stitched-cytokit-missing-reg-entity.json index 5f5a624..660c7ab 100644 --- a/test/bad-fixtures/stitched-cytokit-missing-reg-entity.json +++ b/test/bad-fixtures/stitched-cytokit-missing-reg-entity.json @@ -38,5 +38,11 @@ ] }, "status": "Published", - "uuid": "04e7385339167e541ad42a2636e18398" + "uuid": "04e7385339167e541ad42a2636e18398", + "soft_assaytype": "codex_cytokit_v1", + "vitessce-hints": [ + "codex", + "is_image", + "is_tiled" + ] } diff --git a/test/bad-fixtures/stitched-cytokit-missing-zgroup-entity.json b/test/bad-fixtures/stitched-cytokit-missing-zgroup-entity.json index 48aa0ed..e86de75 100644 --- a/test/bad-fixtures/stitched-cytokit-missing-zgroup-entity.json +++ b/test/bad-fixtures/stitched-cytokit-missing-zgroup-entity.json @@ -32,5 +32,11 @@ ] }, "status": "Published", - "uuid": "04e7385339167e541ad42a2636e18398" + "uuid": "04e7385339167e541ad42a2636e18398", + "soft_assaytype": "codex_cytokit_v1", + "vitessce-hints": [ + "codex", + "is_image", + "is_tiled" + ] } diff --git a/test/bad-fixtures/with-cells-entity.json b/test/bad-fixtures/with-cells-entity.json index 14c2094..c078558 100644 --- a/test/bad-fixtures/with-cells-entity.json +++ b/test/bad-fixtures/with-cells-entity.json @@ -17,5 +17,12 @@ "dag_provenance_list": [] }, "status": "Published", - "uuid": "b69d1e2ad1bf1455eee991fce301b191" + "uuid": "b69d1e2ad1bf1455eee991fce301b191", + "soft_assaytype": "codex_cytokit_v1", + "vitessce-hints": [ + "codex", + "is_image", + "is_tiled", + "json_based" + ] } diff --git a/test/good-fixtures/ATACSeqViewConfBuilder/fake-entity.json b/test/good-fixtures/ATACSeqViewConfBuilder/fake-entity.json index fed0ed5..3d12129 100644 --- a/test/good-fixtures/ATACSeqViewConfBuilder/fake-entity.json +++ b/test/good-fixtures/ATACSeqViewConfBuilder/fake-entity.json @@ -87,5 +87,10 @@ } ], "uuid": "d4493657cde29702c5ed73932da5317c", - "metadata": {"dag_provenance_list": []} + "metadata": {"dag_provenance_list": []}, + "soft_assaytype": "sc_atac_seq_sci", + "vitessce-hints": [ + "is_sc", + "atac" + ] } \ No newline at end of file diff --git a/test/good-fixtures/IMSViewConfBuilder/fake-entity.json b/test/good-fixtures/IMSViewConfBuilder/fake-entity.json index 231f162..3478bd3 100644 --- a/test/good-fixtures/IMSViewConfBuilder/fake-entity.json +++ b/test/good-fixtures/IMSViewConfBuilder/fake-entity.json @@ -22,5 +22,7 @@ ], "uuid": "a6116772446f6d1c1f6b3d2e9735cfe0", "metadata": {"dag_provenance_list": []}, - "parent": {"uuid": "3bc3ad124014a632d558255626bf38c9"} + "parent": {"uuid": "3bc3ad124014a632d558255626bf38c9"}, + "soft_assaytype": "image_pyramid", + "vitessce-hints": ["is_support", "pyramid", "is_image"] } \ No newline at end of file diff --git a/test/good-fixtures/ImagePyramidViewConfBuilder/fake-entity.json b/test/good-fixtures/ImagePyramidViewConfBuilder/fake-entity.json index afd59d7..492702e 100644 --- a/test/good-fixtures/ImagePyramidViewConfBuilder/fake-entity.json +++ b/test/good-fixtures/ImagePyramidViewConfBuilder/fake-entity.json @@ -1,26 +1,25 @@ { - "data_types": [ - "image_pyramid", - "PAS" - ], - "status": "QA", - "immediate_ancestors": [ - { - "data_types": ["PAS"] - } - ], - "files": [ - { - "rel_path": "ometiff-pyramids/processedMicroscopy/VAN0003-LK-33-2-PAS_FFPE.ome.tif" - }, - { - "rel_path": "ometiff-pyramids/separate/should-be-ignored.ome.tif" - }, - { - "rel_path": "output_offsets/processedMicroscopy/VAN0003-LK-33-2-PAS_FFPE.offsets.json" - } - ], - "uuid": "f9ae931b8b49252f150d7f8bf1d2d13f", - "metadata": {"dag_provenance_list": []}, - "parent": { "uuid": "8adc3c31ca84ec4b958ed20a7c4f4919" } -} \ No newline at end of file + "data_types": ["image_pyramid", "PAS"], + "status": "QA", + "immediate_ancestors": [ + { + "data_types": ["PAS"] + } + ], + "files": [ + { + "rel_path": "ometiff-pyramids/processedMicroscopy/VAN0003-LK-33-2-PAS_FFPE.ome.tif" + }, + { + "rel_path": "ometiff-pyramids/separate/should-be-ignored.ome.tif" + }, + { + "rel_path": "output_offsets/processedMicroscopy/VAN0003-LK-33-2-PAS_FFPE.offsets.json" + } + ], + "uuid": "f9ae931b8b49252f150d7f8bf1d2d13f", + "metadata": { "dag_provenance_list": [] }, + "parent": { "uuid": "8adc3c31ca84ec4b958ed20a7c4f4919" }, + "soft_assaytype": "image_pyramid", + "vitessce-hints": ["is_support", "pyramid", "is_image"] +} diff --git a/test/good-fixtures/MultiImageSPRMAnndataViewConfBuilder/fake-marker=gene123-entity.json b/test/good-fixtures/MultiImageSPRMAnndataViewConfBuilder/fake-marker=gene123-entity.json index 6d6c32d..1e6a363 100644 --- a/test/good-fixtures/MultiImageSPRMAnndataViewConfBuilder/fake-marker=gene123-entity.json +++ b/test/good-fixtures/MultiImageSPRMAnndataViewConfBuilder/fake-marker=gene123-entity.json @@ -55,5 +55,7 @@ } ], "status": "QA", - "uuid": "c3be5650e93907b68ddbdb22b948db32" + "uuid": "c3be5650e93907b68ddbdb22b948db32", + "soft_assaytype": "celldive_deepcell", + "vitessce-hints": ["is_tiled", "is_image", "anndata", "sprm"] } \ No newline at end of file diff --git a/test/good-fixtures/MultiomicAnndataZarrViewConfBuilder/fake-multiome-entity.json b/test/good-fixtures/MultiomicAnndataZarrViewConfBuilder/fake-multiome-entity.json index 2ab7f0d..29a32ac 100644 --- a/test/good-fixtures/MultiomicAnndataZarrViewConfBuilder/fake-multiome-entity.json +++ b/test/good-fixtures/MultiomicAnndataZarrViewConfBuilder/fake-multiome-entity.json @@ -1,4 +1,11 @@ { "uuid": "272789a950b2b5d4b9387a1cf66ad487", - "status": "Published" + "status": "Published", + "soft_assaytype": "multiome-10x", + "vitessce-hints": [ + "is_sc", + "rna", + "atac", + "anndata" + ] } diff --git a/test/good-fixtures/MultiomicAnndataZarrViewConfBuilder/fake-multiome-is-annotated-entity.json b/test/good-fixtures/MultiomicAnndataZarrViewConfBuilder/fake-multiome-is-annotated-entity.json index 2ab7f0d..29a32ac 100644 --- a/test/good-fixtures/MultiomicAnndataZarrViewConfBuilder/fake-multiome-is-annotated-entity.json +++ b/test/good-fixtures/MultiomicAnndataZarrViewConfBuilder/fake-multiome-is-annotated-entity.json @@ -1,4 +1,11 @@ { "uuid": "272789a950b2b5d4b9387a1cf66ad487", - "status": "Published" + "status": "Published", + "soft_assaytype": "multiome-10x", + "vitessce-hints": [ + "is_sc", + "rna", + "atac", + "anndata" + ] } diff --git a/test/good-fixtures/NanoDESIViewConfBuilder/fake-entity.json b/test/good-fixtures/NanoDESIViewConfBuilder/fake-entity.json index 7dfd40c..83367ba 100644 --- a/test/good-fixtures/NanoDESIViewConfBuilder/fake-entity.json +++ b/test/good-fixtures/NanoDESIViewConfBuilder/fake-entity.json @@ -11,5 +11,11 @@ ], "uuid": "e1c4370da5523ab5c9be581d1d76ca20", "metadata": { "dag_provenance_list": [] }, - "parent": { "uuid": "6b93107731199733f266bbd0f3bc9747" } + "parent": { "uuid": "6b93107731199733f266bbd0f3bc9747" }, + "soft_assaytype": "image_pyramid", + "vitessce-hints": [ + "is_image", + "pyramid", + "is_support" + ] } diff --git a/test/good-fixtures/NullViewConfBuilder/empty-entity.json b/test/good-fixtures/NullViewConfBuilder/empty-entity.json index 1d80e2c..4836108 100644 --- a/test/good-fixtures/NullViewConfBuilder/empty-entity.json +++ b/test/good-fixtures/NullViewConfBuilder/empty-entity.json @@ -1,5 +1,7 @@ { "data_types": [], "metadata": {"dag_provenance_list": []}, - "uuid": "2c2179ea741d3bbb47772172a316a2bf" + "uuid": "2c2179ea741d3bbb47772172a316a2bf", + "soft_assaytype": "bulk-RNA", + "vitessce-hints": [] } \ No newline at end of file diff --git a/test/good-fixtures/NullViewConfBuilder/fake-no-support-entity.json b/test/good-fixtures/NullViewConfBuilder/fake-no-support-entity.json index d0450be..597584d 100644 --- a/test/good-fixtures/NullViewConfBuilder/fake-no-support-entity.json +++ b/test/good-fixtures/NullViewConfBuilder/fake-no-support-entity.json @@ -22,5 +22,7 @@ ], "uuid": "f9ae931b8b49252f150d7f8bf1d2d13f-bad", "metadata": {"dag_provenance_list": []}, - "parent": { "uuid": "8adc3c31ca84ec4b958ed20a7c4f4919" } + "parent": { "uuid": "8adc3c31ca84ec4b958ed20a7c4f4919" }, + "soft_assaytype": "PAS", + "vitessce-hints": [] } \ 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 2d83af4..8f5cc58 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,10 @@ ] }, "status": "Published", - "uuid": "e65175561b4b17da5352e3837aa0e497" + "uuid": "e65175561b4b17da5352e3837aa0e497", + "soft_assaytype": "salmon_sn_rnaseq_10x", + "vitessce-hints": [ + "is_sc", + "rna" + ] } 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 ef45960..2dee65c 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,10 @@ ] }, "status": "QA", - "uuid": "e65175561b4b17da5352e3837aa0e497" + "uuid": "e65175561b4b17da5352e3837aa0e497", + "soft_assaytype": "salmon_sn_rnaseq_10x", + "vitessce-hints": [ + "is_sc", + "rna" + ] } 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 2d83af4..8f5cc58 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,10 @@ ] }, "status": "Published", - "uuid": "e65175561b4b17da5352e3837aa0e497" + "uuid": "e65175561b4b17da5352e3837aa0e497", + "soft_assaytype": "salmon_sn_rnaseq_10x", + "vitessce-hints": [ + "is_sc", + "rna" + ] } 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 ef45960..2dee65c 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,10 @@ ] }, "status": "QA", - "uuid": "e65175561b4b17da5352e3837aa0e497" + "uuid": "e65175561b4b17da5352e3837aa0e497", + "soft_assaytype": "salmon_sn_rnaseq_10x", + "vitessce-hints": [ + "is_sc", + "rna" + ] } 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 2d83af4..8f5cc58 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,10 @@ ] }, "status": "Published", - "uuid": "e65175561b4b17da5352e3837aa0e497" + "uuid": "e65175561b4b17da5352e3837aa0e497", + "soft_assaytype": "salmon_sn_rnaseq_10x", + "vitessce-hints": [ + "is_sc", + "rna" + ] } 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 ef45960..2dee65c 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,10 @@ ] }, "status": "QA", - "uuid": "e65175561b4b17da5352e3837aa0e497" + "uuid": "e65175561b4b17da5352e3837aa0e497", + "soft_assaytype": "salmon_sn_rnaseq_10x", + "vitessce-hints": [ + "is_sc", + "rna" + ] } diff --git a/test/good-fixtures/RNASeqViewConfBuilder/fake-entity.json b/test/good-fixtures/RNASeqViewConfBuilder/fake-entity.json index 6fb4fbc..bb1254c 100644 --- a/test/good-fixtures/RNASeqViewConfBuilder/fake-entity.json +++ b/test/good-fixtures/RNASeqViewConfBuilder/fake-entity.json @@ -13,5 +13,11 @@ "dag_provenance_list": [] }, "status": "Published", - "uuid": "c019a1cd35aab4d2b4a6ff221e92aaab" + "uuid": "c019a1cd35aab4d2b4a6ff221e92aaab", + "soft_assaytype": "salmon_sn_rnaseq_10x", + "vitessce-hints": [ + "is_sc", + "rna", + "json_based" + ] } diff --git a/test/good-fixtures/SegmentationMaskBuilder/fake-entity.json b/test/good-fixtures/SegmentationMaskBuilder/fake-entity.json index 0f73138..ec85d0c 100644 --- a/test/good-fixtures/SegmentationMaskBuilder/fake-entity.json +++ b/test/good-fixtures/SegmentationMaskBuilder/fake-entity.json @@ -38,5 +38,6 @@ ], "uuid": "df7cac7cb67a822f7007b57c4d8f5e7d", "metadata": {"dag_provenance_list": []}, - "parent": { "uuid": "22901da5f080b219a514e38381acbb0e" } + "parent": { "uuid": "22901da5f080b219a514e38381acbb0e" }, + "vitessce-hints": ["segmentation_mask", "is_image", "pyramid"] } \ 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 fecbcc1..f954f97 100644 --- a/test/good-fixtures/SeqFISHViewConfBuilder/fake-entity.json +++ b/test/good-fixtures/SeqFISHViewConfBuilder/fake-entity.json @@ -29,5 +29,11 @@ ], "uuid": "9db61adfc017670a196ea9b3ca1852a0", "metadata": { "dag_provenance_list": [] }, - "parent": { "uuid": "c6a254b2dc2ed46b002500ade163a7cc" } + "parent": { "uuid": "c6a254b2dc2ed46b002500ade163a7cc" }, + "soft_assaytype": "image_pyramid", + "vitessce-hints": [ + "is_image", + "pyramid", + "is_support" + ] } diff --git a/test/good-fixtures/SpatialMultiomicAnnDataZarrViewConfBuilder/fake-visium-entity.json b/test/good-fixtures/SpatialMultiomicAnnDataZarrViewConfBuilder/fake-visium-entity.json index 4964c4c..f9437b1 100644 --- a/test/good-fixtures/SpatialMultiomicAnnDataZarrViewConfBuilder/fake-visium-entity.json +++ b/test/good-fixtures/SpatialMultiomicAnnDataZarrViewConfBuilder/fake-visium-entity.json @@ -18,5 +18,12 @@ "origin": "https://github.com/hubmapconsortium/portal-containers" } ] - } + }, + "soft_assaytype": "visium-no-probes", + "vitessce-hints": [ + "rna", + "is_image", + "anndata", + "spatial" + ] } diff --git a/test/good-fixtures/SpatialRNASeqAnnDataZarrViewConfBuilder/ea4cfecb8495b36694d9a951510dc3c6-marker=gene123-entity.json b/test/good-fixtures/SpatialRNASeqAnnDataZarrViewConfBuilder/ea4cfecb8495b36694d9a951510dc3c6-marker=gene123-entity.json index dc464ec..455d566 100644 --- a/test/good-fixtures/SpatialRNASeqAnnDataZarrViewConfBuilder/ea4cfecb8495b36694d9a951510dc3c6-marker=gene123-entity.json +++ b/test/good-fixtures/SpatialRNASeqAnnDataZarrViewConfBuilder/ea4cfecb8495b36694d9a951510dc3c6-marker=gene123-entity.json @@ -24,5 +24,10 @@ ] }, "status": "Published", - "uuid": "ea4cfecb8495b36694d9a951510dc3c6" + "uuid": "ea4cfecb8495b36694d9a951510dc3c6", + "soft_assaytype": "salmon_rnaseq_slideseq", + "vitessce-hints": [ + "is_sc", + "rna" + ] } diff --git a/test/good-fixtures/StitchedCytokitSPRMViewConfBuilder/04e7385339167e541ad42a2636e18398-entity.json b/test/good-fixtures/StitchedCytokitSPRMViewConfBuilder/04e7385339167e541ad42a2636e18398-entity.json index 3758d74..21e1c4e 100644 --- a/test/good-fixtures/StitchedCytokitSPRMViewConfBuilder/04e7385339167e541ad42a2636e18398-entity.json +++ b/test/good-fixtures/StitchedCytokitSPRMViewConfBuilder/04e7385339167e541ad42a2636e18398-entity.json @@ -40,5 +40,11 @@ ] }, "status": "Published", - "uuid": "04e7385339167e541ad42a2636e18398" + "uuid": "04e7385339167e541ad42a2636e18398", + "soft_assaytype": "codex_cytokit_v1", + "vitessce-hints": [ + "codex", + "is_image", + "is_tiled" + ] } diff --git a/test/good-fixtures/TiledSPRMViewConfBuilder/no-cells-entity.json b/test/good-fixtures/TiledSPRMViewConfBuilder/no-cells-entity.json index 44944df..1c9ac57 100644 --- a/test/good-fixtures/TiledSPRMViewConfBuilder/no-cells-entity.json +++ b/test/good-fixtures/TiledSPRMViewConfBuilder/no-cells-entity.json @@ -19,5 +19,12 @@ "dag_provenance_list": [] }, "status": "Published", - "uuid": "b69d1e2ad1bf1455eee991fce301b191" + "uuid": "b69d1e2ad1bf1455eee991fce301b191", + "soft_assaytype": "codex_cytokit_v1", + "vitessce-hints": [ + "codex", + "is_image", + "is_tiled", + "json_based" + ] } diff --git a/test/good-fixtures/TiledSPRMViewConfBuilder/with-cells-entity.json b/test/good-fixtures/TiledSPRMViewConfBuilder/with-cells-entity.json index c2bce06..7342174 100644 --- a/test/good-fixtures/TiledSPRMViewConfBuilder/with-cells-entity.json +++ b/test/good-fixtures/TiledSPRMViewConfBuilder/with-cells-entity.json @@ -23,5 +23,12 @@ "dag_provenance_list": [] }, "status": "Published", - "uuid": "b69d1e2ad1bf1455eee991fce301b191" + "uuid": "b69d1e2ad1bf1455eee991fce301b191", + "soft_assaytype": "codex_cytokit_v1", + "vitessce-hints": [ + "codex", + "is_image", + "is_tiled", + "json_based" + ] } diff --git a/test/test_builders.py b/test/test_builders.py index 96f6c41..7f9d076 100644 --- a/test/test_builders.py +++ b/test/test_builders.py @@ -57,12 +57,12 @@ class MockResponse: defaults = json.load((Path(__file__).parent.parent / "src/defaults.json").open()) default_assaytype = { - "assaytype": "Null", + "soft_assaytype": "Null", "vitessce-hints": [], } -def get_assaytype(input): +def get_entity(input): # uuid = entity.get("uuid") if not isinstance(input, str): uuid = input.get("uuid") @@ -80,14 +80,20 @@ def get_assaytype(input): [ (False, {"uuid": "2c2179ea741d3bbb47772172a316a2bf"}), (True, json.loads(Path.read_text(good_entity_paths[0]))), - # If the first fixture returns a Null builder this would break. + # NOTE: If the first fixture returns a Null builder this breaks. ], 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 parent = entity.get("parent") or None # Only used for image pyramids - assert has_vis == has_visualization(entity, get_assaytype, parent) + # TODO: Once other epic hints exist, this may need to be adjusted + epic_uuid = ( + entity.get("uuid") + if "segmentation_mask" in entity.get("vitessce-hints", {}) + else None + ) + assert has_vis == has_visualization(entity, get_entity, parent, epic_uuid) def mock_zarr_store(entity_path, mocker): @@ -146,10 +152,10 @@ def test_entity_to_vitessce_conf(entity_path, mocker): epic_uuid = None entity = json.loads(entity_path.read_text()) parent = entity.get("parent") or None # Only used for image pyramids - assay_type = get_assaytype(entity["uuid"]) - if 'segmentation_mask' in assay_type['vitessce-hints']: + assay_type = get_entity(entity["uuid"]) + if "segmentation_mask" in assay_type["vitessce-hints"]: epic_uuid = entity.get("uuid") - Builder = get_view_config_builder(entity, get_assaytype, parent, epic_uuid) + Builder = get_view_config_builder(entity, get_entity, parent, epic_uuid) # Envvars should not be set during normal test runs, # but to test the end-to-end integration, they are useful. groups_token = environ.get("GROUPS_TOKEN", "groups_token") @@ -157,22 +163,23 @@ def test_entity_to_vitessce_conf(entity_path, mocker): # epic_uuid = environ.get("EPIC_UUID", "epic_uuid") builder = Builder(entity, groups_token, assets_url) conf, cells = builder.get_conf_cells(marker=marker) - if 'segmentation_mask' not in assay_type['vitessce-hints']: + if "segmentation_mask" not in assay_type["vitessce-hints"]: assert Builder.__name__ == entity_path.parent.name compare_confs(entity_path, conf, cells) - if 'segmentation_mask' in assay_type['vitessce-hints']: + if "segmentation_mask" in assay_type["vitessce-hints"]: epic_builder = get_epic_builder(epic_uuid) assert epic_builder is not None assert epic_builder.__name__ == entity_path.parent.name - if conf is None: # pragma: no cover + if conf is None: # pragma: no cover with pytest.raises(ValueError): - epic_builder(epic_uuid, - ConfCells(conf, cells), entity, groups_token, assets_url).get_conf_cells() + epic_builder( + epic_uuid, ConfCells(conf, cells), entity, groups_token, assets_url + ).get_conf_cells() return - built_epic_conf, cells = epic_builder(epic_uuid, - ConfCells(conf, cells), entity, groups_token, assets_url - ).get_conf_cells() + built_epic_conf, cells = epic_builder( + epic_uuid, ConfCells(conf, cells), entity, groups_token, assets_url + ).get_conf_cells() assert built_epic_conf is not None compare_confs(entity_path, built_epic_conf, cells) @@ -185,7 +192,7 @@ def test_entity_to_error(entity_path, mocker): entity = json.loads(entity_path.read_text()) with pytest.raises(Exception) as error_info: parent = entity.get("parent") or None # Only used for image pyramids - Builder = get_view_config_builder(entity, get_assaytype, parent=parent) + Builder = get_view_config_builder(entity, get_entity, parent=parent) builder = Builder(entity, "groups_token", "https://example.com/") builder.get_conf_cells() actual_error = f"{error_info.type.__name__}: {error_info.value.args[0]}" @@ -236,7 +243,7 @@ def compare_confs(entity_path, conf, cells): args = parser.parse_args() entity = json.loads(args.input.read_text()) - Builder = get_view_config_builder(entity, get_assaytype) + Builder = get_view_config_builder(entity, get_entity) builder = Builder(entity, "groups_token", "https://example.com/") conf, cells = builder.get_conf_cells() From c7f063d050f820da491aebb25f3a3b1bda8b6d42 Mon Sep 17 00:00:00 2001 From: John Conroy <62477388+john-conroy@users.noreply.github.com> Date: Thu, 12 Dec 2024 10:18:59 -0500 Subject: [PATCH 2/6] Bump version to 0.2.10 (#101) Co-authored-by: John Conroy --- VERSION.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION.txt b/VERSION.txt index 1866a36..13dead7 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -0.2.9 +0.2.10 From 936eb66404c7abc3567cc1e0a801d30ed9224290 Mon Sep 17 00:00:00 2001 From: John Conroy <62477388+john-conroy@users.noreply.github.com> Date: Thu, 12 Dec 2024 12:27:05 -0500 Subject: [PATCH 3/6] Bump version to 0.3.3 (#102) Co-authored-by: John Conroy --- VERSION.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION.txt b/VERSION.txt index 13dead7..1c09c74 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -0.2.10 +0.3.3 From 95f6a0cc4549acb1cd7c574df6ba2f003def7e9d Mon Sep 17 00:00:00 2001 From: Nikolay Akhmetov Date: Fri, 13 Dec 2024 15:05:38 -0500 Subject: [PATCH 4/6] [HOTFIX] Fix `get_entity_type` logic (#103) --- VERSION.txt | 2 +- src/portal_visualization/client.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/VERSION.txt b/VERSION.txt index 1c09c74..42045ac 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -0.3.3 +0.3.4 diff --git a/src/portal_visualization/client.py b/src/portal_visualization/client.py index e377e95..ceb1bde 100644 --- a/src/portal_visualization/client.py +++ b/src/portal_visualization/client.py @@ -246,7 +246,9 @@ def get_vitessce_conf_cells_and_lifted_uuid( # Otherwise, just try to visualize the data for the entity itself: else: # pragma: no cover # We have separate tests for the builder logic try: - Builder = get_view_config_builder(entity, self.get_entity(), parent, epic_uuid) + def get_entity(uuid): + return self.get_entity(uuid=uuid) + Builder = get_view_config_builder(entity, get_entity, parent, epic_uuid) builder = Builder(entity, self.groups_token, self.assets_endpoint) vitessce_conf = builder.get_conf_cells(marker=marker) except Exception as e: From 0ae44c2f123504d6cc6bd2c494144b7f7e03d746 Mon Sep 17 00:00:00 2001 From: Nikolay Akhmetov Date: Fri, 13 Dec 2024 15:24:05 -0500 Subject: [PATCH 5/6] 0.3.5 (#104) --- VERSION.txt | 2 +- src/portal_visualization/client.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/VERSION.txt b/VERSION.txt index 42045ac..c2c0004 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -0.3.4 +0.3.5 diff --git a/src/portal_visualization/client.py b/src/portal_visualization/client.py index ceb1bde..f1142a1 100644 --- a/src/portal_visualization/client.py +++ b/src/portal_visualization/client.py @@ -246,8 +246,8 @@ def get_vitessce_conf_cells_and_lifted_uuid( # Otherwise, just try to visualize the data for the entity itself: else: # pragma: no cover # We have separate tests for the builder logic try: - def get_entity(uuid): - return self.get_entity(uuid=uuid) + def get_entity(entity): + return self.get_entity(uuid=entity.get('uuid')) Builder = get_view_config_builder(entity, get_entity, parent, epic_uuid) builder = Builder(entity, self.groups_token, self.assets_endpoint) vitessce_conf = builder.get_conf_cells(marker=marker) From e84b829148a7eec9a27a6e5811494a8ce626cb04 Mon Sep 17 00:00:00 2001 From: Nikolay Akhmetov Date: Mon, 16 Dec 2024 12:28:10 -0500 Subject: [PATCH 6/6] Improve `get_entity` bulletproofing by supporting both object and UUID lookups (#105) --- VERSION.txt | 2 +- src/portal_visualization/client.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/VERSION.txt b/VERSION.txt index c2c0004..449d7e7 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -0.3.5 +0.3.6 diff --git a/src/portal_visualization/client.py b/src/portal_visualization/client.py index f1142a1..82ad008 100644 --- a/src/portal_visualization/client.py +++ b/src/portal_visualization/client.py @@ -247,6 +247,8 @@ def get_vitessce_conf_cells_and_lifted_uuid( else: # pragma: no cover # We have separate tests for the builder logic try: def get_entity(entity): + if (type(entity) is str): + return self.get_entity(uuid=entity) return self.get_entity(uuid=entity.get('uuid')) Builder = get_view_config_builder(entity, get_entity, parent, epic_uuid) builder = Builder(entity, self.groups_token, self.assets_endpoint)