pca_af {lfa} | R Documentation |
Compute matrix of individual-specific allele frequencies via PCA
pca_af(X, d, override = FALSE)
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. |
This corresponds to algorithm 1 in the paper. Only used for comparison purposes.
Matrix of individual-specific allele frequencies.
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))