hypo_import_genotype_freq takes a genotype table (such as VCFtools --012 output) and computes genotype frequencies.

hypo_import_genotype_freq(file_path, AA = "ref", delim = " ")

Arguments

file_path

string scalar (mandatory), the input file

AA

string scalar ('ref' or 'major', optional), should the reference or the major allele be encoded as A?

delim

string scalar (optional), delimiter of the input file

Details

This function takes a genotype table (a transposed VCFtools --012 output with samples as columns and SNPs as rows) and computes genotype frequencies from it. Genotypes are assumed to be encoded as:

  • 0: Homozygous (reference allele)

  • 1: Heterozygous

  • 2: Homozygous (alternative allele)

The genotype frequencies can later be visualized using the ggtern package.

This approach assumes biallelic SNPs!