Skip to content

Conversation

KoalaQin
Copy link
Contributor

@KoalaQin KoalaQin commented Mar 15, 2024

This change makes an option to not use polyphen_prediction in csq_order and its prioritization score. Test on vep_context 105.

Copy link
Contributor

@mike-w-wilson mike-w-wilson left a 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.

vep_root: str = "vep",
penalize_flags: bool = True,
csq_order: Optional[List[str]] = None,
has_polyphen_sift: bool = False,
Copy link
Contributor

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.

Copy link
Contributor Author

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.

Comment on lines +324 to +327
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)
Copy link
Contributor

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?

Copy link
Contributor Author

@KoalaQin KoalaQin Mar 18, 2024

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.

@KoalaQin KoalaQin requested a review from mike-w-wilson March 18, 2024 18:28
Copy link
Contributor

@mike-w-wilson mike-w-wilson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two little things

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:
Copy link
Contributor

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.

flag_score = 500
no_flag_score = flag_score * (1 + penalize_flags)

def csq_score_modifier(tc: hl.expr.StructExpression) -> float:
Copy link
Contributor

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

@KoalaQin KoalaQin requested a review from mike-w-wilson March 21, 2024 15:20
Copy link
Contributor

@mike-w-wilson mike-w-wilson left a 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]>
@KoalaQin
Copy link
Contributor Author

I can't pass check for the "note", so I moved them before. Is it Okay?

@KoalaQin KoalaQin merged commit 7c0c994 into main Mar 21, 2024
@KoalaQin KoalaQin deleted the qh/option_polyphen branch April 3, 2024 13:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants