plink_pca | R Documentation |
A wrapper for running plink2's PCA.
In addition to the arguments listed below, the executable is run with --silent
, --nonfounders
(to use all individuals whether they are labeled as founders or not), and --bad-freqs
(to apply even when sample sizes are very small).
plink_pca(
name,
name_out = name,
n_pcs = 10,
maf = 0.1,
approx = FALSE,
plink_bin = "plink2",
threads = 0,
verbose = TRUE
)
name |
The shared name of the input plink BED/BIM/FAM files without extensions. |
name_out |
The base name of the output eigenvec/eigenval files (default same as input |
n_pcs |
The number of eigenvectors/eigenvalues (a.k.a. principal components) to calculate. |
maf |
The minor allele frequency threshold to apply to data prior to eigendecomposition. |
approx |
Apply approximate PCA algorithm. |
plink_bin |
The path to the binary executable.
Default assumes |
threads |
The number of threads to use.
The values 0 (default), NA, or NULL use all threads available (the output of |
verbose |
If |
Nothing (the eigenvec/eigenval files are not read in; see example below for reading with a different function).
genio::read_eigenvec()
for reading eigenvec files.
delete_files_pca()
for deleting the eigenvec/eigenval outputs.
delete_files_log()
for deleting plink log files.
system3()
, used (with ret = FALSE
) for executing plink2 and error handling.
## Not run:
# create PCs (on file)
plink_pca( name, name_out )
# read file with genio
data <- genio::read_eigenvec( name_out )
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.