Description Usage Arguments Details Author(s) Examples
Obtaing pairwise genetic covariances for variables with the same experimental design and equal variance
1 2 |
y1 |
Response variable 1 |
y2 |
Response variable 2. Must be a matrix with the number of rows equal to length of vector y2 |
X |
Design matrix for the fixed effects. When |
Z |
Design matrix for the random effects. When |
K |
Kinship relationships matrix |
U |
Matrix with eigenvectors from spectral value decomposition of G = U D U' |
d |
Vector with eigenvalues from spectral value decomposition of G = U D U' |
scale |
|
mc.cores |
Number of cores used. The analysis is run in parallel when |
... |
Other arguments passed to |
Assumes that both y1 and y2 follow the basic linear mixed model that relates phenotypes with genetic values of the form
where b1 and b2 are the specific fixed effects, g1 and g2 are the specific genetic values of the genotypes, e1 and e2 are the vectors of specific environmental residuals, and X and Z are common design matrices conecting the fixed and genetic effects with replicates. Genetic values are assumed to follow a Normal distribution as g1 ~ N(0,σ2u1K) and g2 ~ N(0,σ2u2K), and environmental terms are assumed e1 ~ N(0,σ2e1I) and e2 ~ N(0,σ2e2I).
The genetic covariance σ2u1,u2 is estimated from the formula for the variance for the sum of two variables as
where σ2u3 is the genetic variance of the variable y3 = y1 + y2 that also follows the same model as for y1 and y2
Marco Lopez-Cruz (lopezcru@msu.edu) and Gustavo de los Campos
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | require(SFSI)
require(ggplot2)
data(wheatHTP)
X = scale(X[1:200,]) # Subset and scale markers
G = tcrossprod(X)/ncol(X) # Genomic relationship matrix
y = scale(Y[1:200,"YLD"]) # Subset response variable
WL = scale(WL[1:200,20:40]) # Subset reflectance data
fm <- getGenCov(y,WL,K=G)
dat = data.frame(covU=fm$covU,covP_corrected=fm$covU+fm$covE,
covP_uncorrected=cov(y,WL)[1,])
covariance=rep(c("covU","covP_corrected","covP_uncorrected"),each=length(fm$covU))
dat = data.frame(covariance,x=rep(1:length(fm$covU),3),
y=c(fm$covU,fm$covU+fm$covE,cov(y,WL)[1,]))
ggplot(dat,aes(x,y,group=covariance,color=covariance))+geom_point()+geom_line()
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.