Description Usage Arguments Value Author(s) References See Also Examples
View source: R/ancestry_coefficients.r
ancestry_coefficients
compute the proportions of shared ancestry from specified source populations
1 | 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.
Olivier Francois, olivier.francois@univ-grenoble-alpes.fr
François, O., Jay, F. (2020). Factor analysis of ancient population genomic samples. Under review.
England_BA
, tfa
, coverage_adjust
, choose_lambda
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | 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)
source = c("Scotland_N", "Russia_Yamnaya", "Serbia_HG")
ancestry_coefficients(model = mod,
metadata = metadata,
source = source,
target = target)
detach(England_BA)
# rm(list = ls())
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.