I think maybe a basic explanation of allele frequencies would be useful. It’s a way of estimating how many times the allele appears in the population, in a single person (diploid organism) frequencies can only be 1, 0.5 or 0 (they can have two ref, one ref one alt or two alt). As frequencies that’s heterozygous (one copy of each allele) 0.5 and 0.5, or homozygous, 1 and 0. If you are just trying to estimate for a diploid individual calls it simple in the sense that they are either homozygous or heterozygous. An individual human only has two chromosomes.
Yes, your population example is correct and allele frequencies are usually used in population level analysis.
I think can use vcftools to estimate allele frequencies across all individuals in the vcf file and all sites using the --freq command which “Outputs the allele frequency for each site in a file with the suffix ".frq"”:
vcftools --vcf my_file.vcf --freq --out my_freq_out_file
In a population imagine I sampled 3 individuals (diploid). Those 3 individuals are in my vcf. The individuals comprised of two homo people (so 4 reference chromosomes across the two individuals) and one hetero person (one reference, one alt). Well your allele frequencies at the population level would be 5 ref, 1 alt. 5/6 = 0.833 and 1/6=0.166.
The freq output might look something look like this:
CHROM POS N_ALLELES N_CHR {ALLELE:FREQ}
CHROM1 12 2 6 T:0.83333 C:0.16666
Hope that helps.