Skip to content

Commit

Permalink
chore(ancestral): more informative AugurError message (#1662)
Browse files Browse the repository at this point in the history
  • Loading branch information
corneliusroemer authored Nov 9, 2024
1 parent 29188d4 commit 8731851
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions augur/ancestral.py
Original file line number Diff line number Diff line change
Expand Up @@ -447,8 +447,10 @@ def run(args):

aa_result = run_ancestral(T, fname, reference_sequence=reference_sequence, is_vcf=is_vcf, fill_overhangs=not args.keep_overhangs,
marginal=args.inference, infer_ambiguous=infer_ambiguous, alphabet='aa')
if aa_result['tt'].data.full_length*3 != len(feat):
raise AugurError(f"length of translated alignment for {gene} does not match length of reference feature."
len_translated_alignment = aa_result['tt'].data.full_length*3
if len_translated_alignment != len(feat):
raise AugurError(f"length of translated alignment for {gene} ({len_translated_alignment})"
f" does not match length of reference feature ({len(feat)})."
" Please make sure that the annotation matches the translations.")

for key, node in anc_seqs['nodes'].items():
Expand Down

0 comments on commit 8731851

Please sign in to comment.