Skip to content

Commit

Permalink
Merge pull request #392 from nextstrain/v6_translate_warning
Browse files Browse the repository at this point in the history
Warn if v5 `export` Using a v6 Translate File
  • Loading branch information
jameshadfield authored Nov 7, 2019
2 parents 5a3e6a1 + 9f1c8f6 commit ddb12d1
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion augur/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,23 @@ def process_annotations(node_data):
# treetime adds "annotations" to node_data
if "annotations" not in node_data: # if haven't run tree through treetime
return None
return node_data["annotations"]
v6_type_file = False
annotations = {}
for name, info in node_data["annotations"].items():
if info['strand'] in ['+','-']:
v6_type_file = True
annotations[name] = {
"start": info["start"]-1,
"end": info["end"],
"strand": 0 if info["strand"] == "-" else 1
}
if v6_type_file:
print("\nWARNING - The supplied amino acid mutations file appears to have been made"
" in a NEWER version of augur. We have attempted to convert it, but recommend re-running"
" the 'translate' step with this augur version, then running 'export' again.")
return annotations
else:
return node_data["annotations"]

def process_panels(user_panels, meta_json, nextflu=False):
try:
Expand Down

0 comments on commit ddb12d1

Please sign in to comment.