converters from text-based haplotype matrix to binary haplotype matrix, and for sampling haplotypes into genotypes