read_plink_hardy: Read 'plink2 –hardy' output table

View source: R/read_plink_hardy.R

read_plink_hardyR Documentation

Description

Parses the output generated by plink2 with option --hardy (Hardy-Weinberg test). Returned table has column names standardized for convenience. Validated with plink2 version "v2.00a3LM AVX2 Intel (4 Aug 2021)".

Usage

read_plink_hardy(file, ext = "hardy", verbose = TRUE)

Arguments

file

The file path to read, missing the extension.

ext

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

verbose

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

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(), and the test p-value is "p" ("orig" -> "new"):

  • "#chrom" -> "chr"

  • "a1" -> "ref"

  • "ax" -> "alt"

  • "midp" -> "p" if present (in outputs with option "midp" this column replaces "p")

See Also

plink_hardy() wrapper for executing plink2 --hardy and reading the results.

Examples

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

## End(Not run)


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