Skip to content

Commit

Permalink
[refine] add 'date_inferred' boolean to output
Browse files Browse the repository at this point in the history
This is only exported when using `--timetree` and is intended to be
used by `augur export` to inform Auspice whether a date is inferred or
not. An alternative approach would be for `augur export` to parse the
already exported `raw_date` and decide whether that includes ambiguity
but with the proposed changes in <#1304>
this approach is cleaner and less error-prone.

Note that `raw_date_constraint` is None on internal nodes and a list
(of len 2) on terminal nodes with ambiguous dates.
  • Loading branch information
jameshadfield committed Feb 18, 2025
1 parent 23b9fff commit 8bda439
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion augur/refine.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,11 @@ def run(args):
)
return 1

attributes.extend(['numdate', 'clock_length', 'mutation_length', 'raw_date', 'date'])
for node in T.find_clades():
inferred = node.raw_date_constraint is None or isinstance(node.raw_date_constraint, list)
setattr(node, 'date_inferred', inferred)

attributes.extend(['numdate', 'clock_length', 'mutation_length', 'raw_date', 'date', 'date_inferred'])
if args.date_confidence:
attributes.append('num_date_confidence')
else:
Expand Down

0 comments on commit 8bda439

Please sign in to comment.