allele.freq | R Documentation |
Get alternative allele frequency across all individuals per SNP from the genotype or allele depth tables
allele.freq(gtt, f.typ = c("pop", "ind"), verbose = TRUE)
gtt |
a list or data frame of genotype and/or allele depth table produced from |
f.typ |
character. type of allele frequency to be calculated (individual |
verbose |
logical. whether to show the progress of the analysis |
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.
Returns a data frame or a list (if both genotype and allele depth used) of allele frequencies
Piyal Karunarathne
## Not run: 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
frQ<-allele.freq(list(AD=ad.table,GT=het.table),f.typ="pop")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.