From 5afabe017234b190563e570357fe367708f65170 Mon Sep 17 00:00:00 2001 From: Cornelius Roemer Date: Tue, 7 Jun 2022 18:07:51 +0200 Subject: [PATCH 1/3] fix: translate `-` strand annotation now correct Annotations output by augur translate always contained `+` irrespective of what the input gff or gb file specified and biopython returned This bug was down to the assumption that biopython `feat.location.strand` returns a boolean, when it in fact returns numeric `1` or `-1` for pos/neg strand --- augur/translate.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/augur/translate.py b/augur/translate.py index d2f1293b6..f49bbe310 100644 --- a/augur/translate.py +++ b/augur/translate.py @@ -382,7 +382,7 @@ def run(args): 'type':feat.type, 'start':int(feat.location.start)+1, 'end':int(feat.location.end), - 'strand': '+' if feat.location.strand else '-'} + 'strand': '+' if feat.location.strand == 1 else '-'} if is_vcf: #need to add our own nuc annotations['nuc'] = {'seqid':args.reference_sequence, 'type':feat.type, From 64e12a19527105430fdb73bc591b26efff76556d Mon Sep 17 00:00:00 2001 From: Cornelius Roemer Date: Tue, 7 Jun 2022 18:24:45 +0200 Subject: [PATCH 2/3] fix: translate strand - make `+` default, only `-` iff `-1` --- augur/translate.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/augur/translate.py b/augur/translate.py index f49bbe310..95116a400 100644 --- a/augur/translate.py +++ b/augur/translate.py @@ -382,7 +382,7 @@ def run(args): 'type':feat.type, 'start':int(feat.location.start)+1, 'end':int(feat.location.end), - 'strand': '+' if feat.location.strand == 1 else '-'} + 'strand': '-' if feat.location.strand == -1 else '+'} if is_vcf: #need to add our own nuc annotations['nuc'] = {'seqid':args.reference_sequence, 'type':feat.type, From ea4abc1e078a91c332b2b9a8afcd13fb9cb1b56c Mon Sep 17 00:00:00 2001 From: Cornelius Roemer Date: Tue, 7 Jun 2022 18:31:55 +0200 Subject: [PATCH 3/3] chore: add fix to CHANGES.md --- CHANGES.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index 8b685102e..a3d8800c8 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -2,6 +2,11 @@ ## __NEXT__ +### Bug Fixes + +* translate: Fix annotation of `-` strands in augur/auspice genemap format [#966][] (@corneliusroemer) + +[#966]: https://github.com/nextstrain/augur/pull/966 ## 15.0.2 (5 May 2022)