Calculate minor allele frequency (MAF) at every loci
compute_maf(snpdata, include_het = FALSE, mat_name = "GT", name = NULL)
An object of class SNPdata
A Boolean that specifies whether to account for the
heterozygous allele or not. This can only be activated when
mat_name = "GT"
or mat_name = "Imputed"
.
A string with the name of the matrix to be used. Default is "GT". The other possible values are "Phased", "Imputed", "Phased_imputed".
A character with the name of the new column that will created to store the MAF values.
The input SNPdata
object with following 2 additional columns in the
details table:
MAF: minor allele frequency at every each SNPs
MAF_allele: the code for the minor allele. Possible values are: 1: the alternate allele is the minor allele, 0: the reference allele is the minor allele, 0/1: the heterozygous allele is the minor allele, 0=1: the reference and alternate alleles have the same frequencies, 0=1=2: the three alleles have the same frequencies.
If include_het = FALSE
, the mixed alleles will not be considered
in the MAF calculation.
if (FALSE) { # \dontrun{
snpdata <- compute_maf(
snpdata,
include_het = FALSE,
mat_name = "GT"
)
} # }