So the problem here is that **data_tmp_bi.info
is a struct that contains AC
. So in this line:
data_tmp_bi = data_tmp_bi.annotate_rows(info = hl.struct(AC=data_tmp_bi.info.AC[data_tmp_bi.a_index - 1],**data_tmp_bi.info))
you’re saying "Make a struct called info, with a field called AC, and all of the old fields from data_tmp_bi.info
". Since one of the old fields is AC
, you’re defining AC
twice, which isn’t allowed.
If your goal is “Keep the rest of the info struct the same, just change the AC field”, the easiest way to do that is probablly to do:
data_tmp_bi = data_tmp_bi.annotate_rows(info = data_tmp_bi.info.annotate(AC=data_tmp_bi.info.AC[data_tmp_bi.a_index - 1])))
That says "The new info
field is determined by taking the old info
field and overwriting AC