From 51600440ba60113151078d9c303778cbfc3fe99d Mon Sep 17 00:00:00 2001 From: Everaldo Date: Wed, 23 Oct 2024 14:25:15 -0700 Subject: [PATCH] Remove items called node and edges. --- src/hub/dataload/sources/civic/civic_parser.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/hub/dataload/sources/civic/civic_parser.py b/src/hub/dataload/sources/civic/civic_parser.py index ca5c1efa..5f49ca10 100644 --- a/src/hub/dataload/sources/civic/civic_parser.py +++ b/src/hub/dataload/sources/civic/civic_parser.py @@ -60,8 +60,8 @@ def remove_nodes_and_edges(obj): if 'edges' in obj: return [remove_nodes_and_edges(edge['node']) for edge in obj['edges']] - if 'nodes' in obj: - return [remove_nodes_and_edges(node) for node in obj['nodes']] + # if 'nodes' in obj: + # return [remove_nodes_and_edges(node) for node in obj['nodes']] return { key: remove_nodes_and_edges(value) @@ -172,6 +172,7 @@ def load_data(data_folder): # print("### new_doc") # print(new_doc) new_doc = remove_nodes_and_edges(new_doc) + new_doc["civic"]["molecularProfiles"] = new_doc["civic"]["molecularProfiles"]["nodes"] yield dict_sweep(unlist(new_doc), ['', 'null', 'N/A', None, [], {}]) # change doid into its formal representation, which should be sth like DOID:1