Skip to content

Commit

Permalink
wip: fix export v2 ignoring metadata ID
Browse files Browse the repository at this point in the history
  • Loading branch information
joverlee521 committed Jul 25, 2023
1 parent dd195c6 commit 9741279
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions augur/export_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -1016,11 +1016,11 @@ def parse_node_data_and_metadata(T, node_data, metadata):
node_attrs = {clade.name: {} for clade in T.root.find_clades()}

# first pass: metadata
for node in metadata.values():
if node["strain"] in node_attrs: # i.e. this node name is in the tree
for metadata_id, node in metadata.items():
if metadata_id in node_attrs: # i.e. this node name is in the tree
for key, value in node.items():
corrected_key = update_deprecated_names(key)
node_attrs[node["strain"]][corrected_key] = value
node_attrs[metadata_id][corrected_key] = value
metadata_names.add(corrected_key)

# second pass: node data JSONs (overwrites keys of same name found in metadata)
Expand Down

0 comments on commit 9741279

Please sign in to comment.