Hi hail team,
I’m running this code:
intervals_ht = intervals_ht.annotate(_interval_key=intervals_ht.key)
callrate_mt = callrate_mt.annotate_rows(**intervals_ht[callrate_mt.locus]._interval_key)
callrate_mt = callrate_mt.filter_rows(hl.is_defined(callrate_mt.interval))
callrate_mt = callrate_mt.select_entries(GT_not_called=hl.or_missing(hl.is_missing(callrate_mt.GT), hl.struct()))
callrate_mt = callrate_mt.group_rows_by(*list(intervals_ht.key)).aggregate(callrate=hl.agg.fraction(hl.is_missing(callrate_mt.GT_not_called)))
intervals_ht = intervals_ht.drop('_interval_key')
callrate_mt = callrate_mt.annotate_rows(interval_info=hl.struct(**intervals_ht[callrate_mt.row_key]))
When I try to plot callrate
, I get this error:
Error summary: HailException: 'hist': start=1.00000e+00 end=1.00000e+00 bins=50 requires positive bin size.
Changing the definition of callrate
to
callrate_mt = callrate_mt.group_rows_by(*list(interval_ht.key)).aggregate(callrate=hl.agg.count_where(
hl.is_missing(callrate_mt.GT_not_called)) / callrate_mt.count_rows())
produces a normal plot. Why does fraction
have different behavior from the aggregation in this case?