ancestry_coefficients.Rd
ancestry_coefficients
compute the proportions of shared ancestry from specified source populations
ancestry_coefficients(model, metadata, source, target, individual = FALSE)
model | an object of class |
---|---|
metadata | an object of class |
source | a vector of ancestral group ID's from the list of |
target | a vector of target group ID's from the list of |
individual | a logical indicating whether individual ancestry coefficients should be computed. |
a matrix with coefficients equal to the ancestry proportions of each target population from each source.
François, O., Jay, F. (2020). Factor analysis of ancient population genomic samples. Under review.
library(tfa) # Ancient DNA from Bronze Age Great Britain samples # including Steppe (Yamnaya), hunter gatherers, and early farmers from Anatolia data(england_ba) attach(England_BA) metadata <- as.tfa_metadata(meta) coverage <- meta$Coverage geno <- coverage_adjust(genotype, coverage, K = 4, log = TRUE) mod <- tfa(age, geno, k = 3, lambda = 5e-1, center = TRUE, coverage = coverage, log = TRUE) target = c("England_Bell_Beaker", "England_BA") source = c("Anatolia_N", "Russia_Yamnaya", "Serbia_HG") ancestry_coefficients(model = mod, metadata = metadata, source = source, target = target)#> Anatolia_N Russia_Yamnaya Serbia_HG #> England_Bell_Beaker 0.3554118 0.4070175 0.2375707 #> England_BA 0.4163061 0.3768669 0.2068270source = c("Scotland_N", "Russia_Yamnaya", "Serbia_HG") ancestry_coefficients(model = mod, metadata = metadata, source = source, target = target)#> Scotland_N Russia_Yamnaya Serbia_HG #> England_Bell_Beaker 0.3332864 0.5830761 0.08363752 #> England_BA 0.3903898 0.5830904 0.02651977