Exporting matrix table with phased data to plink


#1

I’m looking for a way to export my matrix table that contains phased data to plink format.
When I use export_plink, I get the error “HailException: Only support ploidy == 2 and unphased. Found 0|0.”

How can I deal with this issue? I don’t mind losing the phasing, but I would really like to export it.
Thank you!


#2

ah, this is annoying. We should have an easier way to unphase. Currently, this should work:

mt = mt.select_entries(GT = hl.unphased_diploid_gt_index_call(mt.GT.n_alt_alleles()))

#3

thank you!!