-
Notifications
You must be signed in to change notification settings - Fork 31
Add option to exclude polyphen from process consequences #685
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
Conversation
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.
One suggestion on the default and a question! But this is great, very readable.
gnomad/utils/vep.py
Outdated
vep_root: str = "vep", | ||
penalize_flags: bool = True, | ||
csq_order: Optional[List[str]] = None, | ||
has_polyphen_sift: bool = False, |
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.
Since sift isnt involved, lets just make this has_polyphen
and it should default to True or else this is a breaking change which we should avoid when possible.
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.
I will add a note in VEP 105, all the release HT won't have polyphen, we have to set this to False
.
flag_condition = (tc.lof == "HC") & (tc.lof_flags != "") | ||
modifier -= hl.if_else(flag_condition, flag_score, no_flag_score) | ||
modifier -= hl.if_else(tc.lof == "OS", 20, 0) | ||
modifier -= hl.if_else(tc.lof == "LC", 10, 0) |
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 curious, why did you move away from the case statement here?
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.
I wanted to keep the previous structure, but if I add if
in, it will be a bit redundant, so I worked with chatGPT for a few rounds to simplify it.
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.
Two little things
gnomad/utils/vep.py
Outdated
csqs = hl.literal(csq_order) | ||
csq_dict = hl.literal(dict(zip(csq_order, range(len(csq_order))))) | ||
|
||
def csq_score(tc: hl.expr.StructExpression) -> int: |
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.
I think we should make these "private" with a _ prefix since they only make sense inside this function. We haven't always done this through the repo, this function included but I think its a helpful thing to add.
gnomad/utils/vep.py
Outdated
flag_score = 500 | ||
no_flag_score = flag_score * (1 + penalize_flags) | ||
|
||
def csq_score_modifier(tc: hl.expr.StructExpression) -> float: |
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.
Same comment as above -> _csq_score_modifier
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.
I rewrote a comment but then LGTM
Co-authored-by: Mike Wilson <[email protected]>
I can't pass check for the "note", so I moved them before. Is it Okay? |
This change makes an option to not use polyphen_prediction in csq_order and its prioritization score. Test on vep_context 105.