Description Usage Arguments Details Value See Also
Performs principal components analysis (PCA) on either (numerically-coded) genotypes or on the underliny 2D hybridization-intensity matrices.
1 2 3 |
x |
an object of class |
extras |
a second dataset of class |
what |
|
K |
how many PCs to return. |
fast |
if |
weights |
a vector of weights by which to pre-multiply the genotypes matrix |
... |
other parameters for call to |
Uses base-R's prcomp under the hood (unless fast = TRUE). By default,
columns are centered and scaled; not doing so will likely produce a strange result. When doing PCA on genotypes,
missing values are replaced with the column mean, which in many circumstances can be interpreted as the
minor-allele frequency. (This is very similar to the behavior of PLINK.) When doing PCA on intensities, missing
values are set to zero – but even no-call genotypes have nonmissing intensities on Illumina arrays, so this is unlikely
to have any effect in practice.
a dataframe with as many rows as samples, in which the first columns are sample IDs and any associated
metadata (as returned by samples(x)), followed by the first K PCs. Scaled eigenvalues (ie. percent
of variance explained) are provided as attr(,"explained").
pca.plink() for using PLINK's (much faster and more powerful) implementation
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.