data(miscEx)
if (FALSE) {
# impute missing genotypes
pheno<- pdatF8[!is.na(pdatF8$bwt) & !is.na(pdatF8$sex),]
ii<- match(rownames(pheno), rownames(gdatF8))
geno<- gdatF8[ii,]
ii<- match(rownames(pheno), rownames(gmF8$AA))
v<- list(A=gmF8$AA[ii,ii], D=gmF8$DD[ii,ii])
gdatTmp<- genoImpute(geno, gmap=gmapF8,
gr=8, na.str=NA)
# estimate variance components
o<- estVC(y=pheno$bwt, x=pheno$sex, v=v)
# scan marker loci & permutation
ex1<- nullSim(y=pheno$bwt, x=pheno$sex, gdat=gdatTmp,
method="permutation", vc=o, ntimes=10)
# Haley-Knott method & permutation
gdtmp<- geno
gdtmp<- replace(gdtmp,is.na(gdtmp),0)
prDat<- genoProb(gdat=gdtmp, gmap=gmapF8,
gr=8, method="Haldane", msg=TRUE)
ex2<- nullSim(y=pheno$bwt, x=pheno$sex, prdat=prDat,
method="permutation", vc=o, ntimes=10)
# remove samples whose father is troublesome "32089"
# before running gene dropping
# otherwise, "hap" data needs to be supplied
# scan marker loci & gene dropping
idx<- is.element(rownames(pdatF8), pedF8$id[pedF8$sire=="32089"])
pheno<- pdatF8[!is.na(pdatF8$bwt) & !is.na(pdatF8$sex) & !idx,]
ii<- match(rownames(pheno), rownames(gdatF8))
geno<- gdatF8[ii,]
ii<- match(rownames(pheno), rownames(gmF8$AA))
v<- list(A=gmF8$AA[ii,ii], D=gmF8$DD[ii,ii])
gdatTmp<- genoImpute(geno, gmap=gmapF8,
gr=8, na.str=NA)
o<- estVC(y=pheno$bwt, x=pheno$sex, v=v)
ex3<- nullSim(y=pheno$bwt, x=pheno$sex, gdat=gdatTmp, ped=pedF8,
gmap=gmapF8, method="gene", vc=o, ntimes=10)
# Haley-Knott method & gene dropping
gdtmp<- geno
gdtmp<- replace(gdtmp,is.na(gdtmp),0)
prDat<- genoProb(gdat=gdtmp, gmap=gmapF8,
gr=8, method="Haldane", msg=TRUE)
ex4<- nullSim(y=pheno$bwt, x=pheno$sex, prdat=prDat, ped=pedF8,
gmap=gmapF8, method="gene", vc=o, gr=8, ntimes=10)
}
Run the code above in your browser using DataLab