kinship.diagnostics {ASRgenomics}  R Documentation 
It reports summary statistics, plots and allows for some filter options
for diagonal and offdiagonal elements for a given kinship matrix.
The input matrix can be a pedigreebased
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
.
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
)
K 
Input of a kinship matrix in full format ( 
diagonal.thr.large 
A threshold value to flag large diagonal values (default = 
diagonal.thr.small 
A threshold value to flag small diagonal values (default = 
duplicate.thr 
A threshold value to flag possible duplicates. Any calculation larger than the
threshold based on

clean.diagonal 
If 
clean.duplicate 
If 
plots 
If 
sample.plot 
A numeric value between 0 and 1 indicating the proportion
of the data points to be sampled for fast plotting of offdiagonal values.
Note that for proportions other than 1, the method is not exact and low
proportions are only recommended for large kinship matrices (default = 
message 
If 
A list with the following elements:
list.diagonal
: a data frame with the list of flagged large or small diagonal values.
list.duplicate
: a data frame with the list of possible duplicates.
clean.kinship
: output of kinship matrix filtered without the flagged diagonal
and/or duplicate individuals.
plot.diagonal
: histogram with the distribution of diagonal values from the kinship matrix.
plot.offdiag
: histogram with the distribution of offdiagonal values from kinship matrix.
# 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