afs: afs function - Calculates proportion of variants per rare MAC...

View source: R/afs.R

afsR Documentation

afs function - Calculates proportion of variants per rare MAC bins

Description

The afs function calculates the proportion of variants in minor allele count (MAC) bins given parameters, as described in RAREsim.

Usage

afs(alpha = NULL, beta = NULL, b = NULL, mac_bins, pop = NULL)

Arguments

alpha

AFS function parameter alpha, does not need to be specified if default parameters are used

beta

AFS function parameter beta, does not need to be specified if default parameters are used

b

AFS function parameter b, does not need to be specified if default parameters are used

mac_bins

The rare MAC bins to use, with Lower and Upper boundaries defined

pop

The population: AFR, EAS, NFE or SAS - specified when using default parameters

Details

The default parameters will be used if an ancestrial population is specified: pop = 'AFR', 'EAS', 'NFE', or 'SAS'. Otherwise, the parameters alpha, beta, and b need to be provided. Alpha, beta, and b can be estimated from target data using the *Fit_afs* function. The MAC bins should be exhaustive, non-overlapping bins of rare allele counts with column names Lower and Upper.

Value

data frame with the MAC bins provided and proportion of variants in each bin

Examples

 data('afs_afr')
 mac <- afs_afr[,c(1:2)]
 afs(mac_bins = mac, pop = 'AFR')
 afs(alpha = 1.594622, beta =  -0.2846474, b  = 0.297495, mac_bins = mac)


meganmichelle/RAREsim documentation built on June 11, 2022, 7:34 p.m.