Calculate allele frequency in a VCF File

Hello,
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= rows.select(.....<whatever fields you want> .....)
to_be_exported.export("filename.tsv")

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