calculate_allele_frequencies function

Calculate allele frequencies