-
Notifications
You must be signed in to change notification settings - Fork 29
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
Add generic constraint functions - annotate_mutation_type(), trimer_from_heptamer(), collapse_strand(), add_most_severe_csq_to_tc_within_vep_root() #474
Conversation
since there are only three functions here you can add the names of them in the title of this PR to be more descriptive (there will also probably be future PRs moving over more of the generic constraint functions so it's helpful to have a little more detail in the titles) |
gnomad/utils/constraint.py
Outdated
from gnomad.utils.vep import add_most_severe_consequence_to_consequence | ||
|
||
|
||
def annotate_variant_types( |
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.
there's a similarly named function with a different definition for variant_type here:
gnomad_methods/gnomad/utils/annotations.py
Line 751 in b3f960b
def add_variant_type(alt_alleles: hl.expr.ArrayExpression) -> hl.expr.StructExpression: |
so i would suggest changing the function name, maybe "annotate_mutation_type" and change below instances of "variant_type" to "mutation_type"....these names are very similar but it might at least help clear up some confusion
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.
Does any place in pipeline use 'variant_type'? I can't find any.
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.
looks like it was mostly used for plotting purposes
this comment still needs to be resolved |
gnomad/utils/constraint.py
Outdated
- variant_type_model | ||
|
||
:param t: Input Table or MatrixTable. | ||
:param trimer: Whether to use trimers for context. Defaults to False (uses heptamers as context). |
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.
If trimer is set to true here, but the context is actually formatted as a heptamer within the ht/mt this function wouldn't behave as expected. I think it's actually safer to drop this parameter and within the function set the mid_index by first checking the length of context to see if it is formatted as a trimer or a heptamer.
gnomad/utils/constraint.py
Outdated
from gnomad.utils.vep import add_most_severe_consequence_to_consequence | ||
|
||
|
||
def annotate_variant_types( |
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.
looks like it was mostly used for plotting purposes
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.
just one last change on this one
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.
LGTM!
Add generic functions that were in
gnomad_lof
repo.