
Generate allele frequency table for individuals or populations
Source:R/allele_tests.R
allele.freq.Rd
Get alternative allele frequency across all individuals per SNP from the genotype or allele depth tables
Usage
allele.freq(gtt, f.typ = c("pop", "ind"), verbose = TRUE)
Details
If the allele frequencies to be calculated for populations from both genotype table and the allele depth table, they must be provided in a list with element names AD
for allele depth table and GT
for the genotype table. See the examples.
Examples
if (FALSE) vcf.file.path <- paste0(path.package("rCNV"), "/example.raw.vcf.gz")
vcf <- readVCF(vcf.file.path=vcf.file.path)
#> Error: object 'vcf.file.path' not found
het.table<-hetTgen(vcf,"GT")
#> Error: object 'vcf' not found
ad.table<-hetTgen(vcf,"AD")
#> Error: object 'vcf' not found
# for individual based AF
frQ<-allele.freq(het.table,f.typ="ind")
#> Error: object 'het.table' not found
#for population-wise and both allele depth and genotype tables
frQ<-allele.freq(list(AD=ad.table,GT=het.table),f.typ="pop") # \dontrun{}
#> Error: object 'ad.table' not found