Learn R Programming

pedigree (version 1.4.2)

calcG: Function to calculate a relationship matrix from marker data (usually allele count data), G matrix.

Description

Function to calculate a relationship matrix from marker data. Option to return the inverse of matrix. Inverse calculated using Matrix package.

Usage

calcG(M, data = NULL,solve = FALSE)

Value

Matrix of class dgeMatrix.

Arguments

M

Matrix of marker genotypes, usually the count of one of the two SNP alleles at each markers (0, 1, or 2).

data

Optional logical vector which can tell of which individuals we have phenotypes.

solve

Logic, if TRUE then function returns the inverse of the relationship matrix.

See Also

SamplePedigree, gblup, makeAinv,blup

Examples

Run this code
example(gblup)
G <- calcG(M)
Ginv <- calcG(M,solve = TRUE)

Run the code above in your browser using DataLab