gca | R Documentation |
Estimates genetic connectedness across units using pedigree or genomic data.
gca(
Kmatrix,
Xmatrix,
sigma2a,
sigma2e,
MUScenario,
statistic,
NumofMU,
Uidx = NULL,
scale = TRUE,
diag = TRUE
)
Kmatrix |
A relationship matrix with a dimension of n by n, where n refers to the total number of individuals. |
Xmatrix |
A design matrix which associates fixed effects with phenotypes and the intercept is excluded.
The first column of |
sigma2a |
Additive genetic variance. |
sigma2e |
Residual variance. |
MUScenario |
A vector of units which will be treatd as a factor. |
statistic |
A statistic measures genetic connectedness, which includes
|
NumofMU |
The number of management unit to summarize connectedness. The available options include 'Pairwise' and 'Overall', where the prior calculates the connectedness across all pairwise units, and the later averages all pairwise connectedness across units. |
Uidx |
An interger to indicate the last column of unit effects in |
scale |
Logical argument. Should |
diag |
Logical argument. Should diagonal elements of PEV matrix (e.g., PEVD_GrpAve, CD_GrpAve, and r_GrpAve) or K matrix (CDVED0, CDVED1, and CDVED2) be included? Default is TRUE. |
A value of overall connectedness measurements across units when NumofMU
is set as 'Overall'.
A matrix of connectedness measurments with diagonal as NA when NumofMU
is set as 'Pairwise'.
Haipeng Yu and Gota Morota
Maintainer: Haipeng Yu haipengyu@vt.edu
# Load cattle data
data(GCcattle)
# Compute genomic relationship matrix
G <- computeG(cattle.W, maf = 0.05, impute = 'mean', method = 'G1')
# The heritability of simulated phenotype was set to 0.6 with additive genetic variace (Vu) = 0.6 and residual variance (Ve) = 0.4
var <- list(Vu = 0.6, Ve = 0.4)
# Design matrix of fixed effects
## unit effect
X1 <- model.matrix(~ -1 + factor(cattle.pheno$Unit))
## unit effect and sex effect
X2 <- model.matrix(~ -1 + factor(cattle.pheno$Unit) + factor(cattle.pheno$Sex))
# Calculate CD_IdAve
CD_IdAve <- gca(Kmatrix = G, Xmatrix = X1, sigma2a = var$Vu, sigma2e = var$Ve,
MUScenario = as.factor(cattle.pheno$Unit), statistic = 'CD_IdAve',
NumofMU = 'Overall')
# Calculate CDVED1
CDVED1 <- gca(Kmatrix = G, Xmatrix = X1, sigma2a = var$Vu, sigma2e = var$Ve,
MUScenario = as.factor(cattle.pheno$Unit), statistic = 'CDVED1',
NumofMU = 'Pairwise', diag = TRUE)
# Calculate CDVED2
CDVED2 <- gca(Kmatrix = G, Xmatrix = X2, sigma2a = var$Vu, sigma2e = var$Ve,
MUScenario = as.factor(cattle.pheno$Unit), statistic = 'CDVED2',
NumofMU = 'Pairwise', Uidx = 8, diag = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.