read_plink_glm: Read 'plink2 –glm' association table

View source: R/read_plink_glm.R

read_plink_glmR Documentation

Description

Parses the output generated by plink2 with option --glm (genetic assocation test). Returned table has column names standardized for convenience. Validated with plink2 version "v2.00a6LM AVX2 Intel (4 May 2024)".

Usage

read_plink_glm(
  file,
  pheno = "PHENO1",
  ext = "glm.linear",
  verbose = TRUE,
  v = "a6LM"
)

Arguments

file

The file path to read, missing the extension and phenotype identifier.

pheno

An identifier of the phenotype used in file path. The default "PHENO1" is for the first, unnamed phenotype in a FAM table.

ext

The expected file extension. (In this case, you cannot set to NA to prevent adding any extension to file.) The default extension "glm.linear" agrees with the output of plink_glm().

verbose

If TRUE (default) function reports the path of the file being loaded (after autocompleting the extensions).

v

Code for format version. Only special value is 'a3LM', which was a previously validated version (full: "v2.00a3LM AVX2 Intel (4 Aug 2021)") with a certain column specification, but which does not work for latest version. Any other value sets column specifications to those of "v2.00a6LM AVX2 Intel (4 May 2024)".

Value

The table as a tibble. Original names (as they appear in the header line of the file) are modified by lowercasing all, followed by these specific mappings to ensure that columns shared by BIM table have the same names as those returned by genio::read_bim(), the association p-value is "p", and the regression coefficient is "beta" ("orig" -> "new"):

  • "#chrom" -> "chr"

See Also

plink_glm() wrapper for executing plink2 --glm and reading the results.

Examples

## Not run: 
data <- read_plink_glm( file )

## End(Not run)


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