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

Deprecate get_most_severe_consequence_for_summary in favor of more flexible get_most_severe_csq_from_multiple_csq_lists #714

Open
wants to merge 38 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
c0682c5
Clean-up `process_consequences` and fix to handle `tc.lof` missingnes…
jkgoodrich May 8, 2024
6d9a0ea
Adds the following fixes to `process_consequences`:
jkgoodrich May 8, 2024
6688282
Updates to `get_most_severe_consequence_for_summary` to make it possi…
jkgoodrich May 8, 2024
d1c2f8a
Modify `process_consequences` to use `get_most_severe_consequence_for…
jkgoodrich May 8, 2024
0e856a3
Merge branch 'main' of https://github.com/broadinstitute/gnomad_metho…
jkgoodrich Jun 12, 2024
be6c4b3
deprecate get_most_severe_consequence_for_summary
jkgoodrich Jun 12, 2024
e40a74d
Pull out `prioritize_loftee_hc_no_flags` from `process_consequences`
jkgoodrich Jun 12, 2024
2bf94f1
Make add_most_severe_csq_to_tc_within_vep_root and add_most_severe_co…
jkgoodrich Jun 12, 2024
f045046
Clean-up vep consequence functions
jkgoodrich Jun 12, 2024
7939af8
Remove duplicate version of prioritize_loftee_hc_no_flags
jkgoodrich Jun 12, 2024
c612203
Add prioritize_loftee_no_flags to get_most_severe_csq_from_multiple_c…
jkgoodrich Jun 13, 2024
059b012
Add tests for vep functions used in this PR
jkgoodrich Jun 13, 2024
e899b51
Merge branch 'main' of https://github.com/broadinstitute/gnomad_metho…
jkgoodrich Jun 14, 2024
aa67cc3
Move some of the parts in `get_most_severe_csq_from_multiple_csq_list…
jkgoodrich Jun 25, 2024
d6f8d21
Small cleanup
jkgoodrich Jun 25, 2024
cce80d1
Fix the use of keep
jkgoodrich Jun 25, 2024
9de076a
Change to use `get_most_severe_csq_from_multiple_csq_lists` instead o…
jkgoodrich Jun 25, 2024
eb4c97e
Merge branch 'jg/make_expr_version_of_filter_vep_transcript_csqs' of …
jkgoodrich Jun 25, 2024
2b9aaed
use `filter_vep_transcript_csqs_expr` for loftee filter
jkgoodrich Jun 25, 2024
527615d
Merge branch 'jg/make_expr_version_of_filter_vep_transcript_csqs' of …
jkgoodrich Jun 25, 2024
fdc41d6
Use filter_vep_transcript_csqs_expr for protein coding filter
jkgoodrich Jun 25, 2024
6c4e340
Remove process_consequence changes
jkgoodrich Jun 25, 2024
7d7ff81
Move vep tests into utils directory
jkgoodrich Jun 25, 2024
e1b542a
Fix tests
jkgoodrich Jun 25, 2024
b458199
formatting of tests
jkgoodrich Jun 25, 2024
aca10f5
Move POLYPHEN ORDER to a different PR
jkgoodrich Jun 25, 2024
0688308
Add extra newline
jkgoodrich Jun 25, 2024
9cab300
Remove unneeded f-string
jkgoodrich Jun 25, 2024
e4d5cef
Change `filter_vep_transcript_csqs_expr` to set `csq_expr` as missing…
jkgoodrich Jun 25, 2024
a46d11e
Merge branch 'main' of https://github.com/broadinstitute/gnomad_metho…
jkgoodrich Oct 18, 2024
a67df82
Address reviewer comments
jkgoodrich Oct 22, 2024
aa9df9a
format
jkgoodrich Oct 22, 2024
5ecdeac
Small docstring change
jkgoodrich Oct 22, 2024
e1c9ef7
Add check for is_tc
jkgoodrich Oct 22, 2024
fbda89b
Change docstring default to correct value
jkgoodrich Oct 22, 2024
8ab6fb4
Change to get around pylint error
jkgoodrich Oct 22, 2024
141fecf
Clean up test_vep.py to add additional tests and improve the structur…
jkgoodrich Oct 24, 2024
8e25621
Fix incorrect return types
jkgoodrich Oct 24, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions gnomad/assessment/summary_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
add_most_severe_consequence_to_consequence,
filter_vep_to_canonical_transcripts,
filter_vep_to_mane_select_transcripts,
get_most_severe_consequence_for_summary,
get_most_severe_csq_from_multiple_csq_lists,
process_consequences,
)

Expand Down Expand Up @@ -231,11 +231,11 @@ def get_summary_counts(
logger.info("Filtering to mane select transcripts...")
ht = filter_vep_to_mane_select_transcripts(ht)

logger.info("Getting VEP summary annotations...")
ht = get_most_severe_consequence_for_summary(ht)

logger.info("Annotating with frequency bin information...")
ht = ht.annotate(freq_bin=freq_bin_expr(ht[freq_field], index))
logger.info("Annotating with VEP summary and frequency bin information...")
ht = ht.annotate(
freq_bin=freq_bin_expr(ht[freq_field], index),
**get_most_severe_csq_from_multiple_csq_lists(ht.vep),
)

logger.info(
"Annotating HT globals with total counts/total allele counts per variant"
Expand All @@ -248,7 +248,7 @@ def get_summary_counts(
ht.alleles,
ht.lof,
ht.no_lof_flags,
ht.most_severe_csq,
ht.most_severe_consequence,
prefix_str="total_",
)
)
Expand All @@ -259,7 +259,7 @@ def get_summary_counts(
ht[freq_field][index].AC,
ht.lof,
ht.no_lof_flags,
ht.most_severe_csq,
ht.most_severe_consequence,
)
)
)
Expand All @@ -272,7 +272,7 @@ def get_summary_counts(
ht.alleles,
ht.lof,
ht.no_lof_flags,
ht.most_severe_csq,
ht.most_severe_consequence,
)
)

Expand Down Expand Up @@ -518,7 +518,7 @@ def _create_filter_by_csq(
if not isinstance(csq_set, hl.expr.CollectionExpression):
csq_set = hl.set(csq_set)

return csq_set.contains(t.most_severe_csq)
return csq_set.contains(t.most_severe_consequence)

# Set up filters for specific consequences or sets of consequences.
csq_filters = {
Expand Down Expand Up @@ -1062,11 +1062,11 @@ def default_generate_gene_lof_summary(
)

if filter_loftee:
lof_ht = get_most_severe_consequence_for_summary(mt.rows())
lof_expr = get_most_severe_csq_from_multiple_csq_lists(mt.vep)
mt = mt.filter_rows(
hl.is_defined(lof_ht[mt.row_key].lof)
& (lof_ht[mt.row_key].lof == "HC")
& (lof_ht[mt.row_key].no_lof_flags)
hl.is_defined(lof_expr.lof)
& (lof_expr.lof == "HC")
& (lof_expr.no_lof_flags)
)

ht = mt.annotate_rows(
Expand Down
Loading
Loading