Skip to contents

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)

Arguments

gtt

a list or data frame of genotype and/or allele depth table produced from hetTgen (or similar)

f.typ

character. type of allele frequency to be calculated (individual "ind" or population "pop")

verbose

logical. whether to show the progress of the analysis

Value

Returns a data frame or a list (if both genotype and allele depth used) of allele frequencies

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.

Author

Piyal Karunarathne

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