Skip to content

Commit

Permalink
Merge pull request #108 from 4dn-dcic/fix_geo_submission_script
Browse files Browse the repository at this point in the history
Fix geo submission script
  • Loading branch information
RahiNav authored Sep 21, 2023
2 parents 467f628 + 01edbfd commit 303a11c
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 6 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ dcicwrangling
Change Log
----------

2.4.1
=====

* Fixed 12_geo_submission.ipynb to avoid adding duplicate protocol items in the JSON files specifically for experiments where both 'protocol' and 'protocol_variation' is present

2.4.0
=====

Expand Down
23 changes: 18 additions & 5 deletions notebooks/useful_notebooks/12_geo_submission.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -256,9 +256,12 @@
" if experiment_object.get('protocol'):\n",
" protocol = get_item_in_store(experiment_object['protocol'])\n",
" protocols.append(protocol)\n",
" if experiment_object.get('protocol_variations'):\n",
" protocol_variations = [p for p in get_item_in_store(experiment_object['protocol_variations'])]\n",
" protocols.extend(protocol_variations)\n",
" if experiment_object['protocol_variation']:\n",
" protocol_variations = experiment_object['protocol_variation']\n",
" for p in protocol_variations:\n",
" protocol_id = p['@id']\n",
" protocol_variations_details = get_item_in_store(protocol_id)\n",
" protocols.append(protocol_variations_details)\n",
" if experiment_object.get('cell_sorting_protocol'):\n",
" protocol_sorting = get_item_in_store(experiment_object['cell_sorting_protocol'])\n",
" protocols.append(protocol_sorting)\n",
Expand Down Expand Up @@ -378,12 +381,17 @@
" experiment_dict = {}\n",
" file_ids = []\n",
" biosample_id = ''\n",
" all_keys = []\n",
" for key, value in experiment_object.items():\n",
" export_value = None\n",
" all_keys.append(key)\n",
" if key in experiment_simple_values:\n",
" export_value = value\n",
" elif key in ['biosample_quantity', 'protocol', 'protocol_variation', 'cell_sorting_protocol']:\n",
" elif key in ['biosample_quantity', 'protocol', 'cell_sorting_protocol']:\n",
" export_value = experiment_function_dispatch[key](experiment_object)\n",
" elif key == 'protocol_variation':\n",
" if 'protocol' not in all_keys:\n",
" export_value = experiment_function_dispatch[key](experiment_object)\n",
" elif key in ['files', 'processed_files', 'other_processed_files', 'reference_files']:\n",
" export_value, files_list = experiment_function_dispatch[key](value)\n",
" file_ids.extend(files_list)\n",
Expand Down Expand Up @@ -670,7 +678,12 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.2"
"version": "3.8.12"
},
"vscode": {
"interpreter": {
"hash": "20d91ac981d81ffaf62d1b59390659afd05fbcd41a0bec0e13249d20dc131a1e"
}
}
},
"nbformat": 4,
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "dcicwrangling"
version = "2.4.0"
version = "2.4.1"
description = "Scripts and Jupyter notebooks for 4DN wrangling"
authors = ["4DN-DCIC Team <[email protected]>"]
license = "MIT"
Expand Down

0 comments on commit 303a11c

Please sign in to comment.