readreference: Read the Reference Data for a PC projection

Description Usage Arguments Value Examples

View source: R/input.R

Description

Read in SNP weightings, eigenvalues and SNP info.

SNP info must be in <fileroot>.afreq.gz Weights are read according to mode and transpose flag.

Plink weights are in <fileroot>.eigenvec.var.gz/<fileroot>.eigenvec.tvar.gz flashpca weights are in <fileroot>.tload.gz/<fileroot>.tload.gz

Plink (Eigen) values are in <fileroot>.eigenval flashpca (Singular) values are in <fileroot>.val

Usage

1
2
3
4
5
6
7
8
readreference(
  fileroot,
  mode = "flashpca",
  transpose = FALSE,
  checkonly = FALSE,
  minfreq = 0.001,
  verbose = TRUE
)

Arguments

fileroot

fileset to read in

mode

Data mode; one of flashpca (default) or plink

transpose

Whether SNP weights are transposed (default FALSE)

checkonly

default FALSE. If TRUE, no file reading is done but the files are checked for existing

minfreq

(default 0.001) minimum allele frequency allowed in the normalisation phase, to prevent ultra-rare SNPs from being upweighted too much

verbose

default TRUE. Whether to output progress.

Value

An object of class "referencedata" which is a list containing:

Examples

1
2
3
4
5
## Not run: 
tfile=pcapred.ref::ukb_pcs_18()
ref=readreference(tfile)

## End(Not run)

danjlawson/pcapred documentation built on Oct. 7, 2021, 3:47 p.m.