pca_af: PCA Allele frequencies

Description Usage Arguments Details Value Examples

View source: R/af.R

Description

Compute matrix of individual-specific allele frequencies via PCA

Usage

1
pca_af(X, d, override = FALSE)

Arguments

X

a matrix of SNP genotypes, i.e. an integer matrix of 0's, 1's, and 2's. Sparse matrices of class Matrix are not supported (yet).

d

number of logistic factors, including the intercept

override

optional boolean to bypass Lanczos bidiagonalization SVD. Usually not advised unless encountering a bug in the SVD code.

Details

This corresponds to algorithm 1 in the paper. Only used for comparison purposes.

Value

Matrix of individual-specific allele frequencies.

Examples

1
2
3
4
LF = lfa(hgdp_subset, 4)
allele_freqs_lfa = af(hgdp_subset, LF)
allele_freqs_pca = pca_af(hgdp_subset, 4, LF)
summary(abs(allele_freqs_lfa-allele_freqs_pca))

lfa documentation built on Nov. 8, 2020, 7:30 p.m.