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

Fix MQ calculation #262

Merged
merged 2 commits into from
Sep 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
* Fixed handling of missing entries (not within a ref block / alt site) when computing `coverage_stats` in `sparse_mt.py` [[#242]] (/~https://github.com/broadinstitute/gnomad_methods/pull/242)
* Fix for error in `compute_stratified_sample_qc` where `gt_expr` caused error [(#259)](/~https://github.com/broadinstitute/gnomad_methods/pull/259)
* Add reference genome to call of `has_liftover` in `get_liftover_genome` [(#259)](/~https://github.com/broadinstitute/gnomad_methods/pull/259)
* Added fix for MQ calculation in `_get_info_agg_expr`, switched `RAW_MQ` and `MQ_DP` in calculation [(#262)](/~https://github.com/broadinstitute/gnomad_methods/pull/262)

## Version 0.4.0 - July 9th, 2020

Expand Down
4 changes: 2 additions & 2 deletions gnomad/utils/sparse_mt.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,10 +238,10 @@ def _agg_list_to_dict(
mq_tuple = agg_expr.pop(f"{prefix}RAW_MQandDP")
elif f"{prefix}RAW_MQ" in agg_expr and f"{prefix}MQ_DP" in agg_expr:
logger.info(
f"Computing {prefix}MQ as sqrt({prefix}MQ_DP/{prefix}RAW_MQ). "
f"Computing {prefix}MQ as sqrt({prefix}RAW_MQ/{prefix}MQ_DP). "
f"Note that MQ will be set to 0 if {prefix}RAW_MQ == 0."
)
mq_tuple = (agg_expr.pop(f"{prefix}MQ_DP"), agg_expr.pop(f"{prefix}RAW_MQ"))
mq_tuple = (agg_expr.pop(f"{prefix}RAW_MQ"), agg_expr.pop(f"{prefix}MQ_DP"))

if mq_tuple is not None:
agg_expr[f"{prefix}MQ"] = hl.cond(
Expand Down