data(map)
data(Cattle)
dir <- system.file("extdata", package = "optiSel")
GTfiles <- file.path(dir, paste("Chr", unique(map$Chr), ".phased", sep=""))
Haplo <- haplofreq(GTfiles, Cattle, map, thisBreed="Angler", minSNP=20, minL=1.0)
Comp <- segBreedComp(Haplo$freq<0.01, map)
mean(Comp$native)
#[1] 0.3853432
Comp <- segBreedComp(Haplo$match, map)
apply(Comp[, -1], 2, mean)
## Reading native segments from files:
if (FALSE) {
wdir <- file.path(tempdir(), "HaplotypeEval")
file <- haplofreq(GTfiles, Cattle, map, thisBreed="Angler", minSNP=20,
minL=1.0, ubFreq=0.01, what="match", w.dir=wdir)
Comp <- segBreedComp(file$match, map)
head(Comp)
apply(Comp[, -1], 2, mean)
# native F H R
#0.38534317 0.05503451 0.25986508 0.29975724
#unlink(wdir, recursive = TRUE)
}
Run the code above in your browser using DataLab