Assign hom ref genotype to missing values

Hello, for variants with missing genotype, is there a way to assign hom-ref genotype to these
variants in a matrix table in Hail?

Hi @hansh2323 , the genotype is an entry field of the matrix table, so you can combine the use of annotate_entries with a condition that checks if the GT field of an entry is defined. So you’ll end up with something like

mt = mt.annotate_entries(GT = hl.if_else(hl.is_defined(mt.GT), mt.GT, hl.Call([0, 0])))

@danielgoldstein thanks a lot!