-
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: get_downsamplings ()
, remove_coverage_outliers ()
, and filter_for_mu()
#507
Conversation
gnomad/utils/filtering.py
Outdated
``` | ||
gerp_data = ht.aggregate(gerp=hl.agg.hist(context_ht.gerp, -12.3, 6.17, 100)) | ||
cumulative_data = np.cumsum(summary_hist.gerp.bin_freq) + summary_hist.gerp.n_smaller | ||
np.append(cumulative_data, [cumulative_data[-1] + summary_hist.gerp.n_larger]) | ||
list(zip(summary_hist.gerp.bin_edges, cumulative_data / max(cumulative_data))) | ||
``` |
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.
Does this need to be in a function of some sort?
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.
moved to constraint repo but still need to look into this more closely
6883590
to
8d00de2
Compare
… into constraint_mutation_rate_table
gnomad/utils/constraint.py
Outdated
`freq_meta_expr`. Default is 'adj'. | ||
""" | ||
indices = hl.enumerate(freq_meta_expr).filter( | ||
lambda f: (f[1].size() == 3) |
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 comment for why 3
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.
actually, this doesn't seem to be needed, anything filtered to 'downsampling' already has a dict size of 3
Co-authored-by: jkgoodrich <33063077+jkgoodrich@users.noreply.github.com>
Co-authored-by: jkgoodrich <33063077+jkgoodrich@users.noreply.github.com>
`freq_meta_expr`. Default is 'adj'. | ||
""" | ||
indices = hl.enumerate(freq_meta_expr).filter( | ||
lambda f: (f[1].get("group") == variant_quality) |
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.
Just confirming lambda f: (f[1].size() == 3)
is not needed. There is no case where there will be something like: {'downsampling': '5000', 'group': 'adj', 'pop': 'global'}
and {'downsampling': '5000', 'group': 'adj', 'pop': 'global', 'other_strata':'some_val}
and we only want {'downsampling': '5000', 'group': 'adj', 'pop': 'global'}
?
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.
at least not in the existing datasets, but I could leave it in to be on the safe size
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.
I think it's fine for now and we can update if our downsampling frequencies get more complex
Co-authored-by: jkgoodrich <33063077+jkgoodrich@users.noreply.github.com>
Co-authored-by: jkgoodrich <33063077+jkgoodrich@users.noreply.github.com>
`freq_meta_expr`. Default is 'adj'. | ||
""" | ||
indices = hl.enumerate(freq_meta_expr).filter( | ||
lambda f: (f[1].get("group") == variant_quality) |
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.
I think it's fine for now and we can update if our downsampling frequencies get more complex
No description provided.