Repository navigation
[query] Refactor vds.sample_qc to use independent aggregators - #14297
Conversation
b79cd49 to
da77a47
Compare
3b1982a to
9ca0dfb
Compare
patrick-schultz
left a comment
There was a problem hiding this comment.
Very straightforward. A few comments, but otherwise looks good.
|
|
||
|
|
||
| @typecheck(global_gt=Expression, alleles=ArrayExpression) | ||
| def vmt_sample_qc_variant_annotations( |
There was a problem hiding this comment.
For both expert users and ourselves, can you add some minimal documentation for these auxiliary methods? I don't know if they should be linked in the docs or not, but they should at least have docstrings.
This will allow expert users to import these functions directly and use
them in, for example, grouped aggregators.
```python3
from hail.vds.sample_qc import vmt_sample_qc, vmt_sample_qc_variant_annotations
vmt = vds.variant_data
vmt = vmt.annotate_entries(GT=hl.vds.lgt_to_gt(vmt.LGT, vmt.LA))
ac_and_atype = _vmt_sample_qc_variant_annotations(global_gt=vmt.GT, alleles=vmt.alleles)
vmt = vmt.annotate_rows(group=compute_variant_group(vmt), **ac_and_atype)
vmt = vmt.annotate_cols(
qc=hl.agg.group_by(
vmt.group,
vmt_sample_qc(
global_gt=vmt.GT,
gq=vmt.GQ,
ac=vmt.ac,
atype=vmt.atype,
dp=vmt.DP
)
)
)
```
9ca0dfb to
28070c4
Compare
fcee490 to
14ae8fa
Compare
danking
left a comment
There was a problem hiding this comment.
Can you expose allele_ints to users in some way? See the use-case here: https://hail.zulipchat.com/#narrow/stream/379853-Hail.2FVariants/topic/Echo.20VDS/near/423120704
Out of scope, not this PR. Will do it though.
|
Remarkable, thank you! Is this exposed in the most recent version of Hail , 0.2.128 ? |
|
No, but it will be included in the next release, which should be in the next week or two. |
|
Hmmmm we were looking to merge a PR featuring this code a bit before then. We've been working from a copy of this function I had just Copy-Pasted out into some internal temp file called something like 'tmp_hail_methods' up until now, but I wouldn't want that temp file there when I merge. if it's not unreasonable would it be possible to get this in some 0.2.128.1 wheel ? |
|
No, it will be in 0.2.129 release date currently unknown, but we think it will be early March. |
|
Hi!!!
inside of a hl.agg.filter call, and where argument_dictionary looks like {'vep_name':ht.vep.field , "pass_all_vqc": hl.len(vmt.filters) == 0} and so on. Just to give an idea what the usage is going to be. |
This will allow expert users to import these functions directly and use them in, for example, grouped aggregators.