Skip to contents

Use user-provided list of genetic variants to extract from imputed or WGS (DRAGEN) data and load as data.frame

Usage

extract_variants(
  in_file,
  out_bed = "tmp",
  source = "imputed",
  overwrite = FALSE,
  progress = FALSE,
  verbose = FALSE,
  very_verbose = FALSE
)

Arguments

in_file

A data frame or file path. Contains rsid, chr, and pos. For imputed genos pos is build 37. For DRAGEN pos is build 38. Other columns are ignored.

out_bed

A string. Prefix for output files (optional) default="tmp"

source

A string. Either "imputed" or "dragen" - indicating whether the variants should be from "UKB imputation from genotype" (field 22828) or "DRAGEN population level WGS variants, pVCF format [500k release]" (field 24310) default="imputed"

overwrite

Logical. Overwrite output BED files? (If output prefix is left as 'tmp' overwrite is set to TRUE), default=FALSE

progress

Logical. Show progress through each individual file, default=FALSE

verbose

Logical. Be verbose (show individual steps), default=FALSE

very_verbose

Logical. Be very verbose (show individual steps & show terminal output from Plink etc), default=FALSE

Value

A data frame

Author

Luke Pilling

Examples


liver_variants <- extract_variants(in_file=system.file("files", "pgs_liver_cirrhosis.txt", package="ukbrapR"), out_bed="liver_cirrhosis.imputed.variants")