-
Notifications
You must be signed in to change notification settings - Fork 21
add hail sample_qc metrics #1046
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
Conversation
|
||
def run_hail_sample_qc(mt: hl.MatrixTable, sample_type: SampleType) -> hl.MatrixTable: | ||
mt = filter_to_autosomes(mt) | ||
mt = hl.split_multi_hts(mt) |
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.
can this use the split_multi_hts wrapper?
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.
this comes from the old script, but I'm thinking it might not be necessary since the mt is our validated callset on which we already call split_multi_hts
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.
some quibbling abt annotation names
HAIL_QC_METRICS = [ | ||
'n_snp', | ||
'r_ti_tv', | ||
'r_insertion_deletion', | ||
'n_insertion', | ||
'n_deletion', | ||
'r_het_hom_var', | ||
] |
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.
only brief note: we know that all of these are used and relevant, right ?
|
||
strat_ht = mt.cols() | ||
qc_metrics = {metric: strat_ht.sample_qc[metric] for metric in sample_qc_metrics} | ||
strata = {'qc_pop': strat_ht.qc_pop} |
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.
strata = {'qc_pop': strat_ht.qc_pop} | |
strata = {'gq_gen_anc': strat_ht. gq_gen_anc} |
this is already annotated by then, yea ?
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.
yup good find
return annotate_qc_gen_anc(mt) | ||
mt = annotate_qc_gen_anc(mt) | ||
mt = run_hail_sample_qc(mt, sample_type) | ||
return mt.drop('qc_pop') |
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.
you could probably do this sooner, unless u really want to run sample_qc while stratifying on only the default (90%) genetic ancestry inference
adds hail's
sample_qc
metrics to sample_qc json