Calculate allele frequency in a VCF File

I am trying to calculate the allele frequency of each variant in a VCF file

I am struggling to figure out the methods to implement.
Any help will be appreciated

hl.variant_qc should do what you need!

Thank you very much
But then I want to write the locus, alleles, location and allele frequency into a text file.
Thats the tricky part

That won’t be tricky. It should look roughly like:

mt = hl.import_vcf(.....)
mt = hl.variant_qc(mt)
rows = mt.rows()
to_be_exported=<whatever fields you want> .....)

Alright. Thank you very much. You have been very helpful