Skip to content

Commit

Permalink
Remove items called node and edges.
Browse files Browse the repository at this point in the history
  • Loading branch information
everaldorodrigo committed Oct 23, 2024
1 parent 758e69e commit 5160044
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/hub/dataload/sources/civic/civic_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 5160044

Please sign in to comment.