diff --git a/.github/workflows/portal-ci.yml b/.github/workflows/portal-ci.yml index 22099a1..6c5f459 100644 --- a/.github/workflows/portal-ci.yml +++ b/.github/workflows/portal-ci.yml @@ -14,10 +14,10 @@ jobs: with: submodules: 'recursive' - - name: Set up Python 3.9 + - name: Set up Python 3.10 uses: actions/setup-python@v2 with: - python-version: '3.9' + python-version: '3.10' architecture: 'x64' - name: Install python main dependencies diff --git a/README.md b/README.md index 1e736b6..3428fcb 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ usage: vis-preview.py [-h] (--url URL | --json JSON) [--assets_url URL] Given HuBMAP Dataset JSON, generate a Vitessce viewconf, and load vitessce.io. -optional arguments: +options: -h, --help show this help message and exit --url URL URL which returns Dataset JSON --json JSON File containing Dataset JSON diff --git a/VERSION.txt b/VERSION.txt index 449d7e7..0f82685 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -0.3.6 +0.3.7 diff --git a/requirements-dev.txt b/requirements-dev.txt index 54af287..f6f912b 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,4 +1,4 @@ -pytest==5.2.1 +pytest==7.0.0 flake8==7.0.0 autopep8==2.0.4 pytest-mock==3.7.0 diff --git a/setup.cfg b/setup.cfg index fc1736d..f3ed732 100644 --- a/setup.cfg +++ b/setup.cfg @@ -18,11 +18,11 @@ scripts = package_dir = = src packages = find: -python_requires = >=3.7 +python_requires = >=3.10 install_requires = # Currently pinned due to the added `spatialdata` dependency # having a lot of uncapped dependencies that are causing conflicts with search-api downstream. - vitessce==3.4.0 + vitessce==3.5.0 hubmap-commons>=2.0.15 requests>=2.27.1 nbformat==5.1.3 diff --git a/src/portal_visualization/builders/anndata_builders.py b/src/portal_visualization/builders/anndata_builders.py index 5c1a2ec..e8466aa 100644 --- a/src/portal_visualization/builders/anndata_builders.py +++ b/src/portal_visualization/builders/anndata_builders.py @@ -132,7 +132,7 @@ def _set_up_marker_gene(self, marker): # Future improvement to be implemented in CAT-137 # elif (encoding_version == "0.2.0"): # print('TODO - Encoding Version 0.2.0 support') - self._marker = marker + self._marker = str(marker) if marker is not None else None self._gene_alias = gene_alias def _set_up_dataset(self, vc): @@ -600,7 +600,6 @@ def _setup_anndata_view_config(self, vc, dataset, column_name, column_label): obs_set_coordination, obs_color_coordination = vc.add_coordination( ct.OBS_SET_SELECTION, ct.OBS_COLOR_ENCODING) genomic_profiles.use_coordination(obs_set_coordination, obs_color_coordination) - obs_set_coordination.set_value(obs_set_coordinations) obs_color_coordination.set_value('cellSetSelection') diff --git a/src/portal_visualization/builders/epic_builders.py b/src/portal_visualization/builders/epic_builders.py index 5c81f01..0360c14 100644 --- a/src/portal_visualization/builders/epic_builders.py +++ b/src/portal_visualization/builders/epic_builders.py @@ -169,14 +169,9 @@ def read_segmentation_scale(self): # pragma: no cover def create_segmentation_objects(base_url, mask_names): # pragma: no cover - spatialTargetCMapping = { - 'arteries-arterioles': 4, - 'glomeruli': 2, - 'tubules': 3, - } segmentation_objects = [] segmentations_CL = [] - for index, mask_name in enumerate(mask_names): + for mask_name in mask_names: color_channel = generate_unique_color() mask_url = f'{base_url}/{mask_name}.zarr' segmentations_zarr = AnnDataWrapper( @@ -187,13 +182,8 @@ def create_segmentation_objects(base_url, mask_names): # pragma: no cover "obsType": mask_name } ) - # TODO: manually adjusted for the test dataset, need to be fixed on Vitessce side - if all(mask in mask_names for mask in spatialTargetCMapping.keys()): - channelIndex = spatialTargetCMapping[mask_name] - else: - channelIndex = index seg_CL = { - "spatialTargetC": channelIndex, + "spatialTargetC": mask_name, "obsType": mask_name, "spatialChannelOpacity": 1, "spatialChannelColor": color_channel, diff --git a/test/good-fixtures/MultiomicAnndataZarrViewConfBuilder/fake-multiome-conf.json b/test/good-fixtures/MultiomicAnndataZarrViewConfBuilder/fake-multiome-conf.json index 7bdd547..5559f9d 100644 --- a/test/good-fixtures/MultiomicAnndataZarrViewConfBuilder/fake-multiome-conf.json +++ b/test/good-fixtures/MultiomicAnndataZarrViewConfBuilder/fake-multiome-conf.json @@ -179,13 +179,13 @@ "obsColorEncoding": "A", "obsSetSelection": "A" }, - "h": 6.0, + "h": 6, "props": { "embeddingCellSetLabelsVisible": false }, - "w": 3.0, - "x": 0.0, - "y": 0.0 + "w": 3, + "x": 0, + "y": 0 }, { "component": "scatterplot", @@ -200,13 +200,13 @@ "obsColorEncoding": "A", "obsSetSelection": "A" }, - "h": 6.0, + "h": 6, "props": { "embeddingCellSetLabelsVisible": false }, - "w": 3.0, - "x": 3.0, - "y": 0.0 + "w": 3, + "x": 3, + "y": 0 }, { "component": "scatterplot", @@ -219,13 +219,13 @@ "obsColorEncoding": "A", "obsSetSelection": "A" }, - "h": 6.0, + "h": 6, "props": { "embeddingCellSetLabelsVisible": false }, - "w": 3.0, - "x": 6.0, - "y": 0.0 + "w": 3, + "x": 6, + "y": 0 }, { "component": "featureList", @@ -238,10 +238,10 @@ "obsColorEncoding": "A", "obsSetSelection": "A" }, - "h": 6.0, - "w": 3.0, - "x": 9.0, - "y": 6.0 + "h": 6, + "w": 3, + "x": 9, + "y": 6 }, { "component": "featureList", @@ -254,10 +254,10 @@ "obsColorEncoding": "A", "obsSetSelection": "A" }, - "h": 6.0, - "w": 3.0, - "x": 6.0, - "y": 6.0 + "h": 6, + "w": 3, + "x": 6, + "y": 6 }, { "component": "genomicProfiles", @@ -266,13 +266,13 @@ "obsColorEncoding": "B", "obsSetSelection": "B" }, - "h": 6.0, + "h": 6, "props": { "title": "Leiden (Weighted Nearest Neighbor) Genomic Profiles" }, - "w": 6.0, - "x": 0.0, - "y": 6.0 + "w": 6, + "x": 0, + "y": 6 }, { "component": "obsSets", @@ -283,10 +283,10 @@ "obsColorEncoding": "A", "obsSetSelection": "A" }, - "h": 6.0, - "w": 3.0, - "x": 9.0, - "y": 0.0 + "h": 6, + "w": 3, + "x": 9, + "y": 0 } ], "name": "Leiden (Weighted Nearest Neighbor)", @@ -472,13 +472,13 @@ "obsColorEncoding": "A", "obsSetSelection": "A" }, - "h": 6.0, + "h": 6, "props": { "embeddingCellSetLabelsVisible": false }, - "w": 3.0, - "x": 0.0, - "y": 0.0 + "w": 3, + "x": 0, + "y": 0 }, { "component": "scatterplot", @@ -493,13 +493,13 @@ "obsColorEncoding": "A", "obsSetSelection": "A" }, - "h": 6.0, + "h": 6, "props": { "embeddingCellSetLabelsVisible": false }, - "w": 3.0, - "x": 3.0, - "y": 0.0 + "w": 3, + "x": 3, + "y": 0 }, { "component": "scatterplot", @@ -512,13 +512,13 @@ "obsColorEncoding": "A", "obsSetSelection": "A" }, - "h": 6.0, + "h": 6, "props": { "embeddingCellSetLabelsVisible": false }, - "w": 3.0, - "x": 6.0, - "y": 0.0 + "w": 3, + "x": 6, + "y": 0 }, { "component": "featureList", @@ -531,10 +531,10 @@ "obsColorEncoding": "A", "obsSetSelection": "A" }, - "h": 6.0, - "w": 3.0, - "x": 9.0, - "y": 6.0 + "h": 6, + "w": 3, + "x": 9, + "y": 6 }, { "component": "featureList", @@ -547,10 +547,10 @@ "obsColorEncoding": "A", "obsSetSelection": "A" }, - "h": 6.0, - "w": 3.0, - "x": 6.0, - "y": 6.0 + "h": 6, + "w": 3, + "x": 6, + "y": 6 }, { "component": "genomicProfiles", @@ -559,13 +559,13 @@ "obsColorEncoding": "B", "obsSetSelection": "B" }, - "h": 6.0, + "h": 6, "props": { "title": "Leiden (RNA) Genomic Profiles" }, - "w": 6.0, - "x": 0.0, - "y": 6.0 + "w": 6, + "x": 0, + "y": 6 }, { "component": "obsSets", @@ -576,13 +576,13 @@ "obsColorEncoding": "A", "obsSetSelection": "A" }, - "h": 6.0, - "w": 3.0, - "x": 9.0, - "y": 0.0 + "h": 6, + "w": 3, + "x": 9, + "y": 0 } ], "name": "Leiden (RNA)", "version": "1.0.15" } -] \ No newline at end of file +] diff --git a/test/good-fixtures/MultiomicAnndataZarrViewConfBuilder/fake-multiome-is-annotated-conf.json b/test/good-fixtures/MultiomicAnndataZarrViewConfBuilder/fake-multiome-is-annotated-conf.json index 45c0015..1d8773e 100644 --- a/test/good-fixtures/MultiomicAnndataZarrViewConfBuilder/fake-multiome-is-annotated-conf.json +++ b/test/good-fixtures/MultiomicAnndataZarrViewConfBuilder/fake-multiome-is-annotated-conf.json @@ -183,13 +183,13 @@ "obsColorEncoding": "A", "obsSetSelection": "A" }, - "h": 6.0, + "h": 6, "props": { "embeddingCellSetLabelsVisible": false }, - "w": 3.0, - "x": 0.0, - "y": 0.0 + "w": 3, + "x": 0, + "y": 0 }, { "component": "scatterplot", @@ -204,13 +204,13 @@ "obsColorEncoding": "A", "obsSetSelection": "A" }, - "h": 6.0, + "h": 6, "props": { "embeddingCellSetLabelsVisible": false }, - "w": 3.0, - "x": 3.0, - "y": 0.0 + "w": 3, + "x": 3, + "y": 0 }, { "component": "scatterplot", @@ -223,13 +223,13 @@ "obsColorEncoding": "A", "obsSetSelection": "A" }, - "h": 6.0, + "h": 6, "props": { "embeddingCellSetLabelsVisible": false }, - "w": 3.0, - "x": 6.0, - "y": 0.0 + "w": 3, + "x": 6, + "y": 0 }, { "component": "featureList", @@ -242,10 +242,10 @@ "obsColorEncoding": "A", "obsSetSelection": "A" }, - "h": 6.0, - "w": 3.0, - "x": 9.0, - "y": 6.0 + "h": 6, + "w": 3, + "x": 9, + "y": 6 }, { "component": "featureList", @@ -258,10 +258,10 @@ "obsColorEncoding": "A", "obsSetSelection": "A" }, - "h": 6.0, - "w": 3.0, - "x": 6.0, - "y": 6.0 + "h": 6, + "w": 3, + "x": 6, + "y": 6 }, { "component": "genomicProfiles", @@ -270,13 +270,13 @@ "obsColorEncoding": "B", "obsSetSelection": "B" }, - "h": 6.0, + "h": 6, "props": { "title": "Leiden (Weighted Nearest Neighbor) Genomic Profiles" }, - "w": 6.0, - "x": 0.0, - "y": 6.0 + "w": 6, + "x": 0, + "y": 6 }, { "component": "obsSets", @@ -287,10 +287,10 @@ "obsColorEncoding": "A", "obsSetSelection": "A" }, - "h": 6.0, - "w": 3.0, - "x": 9.0, - "y": 0.0 + "h": 6, + "w": 3, + "x": 9, + "y": 0 } ], "name": "Leiden (Weighted Nearest Neighbor)", @@ -480,13 +480,13 @@ "obsColorEncoding": "A", "obsSetSelection": "A" }, - "h": 6.0, + "h": 6, "props": { "embeddingCellSetLabelsVisible": false }, - "w": 3.0, - "x": 0.0, - "y": 0.0 + "w": 3, + "x": 0, + "y": 0 }, { "component": "scatterplot", @@ -501,13 +501,13 @@ "obsColorEncoding": "A", "obsSetSelection": "A" }, - "h": 6.0, + "h": 6, "props": { "embeddingCellSetLabelsVisible": false }, - "w": 3.0, - "x": 3.0, - "y": 0.0 + "w": 3, + "x": 3, + "y": 0 }, { "component": "scatterplot", @@ -520,13 +520,13 @@ "obsColorEncoding": "A", "obsSetSelection": "A" }, - "h": 6.0, + "h": 6, "props": { "embeddingCellSetLabelsVisible": false }, - "w": 3.0, - "x": 6.0, - "y": 0.0 + "w": 3, + "x": 6, + "y": 0 }, { "component": "featureList", @@ -539,10 +539,10 @@ "obsColorEncoding": "A", "obsSetSelection": "A" }, - "h": 6.0, - "w": 3.0, - "x": 9.0, - "y": 6.0 + "h": 6, + "w": 3, + "x": 9, + "y": 6 }, { "component": "featureList", @@ -555,10 +555,10 @@ "obsColorEncoding": "A", "obsSetSelection": "A" }, - "h": 6.0, - "w": 3.0, - "x": 6.0, - "y": 6.0 + "h": 6, + "w": 3, + "x": 6, + "y": 6 }, { "component": "genomicProfiles", @@ -567,13 +567,13 @@ "obsColorEncoding": "B", "obsSetSelection": "B" }, - "h": 6.0, + "h": 6, "props": { "title": "Leiden (RNA) Genomic Profiles" }, - "w": 6.0, - "x": 0.0, - "y": 6.0 + "w": 6, + "x": 0, + "y": 6 }, { "component": "obsSets", @@ -584,10 +584,10 @@ "obsColorEncoding": "A", "obsSetSelection": "A" }, - "h": 6.0, - "w": 3.0, - "x": 9.0, - "y": 0.0 + "h": 6, + "w": 3, + "x": 9, + "y": 0 } ], "name": "Leiden (RNA)", @@ -777,13 +777,13 @@ "obsColorEncoding": "A", "obsSetSelection": "A" }, - "h": 6.0, + "h": 6, "props": { "embeddingCellSetLabelsVisible": false }, - "w": 3.0, - "x": 0.0, - "y": 0.0 + "w": 3, + "x": 0, + "y": 0 }, { "component": "scatterplot", @@ -798,13 +798,13 @@ "obsColorEncoding": "A", "obsSetSelection": "A" }, - "h": 6.0, + "h": 6, "props": { "embeddingCellSetLabelsVisible": false }, - "w": 3.0, - "x": 3.0, - "y": 0.0 + "w": 3, + "x": 3, + "y": 0 }, { "component": "scatterplot", @@ -817,13 +817,13 @@ "obsColorEncoding": "A", "obsSetSelection": "A" }, - "h": 6.0, + "h": 6, "props": { "embeddingCellSetLabelsVisible": false }, - "w": 3.0, - "x": 6.0, - "y": 0.0 + "w": 3, + "x": 6, + "y": 0 }, { "component": "featureList", @@ -836,10 +836,10 @@ "obsColorEncoding": "A", "obsSetSelection": "A" }, - "h": 6.0, - "w": 3.0, - "x": 9.0, - "y": 6.0 + "h": 6, + "w": 3, + "x": 9, + "y": 6 }, { "component": "featureList", @@ -852,10 +852,10 @@ "obsColorEncoding": "A", "obsSetSelection": "A" }, - "h": 6.0, - "w": 3.0, - "x": 6.0, - "y": 6.0 + "h": 6, + "w": 3, + "x": 6, + "y": 6 }, { "component": "genomicProfiles", @@ -864,13 +864,13 @@ "obsColorEncoding": "B", "obsSetSelection": "B" }, - "h": 6.0, + "h": 6, "props": { "title": "Cell Ontology Annotation Genomic Profiles" }, - "w": 6.0, - "x": 0.0, - "y": 6.0 + "w": 6, + "x": 0, + "y": 6 }, { "component": "obsSets", @@ -881,13 +881,13 @@ "obsColorEncoding": "A", "obsSetSelection": "A" }, - "h": 6.0, - "w": 3.0, - "x": 9.0, - "y": 0.0 + "h": 6, + "w": 3, + "x": 9, + "y": 0 } ], "name": "Cell Ontology Annotation", "version": "1.0.15" } -] \ No newline at end of file +]