Skip to content

Commit

Permalink
Convert usage of data_types in codex template to assay_display_name
Browse files Browse the repository at this point in the history
  • Loading branch information
john-conroy committed Sep 19, 2024
1 parent debe80f commit 0bec054
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"uuids = {{ uuids | safe }}\n",
"\n",
"# accepted datatypes \n",
"accepted_datatypes = ['codex_cytokit']\n",
"accepted_datatypes = ['CODEX [Cytokit + SPRM]']\n",
"\n",
"# required filetypes\n",
"required_filetypes = ['sprm_outputs/reg001_expr.ome.tiff-cell_channel_total.csv', 'sprm_outputs/reg001_expr.ome.tiff-cell_channel_mean.csv', 'sprm_outputs/reg001_expr.ome.tiff-cell_centers.csv']\n",
Expand Down Expand Up @@ -114,19 +114,19 @@
" json={\n",
" 'size': 10000,\n",
" 'query': {'ids': {'values': uuids}},\n",
" '_source': ['files', 'data_types']\n",
" '_source': ['files', 'assay_display_name']\n",
" }, \n",
" ).text\n",
" )['hits']['hits']\n",
"\n",
" # create mapping for uuid to file_types and data_types\n",
" # create mapping for uuid to file_types and assay_display_name\n",
" uuid_to_files = {}\n",
" uuid_to_datatypes = {}\n",
" for hit in hits:\n",
" file_paths = [file['rel_path'] for file in hit['_source']['files']]\n",
" uuid_to_files[hit['_id']] = file_paths\n",
"\n",
" hit_data_type = hit['_source']['data_types']\n",
" hit_data_type = hit['_source']['assay_display_name']\n",
" uuid_to_datatypes[hit['_id']] = hit_data_type\n",
" \n",
" # save uuids without warnings\n",
Expand All @@ -150,9 +150,9 @@
" accepted_uuids.remove(uuid)\n",
"\n",
" if accepted_datatypes is not None: \n",
" # check if data_types for each uuid are in accepted_datatypes\n",
" data_types = uuid_to_datatypes[uuid]\n",
" for data_type in data_types:\n",
" # check if assay_display_name for each uuid are in accepted_datatypes\n",
" assay_display_name = uuid_to_datatypes[uuid]\n",
" for data_type in assay_display_name:\n",
" if data_type not in accepted_datatypes: \n",
" warnings.warn('Dataset with UUID \"' + uuid + '\" has unaccepted data type: ' + data_type)\n",
" if uuid in accepted_uuids:\n",
Expand Down

0 comments on commit 0bec054

Please sign in to comment.