kinship.diagnostics {ASRgenomics}R Documentation

Reports summary statistics, plots and filter options for a given kinship matrix K

Description

It reports summary statistics, plots and allows for some filter options for diagonal and off-diagonal elements for a given kinship matrix. The input matrix can be a pedigree-based relationship matrix \boldsymbol{A}, a genomic relationship matrix \boldsymbol{G} or a hybrid relationship matrix \boldsymbol{H}. Individual names should be assigned to rownames and colnames.

Usage

kinship.diagnostics(
  K = NULL,
  diagonal.thr.large = 1.2,
  diagonal.thr.small = 0.8,
  duplicate.thr = 0.95,
  clean.diagonal = FALSE,
  clean.duplicate = FALSE,
  plots = TRUE,
  sample.plot = 1,
  message = TRUE
)

Arguments

K

Input of a kinship matrix in full format (n \times n) (default = NULL).

diagonal.thr.large

A threshold value to flag large diagonal values (default = 1.2).

diagonal.thr.small

A threshold value to flag small diagonal values (default = 0.8).

duplicate.thr

A threshold value to flag possible duplicates. Any calculation larger than the threshold based on \boldsymbol{k}_{i,i}\mathbin{/}\sqrt{\boldsymbol{k}_{i,i} \times \boldsymbol{k}_{j,j}} is identified as a duplicate (default = 0.95).

clean.diagonal

If TRUE returns a kinship matrix filtered by values smaller than diagonal.thr.large and larger than diagonal.thr.small (default = FALSE).

clean.duplicate

If TRUE return a kinship matrix without the flagged duplicate individuals. All individuals involved are removed (default = FALSE).

plots

If TRUE generates graphical output of the diagonal and off-diagonal values of the kinship matrix (default = TRUE).

sample.plot

A numeric value between 0 and 1 indicating the proportion of the data points to be sampled for fast plotting of off-diagonal values. Note that for proportions other than 1, the method is not exact and low proportions are only recommended for large kinship matrices (default = 1).

message

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

Value

A list with the following elements:

Examples

# Get G matrix.
G <- G.matrix(M = geno.apple, method = "VanRaden")$G

# Diagnose G.
G_summary <- kinship.diagnostics(
 K = G,
 diagonal.thr.large = 1.3, diagonal.thr.small = 0.7, clean.diagonal = TRUE,
 duplicate.thr = 0.8, clean.duplicate = TRUE,
 sample.plot = 0.50)
ls(G_summary)
dim(G_summary$clean.kinship)
G_summary$clean.kinship[1:5, 1:5]
G_summary$list.duplicate
G_summary$list.diagonal
G_summary$plot.diag
G_summary$plot.offdiag


[Package ASRgenomics version 1.1.4 Index]