genotyping function