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

Modify filter_vep_transcript_csqs_expr so it can also accept hl.expr.StructExpression #748

Merged
merged 4 commits into from
Dec 20, 2024

Conversation

jkgoodrich
Copy link
Contributor

No description provided.

Copy link
Contributor

@KoalaQin KoalaQin left a comment

Choose a reason for hiding this comment

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

If this function is intended this way, there might be a difference with browser numbers.

if csqs is not None:
if "most_severe_consequence" not in csq_expr.dtype.element_type.fields:
fields = csq_expr if is_struct else csq_expr.dtype.element_type.fields
if "most_severe_consequence" not in fields:
logger.info("Adding most_severe_consequence annotation...")
Copy link
Contributor

Choose a reason for hiding this comment

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

This will actually get a different number of variants as the Browser, because they used ht.vep.most_severe_consequence directly. This function is getting less than the browser, is it because our CSQ_ORDER is updated?

Copy link
Contributor

Choose a reason for hiding this comment

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

Like this: still using DRD2 as an example:
Screenshot 2024-12-20 at 11 57 41 AM

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's why I used filter_vep_transcript_csqs_expr(ht.vep) in the toolbox

Copy link
Contributor Author

Choose a reason for hiding this comment

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

From the notebook update in the toolbox:

Screenshot 2024-12-20 at 11 10 40 AM Screenshot 2024-12-20 at 11 10 34 AM Screenshot 2024-12-20 at 11 10 27 AM Screenshot 2024-12-20 at 11 10 19 AM

Copy link
Contributor

Choose a reason for hiding this comment

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

oh, sorry, I haven't seen the toolbox PR yet. One moment.

Copy link
Contributor Author

@jkgoodrich jkgoodrich Dec 20, 2024

Choose a reason for hiding this comment

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

The only one I'm not getting the same numbers for is Other, but I'm not sure why yet

Screenshot 2024-12-20 at 11 13 08 AM Screenshot 2024-12-20 at 11 12 57 AM Screenshot 2024-12-20 at 11 12 17 AM Screenshot 2024-12-20 at 11 12 35 AM Screenshot 2024-12-20 at 11 12 46 AM

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 figured out the other, I was being stupid. Will fix, but it's in the other PR

@jkgoodrich jkgoodrich requested a review from KoalaQin December 20, 2024 19:42
Copy link
Contributor

@KoalaQin KoalaQin left a comment

Choose a reason for hiding this comment

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

LGTM!
Only a small question left.

@@ -860,19 +861,21 @@ def filter_vep_transcript_csqs(


def filter_vep_transcript_csqs_expr(
csq_expr: hl.expr.ArrayExpression,
csq_expr: Union[hl.expr.StructExpression, hl.expr.ArrayExpression],
Copy link
Contributor

Choose a reason for hiding this comment

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

You add struct, considering if it's exploded?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

well, it can be used in the way we do for the toolbox because the annotation we are filtering on is top-level, or if it's exploded. Really any situation where the annotation you want to filter on isn't in a list

@jkgoodrich jkgoodrich merged commit de65b83 into main Dec 20, 2024
5 checks passed
@jkgoodrich jkgoodrich deleted the jg/transcript_csq_filtering_struct branch December 20, 2024 20:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants