Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix export of strandedness #1211

Merged
merged 4 commits into from
May 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@

* CI: Add a Github action to test augur on 8 Nextstrain pathogen workflows using example data. [#1217][] (@corneliusroemer)
* parse: Denote required arguments including `--fields`, `--output-sequences`, and `--output-metadata`. [#1228][] (@huddlej)
* Fix export of the `strand` attribute of gene annotations. Previously, features on the negative strand were not annotated as such since the code assumed that the `strand` attribute was boolean instead of `[-1, +1]`. [#1211] @rneher and @j23414.

[#1211]: https://github.com/nextstrain/augur/pull/1211
[#1217]: https://github.com/nextstrain/augur/pull/1217
[#1228]: https://github.com/nextstrain/augur/pull/1228

Expand Down
2 changes: 1 addition & 1 deletion augur/export_v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ def process_annotations(node_data):
annotations[name] = {
"start": info["start"]-1,
"end": info["end"],
"strand": 0 if info["strand"] == "-" else 1
"strand": -1 if info["strand"] == "-" else 1
}
return annotations

Expand Down
2 changes: 1 addition & 1 deletion augur/translate.py
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,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': {+1:'+', -1:'-', 0:'?', None:None}[feat.location.strand]}
if is_vcf: #need to add our own nuc
annotations['nuc'] = {'seqid':args.reference_sequence,
'type':feat.type,
Expand Down
Loading