match.G2A {ASRgenomics} | R Documentation |
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.
match.G2A(
A = NULL,
G = NULL,
clean = TRUE,
ord = TRUE,
mism = FALSE,
RMdiff = FALSE,
message = TRUE
)
A |
Input of the pedigree relationship matrix |
G |
Input of the genomic relationship matrix |
clean |
If |
ord |
If |
mism |
If |
RMdiff |
If |
message |
If |
A list with the following elements:
Gclean
: a matrix with the portion of \boldsymbol{G}
containing only matched individuals.
Aclean
: a matrix with the portion of \boldsymbol{A}
containing only matched individuals.
mismG
: a vector containing the names of the individuals from matrix \boldsymbol{G}
that are
missing in matrix \boldsymbol{A}
.
mismA
: a vector containing the names of the individuals from matrix \boldsymbol{A}
that are
missing in matrix \boldsymbol{G}
.
RM
: a data frame with the observations from both the \boldsymbol{G}
and \boldsymbol{A}
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.
# 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)