gcta_grm: Estimate kinship (GRM) with GCTA

View source: R/gcta_grm.R

gcta_grmR Documentation

Estimate kinship (GRM) with GCTA

Description

Uses gcta64 with -grm and default option to estimate the kinship matrix. The output file will be named name_out using the output name below with extensions grm.bin, grm.N.bin, and grm.id.

Usage

gcta_grm(
  name,
  name_out = name,
  gcta_bin = "gcta64",
  threads = 0,
  verbose = TRUE
)

Arguments

name

The shared name of the input plink BED/BIM/FAM files without extensions.

name_out

The base name of the output binary GRM files (default same as input name), which get extensions (grm.bin, grm.N.bin, grm.id) added automatically.

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 kinship matrix is not read in; see example below for reading with a different function).

See Also

genio::read_grm() for reading binary GRM matrices.

gcta_mlma() for running GWAS with GCTA.

gcta_pca() for estimating PCA from GRM with GCTA.

genio::delete_files_grm() for deleting GRM files.

delete_files_log() for deleting the GCTA log file.

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

Examples

## Not run: 
# create kinship matrix estimate (on file)
gcta_grm( name, name_out )

# read file with genio
data <- genio::read_grm( name_out )
kinship <- data$kinship

## End(Not run)


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