data(map)
data(Cattle)
dir <- system.file("extdata", package = "optiSel")
files <- file.path(dir, paste("Chr", unique(map$Chr), ".phased", sep=""))
Freq <- haplofreq(files, Cattle, map, thisBreed="Angler", refBreeds="others", minSNP=20)$freq
fN <- segN(Freq<0.01, map)
mean(fN)
#[1] 0.15418
if (FALSE) {
fN <- segN(Freq<0.01, map, cores=NA)
mean(fN)
#[1] 0.15418
}
## using files:
if (FALSE) {
wdir <- file.path(tempdir(),"HaplotypeEval")
chr <- unique(map$Chr)
GTfile <- file.path( dir, paste("Chr", chr, ".phased", sep=""))
files <- haplofreq(GTfile, Cattle, map, thisBreed="Angler", w.dir=wdir)
fN <- segN(files$match, map)
mean(fN)
#[1] 0.15418
fN <- segN(files$match, map, cores=NA)
mean(fN)
#[1] 0.15418
#unlink(wdir, recursive = TRUE)
}
Run the code above in your browser using DataLab