Skip to content

Commit

Permalink
Merge pull request #111 from hubmapconsortium/development
Browse files Browse the repository at this point in the history
v2.0.1
  • Loading branch information
jpuerto-psc authored Oct 25, 2024
2 parents 6e4c6da + 9c98723 commit fecab07
Show file tree
Hide file tree
Showing 6 changed files with 92 additions and 8 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.0.0
2.0.1
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
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"title": "Scalable Cell Population Explorer",
"description": "This notebook shows how to load the scalable cell population viewer CellPop. It loads in datasets with annotated cell types and shows these in an interactive visualization.",
"tags": [
"visualization"
],
"is_multi_dataset_template": true,
"template_format": "jinja",
"examples": [
{
"title": "Explore snRNAseq Kidney datasets",
"description": "View the cell populations of 29 kidney datasets.",
"datasets": ["ad693f99fb9006e68a53e97598da1509","173de2e80adf6a73ac8cff5ccce20dfc","b95f34761c252ebbd1e482cd9afae73f","5a5ca03fa623602d9a859224aa40ace4","3c1b10bc912c60c9afc36b7423695236","1dc16eb0270ff73291dd45b6a96aa3c0","b05c21f9c94ce1a22a9694cd0fe0291e","8cdb42ed1194255c74c8462b99bbd7ef","fe0ded5fc0355c95239f9c040dd31e99","367fee3b40cba682063289505b922be1","b99fc30c4195958fbef217fa9ed9ec8f","898138b7f45a67c574e9955fb400e9be","f220c9e7bcaea3a87162cbe61287ea4d","e5f7a14d93659bd0b8dc2819ffa9bc4b","56cbda4789f04d79c0c3dffe21816d48","0b6f63f2bd61a8c091fc7afc0f318ad1","62efbe0a6abd0bcf53ab9ab29e7cd73f","4b62d9d2c248323ce029859f953fdc57","c81b0dc9d16eb825a7d6bce6e1b3678f","5ee240959c96b49d960702755478b9fc","7c9e07c96d144536525b1f889acee14d","dd7ccbc306692fc5ff5e61c22845da21","9a7e6be288b27ddbd3366c4ae41bbcd2","018a905cdbdff684760859f594d3fd77","af5741dad7aecf7960a129c3d2ae642a","6e1db473492095ccc2f1393d7259b9c0","fae9a1f2e7abefca2203765a3c7a5ba1","8d631eee88855ac59155edca2a3bc1ca","1ea6c0ac5ba60fe35bf63af8699b6fbe"]
}
],
"is_hidden": false,
"last_modified_unix_timestamp": 1729805397
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from user_templates_api.templates.jupyter_lab.render import JupyterLabRender


class JupyterLabExampleJinjaRender(JupyterLabRender):
def __init__(self):
pass
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
[
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Scalable Cell Population Viewer\n",
"This notebook shows how to load the scalable cell population viewer CellPop. It loads in datasets with annotated cell types and shows these in an interactive visualization.\n",
"\n",
"> This work is under active development and will be subject to change.\n",
"\n",
"The source code can be found [here](https://github.com/hms-dbmi/cellpop). Feel free to submit issues and feature requests [here](https://github.com/hms-dbmi/cellpop/issues). \n",
"\n",
"> For now, this tool has only been tested with snRNAseq [Salmon] datasets. Other assays may not yet work."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# !pip install -i https://test.pypi.org/simple/ cellpop==0.0.2\n",
"# !pip install hubmap-template-helper\n",
"\n",
"from hubmap_template_helper import compatibility as hth_comp\n",
"from cellpop import Widget"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# linked datasets\n",
"uuids = {{ uuids | safe }}\n",
"\n",
"# accepted assay_display_names\n",
"accepted_assay_display_names=[\"snRNAseq [Salmon]\"]"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"uuids = hth_comp.check_template_compatibility(uuids, accepted_assay_display_names=accepted_assay_display_names)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"Widget(uuids = uuids)"
]
}
]

0 comments on commit fecab07

Please sign in to comment.