Skip to content

Commit 64bf925

Browse files
committed
Add gene length to error message
This matches the equivalent error message in Auspice.¹ ¹ https://github.com/nextstrain/auspice/blob/22124f8eacec2c46f39806aa95472581f65fc25a/src/util/entropyCreateStateFromJsons.ts#L315
1 parent 49b7841 commit 64bf925

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

augur/io/sequences.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ def validate_features(features):
252252
# Error if feature length is not a multiple of 3.
253253
length = len(feat.location)
254254
if length % 3:
255-
yield f"Gene length of {feature_name!r} is not a multiple of 3."
255+
yield f"{feature_name!r} has length {length} which is not a multiple of 3."
256256

257257

258258
def _read_nuc_annotation_from_gff(record, reference):

tests/functional/translate/cram/basic-error-checking.t

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ Gene length not divisible by 3
3030
> --reference-sequence invalid.gff \
3131
> --output-node-data "aa_muts.json"
3232
ERROR: Reference file 'invalid.gff' failed validation:
33-
Gene length of 'gene1' is not a multiple of 3.
34-
Gene length of 'gene2' is not a multiple of 3.
33+
'gene1' has length 14 which is not a multiple of 3.
34+
'gene2' has length 13 which is not a multiple of 3.
3535
[2]
3636

3737
Gene with compound location not divisible by 3
@@ -60,5 +60,5 @@ Gene with compound location not divisible by 3
6060
.* (re)
6161
.* (re)
6262
ERROR: Reference file 'invalid.gb' failed validation:
63-
Gene length of 'test_gene' is not a multiple of 3.
63+
'test_gene' has length 26 which is not a multiple of 3.
6464
[2]

0 commit comments

Comments
 (0)