script for computing g-anc from l-anc haplotypes