match.G2A {ASRgenomics}R Documentation

Check the genomic relationship matrix G against the pedigree relationship matrix A or vice versa

Description

Assesses a given genomic relationship matrix \boldsymbol{G} against the pedigree relationship matrix \boldsymbol{A}, or vice versa, to determine the matched and mismatched individuals. If requested, it provides the cleaned versions containing only the matched individuals between both matrices. The user should provide the matrices \boldsymbol{G}and \boldsymbol{A} in full form (ng \times ng and na \times na, respectively). Individual names should be assigned to rownames and colnames for both matrices.

Usage

match.G2A(
  A = NULL,
  G = NULL,
  clean = TRUE,
  ord = TRUE,
  mism = FALSE,
  RMdiff = FALSE,
  message = TRUE
)

Arguments

A

Input of the pedigree relationship matrix \boldsymbol{A} in full form (na \times na) (default = NULL).

G

Input of the genomic relationship matrix \boldsymbol{G} in full form (ng \times ng) (default = NULL).

clean

If TRUE generates new clean \boldsymbol{G} and \boldsymbol{A} matrices in full form containing only matched individuals (default = TRUE).

ord

If TRUE it will order by ascending order of individual names both of the clean \boldsymbol{A} and \boldsymbol{G} matrices (default = TRUE).

mism

If TRUE generates two data frames with mismatched individual names from the \boldsymbol{G} and \boldsymbol{A} matrices (default = FALSE).

RMdiff

If TRUE it generates the matrix (in lower diagonal row-wise sparse form) of matched observations from both the \boldsymbol{G} and \boldsymbol{A} matrices. This matrix can be used to identify inconsistent values between matched matrices, but it can be very large (default = FALSE).

message

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

Value

A list with the following elements:

Examples


# Get A matrix.
A <- AGHmatrix::Amatrix(data = ped.pine)
A[1:5,1:5]
dim(A)

# Read and filter genotypic data.
M.clean <- qc.filtering(
 M = geno.pine655,
 maf = 0.05,
 marker.callrate = 0.2, ind.callrate = 0.20,
 na.string = "-9",
 plots = FALSE)$M.clean

# Get G matrix.
G <- G.matrix(M = M.clean, method = "VanRaden", na.string = "-9")$G
G[1:5, 1:5]
dim(G)

# Match G2A.
check <- match.G2A(
 A = A, G = G,
 clean = TRUE, ord = TRUE, mism = TRUE, RMdiff = TRUE)
ls(check)
dim(check$Aclean)
dim(check$Gclean)
check$Aclean[1:5, 1:5]
check$Gclean[1:5, 1:5]
head(check$mismG)
head(check$mismA)
check$plotG2A
head(check$RM)



[Package ASRgenomics version 1.1.4 Index]