gcta_pca: Estimate principal components with GCTA

View source: R/gcta_pca.R

gcta_pcaR Documentation

Estimate principal components with GCTA

Description

A wrapper for running GCTA's PCA.

Usage

gcta_pca(
  name,
  name_out = name,
  n_pcs = 10,
  gcta_bin = "gcta64",
  threads = 0,
  verbose = TRUE
)

Arguments

name

The shared name of the input binary GRM files without extensions.

name_out

The base name of the output eigenvec/eigenval files (default same as input name), which gets extensions added automatically.

n_pcs

The number of eigenvectors/eigenvalues (a.k.a. principal components) to calculate.

gcta_bin

The path to the binary executable. Default assumes gcta64 is in the PATH.

threads

The number of threads to use. The values 0 (default), NA, or NULL use all threads available (the output of parallel::detectCores()).

verbose

If TRUE (default), prints the command line before it is executed.

Value

Nothing (the eigenvec/eigenval files are not read in; see example below for reading with a different function).

See Also

genio::read_eigenvec() for reading eigenvec files.

delete_files_pca() for deleting the eigenvec/eigenval outputs.

delete_files_log() for deleting GCTA log files.

system3(), used (with ret = FALSE) for executing GCTA and error handling.

http://cnsgenomics.com/software/gcta/#PCA

Examples

## Not run: 
# create PCs (on file)
gcta_pca( name, name_out )

# read file with genio
data <- genio::read_eigenvec( name_out )

## End(Not run)


OchoaLab/genbin documentation built on Nov. 14, 2024, 7:33 p.m.