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 against the
pedigree relationship matrix
, 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
and
in full form (
and
, 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 |
G |
Input of the genomic relationship matrix |
clean |
If |
ord |
If |
mism |
If |
RMdiff |
If |
message |
If |
Value
A list with the following elements:
Gclean
: a matrix with the portion ofcontaining only matched individuals.
Aclean
: a matrix with the portion ofcontaining only matched individuals.
mismG
: a vector containing the names of the individuals from matrixthat are missing in matrix
.
mismA
: a vector containing the names of the individuals from matrixthat are missing in matrix
.
RM
: a data frame with the observations from both theand
matched matrices, together with their absolute relationship difference.
plotG2A
: scatterplot with the pairing of matched pedigree- against genomic-based relationship values. This graph might take a long to plot with large datasets.
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)