BGData (version 2.1.0)

BGData-class: An S4 Class to Represent Phenotype and Genotype Data.

Description

This class is inspired by the phenotype/genotype file format .raw and its binary companion (also known as .bed) of PLINK. It is used by several functions of this package such as GWAS() for performing a Genome Wide Association Study or getG() for calculating a genomic relationship matrix.

Arguments

Slots

geno

A '>geno object that contains genotypes. '>geno is a class union of several matrix-like types, many of them suitable for very large datasets. Currently supported are LinkedMatrix::LinkedMatrix, BEDMatrix::BEDMatrix, bigmemory::big.matrix, ff_matrix, and matrix.

pheno

A data.frame that contains phenotypes.

map

A data.frame that contains a genetic map.

Details

There are several ways to create an instance of this class:

A .ped file can be recoded to a .raw file in PLINK using plink --file myfile --recodeA, or converted to a BED file using plink --file myfile --make-bed. Conversely, a BED file can be transformed back to a .ped file using plink --bfile myfile --recode or to a .raw file using plink --bfile myfile --recodeA without losing information.

Examples

Run this code
# NOT RUN {
X <- matrix(data = rnorm(100), nrow = 10, ncol = 10)
Y <- data.frame(y = runif(10))
MAP <- data.frame(means = colMeans(X), freqNA = colMeans(is.na(X)))
DATA <- BGData(geno = X, pheno = Y, map = MAP)

dim(DATA@geno)
head(DATA@pheno)
head(DATA@map)
# }

Run the code above in your browser using DataCamp Workspace