Local_to_global: local alleles not strictly increasing: [0,2,1]

Hello,

I’m using the function hl.vds.local_to_global() to convert LAD to AD, and got this error “Error summary: HailException: local_to_global: local alleles not strictly increasing: [0,2,1]”. Do you know what would be the cause? Thanks!

Here is my command in case helpful.

mt = vds.variant_data.annotate_entries(
    AD = hl.vds.local_to_global(vds.variant_data.LAD, 
                                vds.variant_data.LA, 
                                n_alleles=hl.len(vds.variant_data.alleles), 
                                fill_value=0, 
                                number='R')
)

Hmm. I’m not sure what the issue is. Let me tag in our VDS expert, @tpoterba .

is this an AoU VDS? Can you share the script so we know any transormatinos that occurred between the read and error?

Yes, this is an AoU VDS. The script is simple. Just read vds and then transform. Thanks for checking!
vds = hl.vds.read_vds(vds_path)
mt = vds.variant_data.annotate_entries(
AD = hl.vds.local_to_global(vds.variant_data.LAD,
vds.variant_data.LA,
n_alleles=hl.len(vds.variant_data.alleles),
fill_value=0,
number=‘R’)
)

In case it is helpful, I can successfully convert LGT to GT in the same vds using hl.experimental.lgt_to_gt().

I think this is a bug in hl.vds.local_to_global – I was too strict making this check in order to generate slightly faster code.

Here’s a tracking issue:

I hope to have some time to make a patch this afternoon

1 Like