allele.freq {rCNV}R Documentation

Generate allele frequency table for individuals or populations

Description

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

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.

Value

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

Author(s)

Piyal Karunarathne

Examples

vcf.file.path <- paste0(path.package("rCNV"), "/example.raw.vcf.gz")
vcf <- readVCF(vcf.file.path=vcf.file.path)
het.table<-hetTgen(vcf,"GT")
ad.table<-hetTgen(vcf,"AD")

# for individual based AF
frQ<-allele.freq(het.table,f.typ="ind")

#for population-wise and both allele depth and genotype tables
## Not run: frQ<-allele.freq(list(AD=ad.table,GT=het.table),f.typ="pop")


[Package rCNV version 1.2.0 Index]