I need Help with the percentage of participants having a certain allele

Hi

I have hypothesized that there are more mutations in promoter regions of BRAF in patients with malignant melanoma than healthy individuals.

To test this, I have calculated the percentage of individuals (frequency) that carry a particular allele in 300 malignant melanoma participants from Genomics England. I then did subset gnomAD biobank controls for the same genomic coordinates (BRAF promoter regions). I am going to do chi-square test, so I must calculate the percentage of individuals (frequency) carrying that allele in gnomAD as well.

In gnomAD vcf file for chromosome 7, I see AC, AN, nhomo, but I am not sure how to calculate the percentage of individuals (frequency) each allele.

In Googling I found, gnomAD population frequency could be calculated by AC-nhomo/(AN/2) . However, I am not able to understand the logic here.

Could you please help me with an intuition?

Thanks for any clue