adjAF_calc: adjAF_calc

View source: R/adjAF.R

adjAF_calcR Documentation

adjAF_calc

Description

Helper function for calculating allele frequencies for heterogeneous populations in genetic data given proportion of reference groups

Usage

adjAF_calc(data, reference, observed, pi.target, pi.observed)

Arguments

data

dataframe of unadjusted allele frequency for observed group, K-1 reference group allele frequencies for N SNPs

reference

character vector of the column names for K-1 reference groups. The name of the last reference group is not included as that group is not used to estimate the adjusted allele frequencies.

observed

character value for the column name of observed data group

pi.target

numeric vector of the mixture proportions for K reference groups in the target sample or subject. The order must match the order of the reference columns with the last entry matching the missing reference group.

pi.observed

numeric vector of the mixture proportions for K reference groups for the observed group. The order must match the order of the reference columns with the last entry matching the missing reference group.

Value

pi: table of input reference groups, pi.observed, and pi.target

observed.data: name of the data column for the observed group from which adjusted allele frequency is estimated

Nsnps: number of SNPs for which adjusted AF is estimated

adjusted.AF: data frame of original data with an appended column of adjusted allele frequencies


hendriau/Summix documentation built on April 25, 2024, 2:41 p.m.