coverage_adjust adjusts the matrix of genotypes for low and uneven coverage of individual genomes.

coverage_adjust(Y = NULL, coverage = NULL, K, lambda = 1e-05,
  log = FALSE)

Arguments

Y

an nxp numeric data matrix containing genetic information for n individuals recorded in p columns. Genetic information could be encoded as any numeric value, usually as genotypes taking values in 0,1,2. Missing data are not allowed.

coverage

a numerical vector containing information on each DNA sample coverage.

K

a nonnegative integer for the number of components in the data matrix Y. It could be obtained from a PCA of the data matrix.

lambda

a ridge regularization parameter, to be kept at a small values (defaut 1e-5)).

log

a logical value indicating that corrections are performed from log(coverage) instead of coverage.

Value

an nxp numeric matrix containing the n corrected genotypes

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) coverage <- meta$Coverage geno <- coverage_adjust(genotype, coverage, K = 4, log = TRUE) detach(England_BA)