pca_af | R Documentation |
Compute matrix of individual-specific allele frequencies via PCA
pca_af(X, d, override = FALSE, ploidy = 2, tol = 1e-13, m_chunk = 1000)
X |
A matrix of SNP genotypes, i.e. an integer matrix of 0's,
1's, 2's and |
d |
Number of logistic factors, including the intercept |
override |
Optional boolean passed to |
ploidy |
Ploidy of data, defaults to 2 for bi-allelic unphased SNPs |
tol |
Tolerance value passed to |
m_chunk |
If |
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)
summary(abs(allele_freqs_lfa-allele_freqs_pca))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.