Learn R Programming

QTLRel (version 0.2-9)

qtlVar: QTL Variance

Description

Estimate variance in a quantitative trait induced by QTL.

Usage

qtlVar(lrt,prdat,simulation=FALSE,nsim=25)

Arguments

lrt
a data frame (a, d, ...), where 'a' and 'd' are respectively additive and dominance effects.
prdat
a 3-D array that provides probabilities of genotypes "AA", "AB" and "BB". If prDat is an object of genoProb, then prdat can be prDat$pr.
simulation
whether to use simulations to estimate the variance explained by QTL.
nsim
number of simulations to perform if simulation is TRUE.

Value

  • A vector displaying the estimated variance at each loci.

See Also

scanOne and genoProb

Examples

Run this code
data(miscEx)

# impute missing genotypes
gdtmp<- (gdat=="AA") + (gdat=="AB")*2 + (gdat=="BB")*3
   gdtmp<- replace(gdtmp,is.na(gdtmp),0)
# rung 'genoProb'
prDat<- genoProb(gdat=gdtmp, gmap=genMap, step=Inf,
   gr=2, method="Haldane", verbose=TRUE)
y<- rnorm(20)
x<- matrix(1,nrow=20,ncol=1)
v<- cov(matrix(rnorm(500*20),ncol=20))
# estimate variance components
o<- estVC(y, x, v = list(AA=v,DD=NULL,HH=NULL,AD=NULL,
   MH=NULL,EE=diag(20)))

# genome scan
gcv<- v*o$par["AA"]
llk.hk<- scanOne(y=y, x=x, vc=gcv, prdat=prDat)

# run 'qtlVar'
qef<- NULL
for(n in 1:length(llk.hk$par))
   qef<- rbind(qef,llk.hk$par[[n]][c("a","d")])
   qef<- as.data.frame(qef)
qtlVar(qef,prDat$pr)[1:3]

Run the code above in your browser using DataLab