The R function for calculating ancestry adjusted allele frequencies in heterogeneous genetic data. Credit goes to Katie Marker for developing the method and to the Hidden Ancestries research Project headed by Dr Audrey Hendricks.

Usage

updateAF(D=NULL,ancestry=NULL,k=NULL)

Arguments

data Dataframe with N SNPs. columns include chromosome, RSID, base pair, A1, A2, k reference ancestry allele frequencies, observed ancestry allele frequencies.

reference Array of character strings. List of column names for the ancestries to be included in the model. This includes both the k-1 reference ancestries and the single observed ancestry.

observed Character string. Column name for the observed ancestry. This column name should be included in the refernce input as well.

pi_observed k ancestry proportion value for the observed ancestry.

pi_target k ancestry proportion values for the target ancestry.

panel Array of character strings. Same as reference, but the observed ancestry name is replaced with the reference ancestry name for use the the ancestr function. When this input is entered in place of pi_target, the ancestr function will be called using observed as the observed ancestry and panel as the reference panel

Details

Calculates ancestry adjusted allele frequencies in heterogeneous genetic allele frequency data.

Value

data the function returns reference ancestry columns from the original dataframe with an additional column at the end. The additional collumn is an array of the updated allele frequencies calculated for each SNP.

Note

References

See Also

ancestr()

Example

data:

library("RHiddenAncestries")
data(ancestryData)

head(ancestryData)

Example

E <- updateAF(data = ancestryData,
              reference = c("ref_AF_eur_1000G", "gnomAD_AF_afr"),
              observed = "gnomAD_AF_afr",
              pi_observed = c(0.1596, 0.8404),
              pi_target = c(1,0) )
head(E)


GregoryMatesi/RHiddenAncestries documentation built on July 9, 2020, 7:58 a.m.