G.matrix {ASRgenomics}R Documentation

Obtains the genomic matrix from SNP data for additive or dominant relationships

Description

Generates the genomic numerator relationship matrix for additive (VanRaden or Yang) or dominant (Su or Vitezica) relationships. Matrix provided \boldsymbol{M} is of the form n \times p, with n individuals and p markers. Individual and marker names are assigned to rownames and colnames, respectively. SNP data is coded as 0, 1, 2 (integers or decimal numbers). Missing values, if present, need to be specified.

Usage

G.matrix(
  M = NULL,
  method = "VanRaden",
  na.string = "NA",
  sparseform = FALSE,
  digits = 8,
  message = TRUE
)

Arguments

M

A matrix with SNP data of form n \times p, with n individuals and p markers. Individual and marker names are assigned to rownames and colnames, respectively. SNP data is coded as 0, 1, 2 (integers or decimal numbers) (default = NULL).

method

The method considered for calculation of genomic matrix. Options are: "VanRaden" and "Yang" for additive matrix, and "Su" and "Vitezica" for dominant matrix (default = "VanRaden").

na.string

A character that is interpreted as missing values (default = "NA").

sparseform

If TRUE it generates a matrix in sparse form to be used directly in asreml with required attributes (default = FALSE).

digits

Set up the number of digits used to round the output matrix (default = 8).

message

If TRUE diagnostic messages are printed on screen (default = TRUE).

Details

Note: If data is provided with missing values, it will process calculations of relationships on pairwise non-missing data.

It uses function Gmatrix for calculations from R package AGHmatrix (Amadeu et al. 2019).

Value

A list with one of these two elements:

References

Amadeu, R.R., Cellon, C., Olmstead, J.W., Garcia, A.A.F, Resende, M.F.R. and P.R. Munoz. 2016. AGHmatrix: R package to construct relationship matrices for autotetraploid and diploid species: A blueberry example. The Plant Genome 9(3). doi: 10.3835/plantgenome2016.01.0009

Examples

# Example: Requesting a full matrix by VanRanden.

# Get G matrix.
G <- G.matrix(M = geno.apple, method = "VanRaden")$G
G[1:5, 1:5]


# Example: Requesting a sparse form by VanRanden.

# Get G matrix.
G <- G.matrix(M = geno.apple, method = "VanRaden", sparseform = TRUE)$G.sparse
head(G)
head(attr(G, "rowNames"))



[Package ASRgenomics version 1.1.4 Index]