vcfR2AF: Calculate Allele Frequencies from a VCF

View source: R/vcfR2AF.R

vcfR2AFR Documentation

Calculate Allele Frequencies from a VCF

Description

Takes as input a population map (popmap) and a VCF (vcfR object) and returns an m x n matrix, where m = the number of SNPs and n = the number of populations

Usage

vcfR2AF(vcf, popmap, n_cores = 1, allele = "REF")

Arguments

vcf

a vcf stored as a vcfR object

popmap

a two column data.frame, column 1 lists individuals and column 2 population assignment

n_cores

number of cores to run with mclapply. If n_cores=1, runs with lapply instead.

allele

character vector of either "REF" or "ALT" for which allele frequency to return

Value

A matrix of population-specific allele frequencies


JimWhiting91/afvaper documentation built on Aug. 30, 2022, 10:03 a.m.