gcta_mlma: Run GCTA MLMA and returns table of association statistics.

View source: R/gcta_mlma.R

gcta_mlmaR Documentation

Run GCTA MLMA and returns table of association statistics.

Description

A wrapper for running GCTA genetic association test followed by reading of the results by read_gcta_mlma(). If GCTA returns with a non-zero status, the wrapper inspects STDOUT/STDERR and the log file for messages about non-invertible matrices or convergence failures (cases encountered often when an excessive number of covariates is provided), and returns NULL for those cases without errors or warnings in R (all other failures make the wrapper stop with an error).

Usage

gcta_mlma(
  name,
  name_grm = name,
  name_phen = name,
  name_out = name,
  file_covar = NULL,
  file_covar_cat = NULL,
  gcta_bin = "gcta64",
  threads = 0,
  verbose = TRUE
)

Arguments

name

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

name_grm

The shared name of the input binary GRM files without extensions (default same as input name).

name_phen

The base name of the phenotype file without PHEN extension (default same as input name).

name_out

The base name of the output statistics file (default same as input name), which gets extension ".mlma" added automatically.

file_covar

Optional file path of fixed continuous covariates.

file_covar_cat

Optional file path of fixed categorical covariates.

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, followed by the the path of the output file being read (after autocompleting the extensions).

Value

The table of genetic association statistics, as a tibble, read with read_gcta_mlma() (see that for more info). Certain errors in the binary (see above) cause NULL to be returned.

See Also

gcta_grm() for estimating the kinship (GRM) matrix with GCTA.

read_gcta_mlma() for parsing the output of GCTA MLMA.

delete_files_gcta_mlma() and delete_files_log() for deleting the GCTA output files.

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

Input formats for continuous (--qcovar) and categorical (--covar) covariate files: https://yanglab.westlake.edu.cn/software/gcta/#GREMLanalysis

Examples

## Not run: 
data <- gcta_mlma( name, name_out )

## End(Not run)


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