-
Notifications
You must be signed in to change notification settings - Fork 130
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: translate -
strand annotation
#966
Closed
Closed
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The docs for FeatureLocation.strand say it can be -1, 1, 0, or None, described as:
We should probably account for all of those. One way is something like this:
We'd then want to also update the annotation schema definition to match the new values.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Such a fix is a good time to systematically review strand handling and make sure there aren't similar bugs elsewhere. For example, this conditional on strand should also probably account for all values instead of only testing for
-1
?augur/augur/translate.py
Lines 167 to 176 in ea4abc1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💯 Yeah let's use this opportunity to add some tests and move to a style where we ensure the value is one of the expected values, and error if it's not (rather than a "if this then ... else assume this" approach)
However if the value is not '+1' or '-1' then how do we translate it? It seems to me we either assume it's positive strand, and export it as such, or we don't translate the gene and therefore don't export it in the annotation. I believe the current code intends to do the former, although there's a 🐛
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Relatedly, if we do make an assumption for unknown (0/?) or unstranded (None) annotations and translate them, and thus export them, do we pass that information along to Auspice? Or do we keep Auspice unaware? Basically, does
strand
in the export v2 schema stay only +/- or gain ?/null too?If we do pass thru from Augur strand values that aren't +1/-1, then we'll need to update at least a few spots in Auspice.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should pass the information to auspice, IMO, whilst being aware that our current visualisation is not going to show them any differently than a positive-strand gene (for now). This issue suggests adding a tooltip where we could surface that information.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was implemented in #1211.
I started #1279 to follow up with updating the schema and adding tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Following up on this, why did we choose to keep the BioPython representation of
None
when "the strand does not apply", rather than the GFF representation of"."
? We use GFF spec for the other strand values.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.
is GFF3's explicit null value so I suggested Python'sNone
because it translates to JSON'snull
, which is of course JSON's explicit null value. That is, I chose to preserve semantics of the value over the syntax of it.I believe GFF3 used
.
because it wanted an explicit null value to avoid the pitfalls of empty fields in a TSV row, e.g. it wants the clearness of\t.\t
instead of\t\t
. JSON'snull
serves a similar purpose.That all said, I think it would be equally reasonable to choose to preserve the GFF3 syntax so that we can say "strand is as defined in GFF3".