match.kinship2pheno {ASRgenomics} | R Documentation |
Check any kinship matrix K against phenotypic data
Description
Assesses a given kinship matrix against the provided phenotypic data to determine
if all genotypes are in the kinship matrix or not. It also reports which individuals
match or are missing from one set or another.
If requested, a reduced kinship matrix is generated that has only the matched individuals.
The input kinship matrix can be a pedigree-based relationship matrix \boldsymbol{A}
,
a genomic-based relationship matrix \boldsymbol{G}
, or a hybrid
relationship matrix \boldsymbol{H}
.
Individual names should be assigned to rownames
and colnames
of input matrix.
Usage
match.kinship2pheno(
K = NULL,
pheno.data = NULL,
indiv = NULL,
clean = FALSE,
ord = TRUE,
mism = FALSE,
message = TRUE
)
Arguments
K |
Input of a kinship matrix in full form ( |
pheno.data |
A data fame with the phenotypic data to assess (for |
indiv |
The string for the column name for genotypes/individuals in the phenotypic data (default = |
clean |
If |
ord |
If |
mism |
If |
message |
If |
Value
A list with the following elements:
mismatchesK
: a vector containing the names of the individuals from the provided kinship matrix that mismatch with the phenotypic data.matchesK
: a vector containing the names of the individuals from the provided kinship matrix that match with the phenotypic data.mismatchesP
: a vector containing the names of phenotyped individuals that mismatch with those from the kinship matrix.matchesP
: a vector containing the names of phenotyped individuals that match with those from the kinship matrix.Kclean
: a clean kinship matrix containing only the matched phenotyped individuals.
Examples
## Not run:
# Get G matrix.
G <- G.matrix(M = geno.pine655, method = "VanRaden", na.string = "-9", sparseform = FALSE)$G
dim(G)
# Match G and the phenotype.
check <-
match.kinship2pheno(
K = G, pheno.data = pheno.pine,
indiv = "Genotype",
clean = TRUE, mism = TRUE)
ls(check)
length(check$matchesK)
length(check$mismatchesK)
length(check$matchesP)
length(check$mismatchesP)
dim(check$Kclean)
## End(Not run)