How to calculate allelic and genotypic frequencies