-
Notifications
You must be signed in to change notification settings - Fork 29
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
Add generic constraint functions: oe_aggregation_expr()
, compute_pli()
, oe_confidence_interval()
, calculate_raw_z_score()
, calculate_raw_z_score_sd()
#505
Conversation
Co-authored-by: klaricch <kristen@broadinstitute.org>
gnomad/utils/constraint.py
Outdated
:param prefix: Prefix of upper and lower bounds, defaults to 'oe'. | ||
:param alpha: The significance level used to compute the confidence interval. | ||
Default is 0.05. | ||
:param select_only_ci_metrics: Whether to return only upper and lower bounds |
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.
will we ever need this to be false or can we just remove this?
gnomad/utils/constraint.py
Outdated
|
||
:param ht: Input Table with pLoF variants, missense variants, or synonymous | ||
variants. | ||
:param annotation_name: Annotation name used for constraint metrics to distinguish |
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.
maybe should provide some examples here
gnomad/utils/constraint.py
Outdated
over a range of lambda (`lamb` in `dpois`) values, which are given by the expected | ||
number of variants times a varying parameter ranging between 0 and 2. The |
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.
why between 0 and 2?
gnomad/utils/constraint.py
Outdated
""" | ||
ht = ht.annotate(_obs=obs, _exp=exp) | ||
# Set up range between 0 and 2. | ||
oe_ht = ht.annotate(_range=hl.range(0, 2000).map(lambda x: hl.float64(x) / 1000)) |
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.
Should these be parameters, why 1000?
gnomad/utils/constraint.py
Outdated
oe_ht = oe_ht.transmute( | ||
**{ | ||
f"{prefix}_lower": hl.if_else( | ||
oe_ht._obs > 0, oe_ht._range[oe_ht._lower_idx], 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.
Add to docstring that we cut this off
Co-authored-by: klaricch <kristen@broadinstitute.org>
… into constraint_finalize_datasets � Conflicts: � gnomad/utils/constraint.py
Co-authored-by: klaricch <kristen@broadinstitute.org>
…t to only return the std dev of the raw z-score
… into constraint_finalize_datasets_jkg
… into constraint_finalize_datasets
…adinstitute/gnomad_methods into constraint_finalize_datasets_jkg
…of `neg_raw_z_only` and `both`
…ets_jkg Suggested changes to the Add generic constraint functions: compute_oe_per_transcript(), compute_all_pLI_scores(), pLI(), oe_confidence_interval(), calculate_z(), calculate_z_scores() PR
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.
lgtm!
compute_oe_per_transcript()
, compute_all_pLI_scores()
, pLI()
, oe_confidence_interval()
, calculate_z()
, calculate_z_scores()
oe_aggregation_expr()
, compute_pli()
, oe_confidence_interval()
, calculate_raw_z_score()
, calculate_raw_z_score_sd()
Add generic constraint functions used to compute constraint metrics.