ancestry_coefficients compute the proportions of shared ancestry from specified source populations

ancestry_coefficients(model, metadata, source, target,
  individual = FALSE)

Arguments

model

an object of class tfa with the same number of individuals as in metadata.

metadata

an object of class tfa_metadata containing metadata on Group.IDs.

source

a vector of ancestral group ID's from the list of Group.IDs (character).

target

a vector of target group ID's from the list of Group.IDs (character).

individual

a logical indicating whether individual ancestry coefficients should be computed.

Value

a matrix with coefficients equal to the ancestry proportions of each target population from each source.

References

François, O., Jay, F. (2020). Factor analysis of ancient population genomic samples. Under review.

See also

Examples

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.2068270
source = 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
detach(England_BA) # rm(list = ls())