ancestry_coefficients: Compute ancestry coefficients from specified source...

Description Usage Arguments Value Author(s) References See Also Examples

View source: R/ancestry_coefficients.r

Description

ancestry_coefficients compute the proportions of shared ancestry from specified source populations

Usage

1
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.

Author(s)

Olivier Francois, olivier.francois@univ-grenoble-alpes.fr

References

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

See Also

England_BA, tfa, coverage_adjust, choose_lambda

Examples

 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())

bcm-uga/tfa documentation built on Aug. 28, 2020, 2:46 p.m.