Description Usage Arguments Value Examples
A Function to run principal component analysis on input dataset using PLINK 1.9.
1 2 3 4 5 6 7 8 9 10 |
input.dir |
[character] The full absolute path to the directory containing the training and test dataset. If |
output.dir |
[character] The full absolute path where the result will be written to. If |
train.genotype |
[character] The prefix of PLINK binary files (bed/bim/fam) of the training dataset. |
test.genotype |
[character] The prefix of PLINK binary files (bed/bim/fam) of the test dataset. |
PCA.separate |
[logical] If TURE, the principal components are calculated from the training dataset and then project the test dataset onto those principal components. If FALSE, the principal components are calculated from the combined data of the training and test dataset. The default value is FALSE. |
PCs.count |
[numeric] To specify the number of top principal components that should be extracted. The default value is 10. |
plink.path |
[character] The full absolute path to the PLINK executable file. The executable to run is path/to/plink.exe if you are on Windows operating system, for Unix-like operating system this is path/to/plink. If |
verbose |
[logical] If TRUE, the PLINK log, error, and warning information are printed to standard out. The default value is TRUE. |
PCA
returns a list containing eigenvalues and eigenvectors of the training and test dataset:
eigenvalue |
A vector containing the top eigenvalues according to |
train.eigenvector |
A data frame containing the eigenvectors of the training dataset. |
test.eigenvector |
A data frame containing the eigenvectors of the test dataset. |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | input.dir <- system.file("extdata", package="pv")
output.dir <- system.file("extdata", package="pv")
path2plink <- '/path/to/plink'
## Not run:
pca.result <- PCA(input.dir = input.dir,
output.dir = output.dir,
train.genotype = "train",
test.genotype = "test",
PCA.separate = FALSE,
PCs.count = 10,
plink.path = path2plink,
verbose = TRUE)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.