read_GRMBin: Read the GRM binary file.

Description Usage Arguments Details Value References Examples

Description

Function provided by GCTA maintainers (modified slightly) for accessing their recently introduced binary GRM format. The GRM is stored as a vector of numerics which correspond to the lower triangular elements including the diagonal. We simply read these, pull the diagonal elements, and inflate them into a full symmetric matrix. We add sample IDs to colnames and rownames for compatibility with other Kriging functions.

Usage

1
read_GRMBin(prefix, size = 4)

Arguments

prefix

The file path prefix to GRM binary files (e.g., test.grm.bin, test.grm.N.bin, test.grm.id.)

size

The length (in bytes) of each value in the raw GRM vector. Default is 4, and matches GRM writen by GCTA 1.11.

Details

Note that the GRM is described by three files, and this function assumes that all have a common prefix that is passed in.

Value

GRM of dim (N.samples x N.samples) with rownames and colnames as sample ID.

References

http://www.complextraitgenomics.com/software/gcta/estimate_grm.html

Examples

1
2
3
4
5
  ## read binary Genetic Relatedness Matrix (GRM) generated by GCTA
  grmFile <- system.file(package = "OmicKriging",
                         "doc/vignette_data/ig_genotypes.grm.bin")
  grmFileBase <- substr(grmFile,1, nchar(grmFile) - 4)
  GRM <- read_GRMBin(grmFileBase)

Example output

Loading required package: doParallel
Loading required package: foreach
Loading required package: iterators
Loading required package: parallel

OmicKriging documentation built on May 1, 2019, 9:16 p.m.