data(map)
data(Cattle)
dir <- system.file("extdata", package="optiSel")
files <- file.path(dir, paste("Chr", 1:2, ".phased", sep=""))
Freq <- freqlist(
haplofreq(files, Cattle, map, thisBreed="Angler", refBreeds="Rotbunt", minL=2.0),
haplofreq(files, Cattle, map, thisBreed="Angler", refBreeds="Holstein", minL=2.0),
haplofreq(files, Cattle, map, thisBreed="Angler", refBreeds="Fleckvieh", minL=2.0)
)
plot(Freq, ID=1, hap=2, refBreed="Rotbunt")
plot(Freq, ID=1, hap=2, refBreed="Holstein", Chr=1)
# \donttest{
## Test for using multiple cores:
Freq1 <- haplofreq(files, Cattle, map, thisBreed="Angler", refBreeds="Rotbunt",
minL=2.0, cores=NA)$freq
range(Freq[[1]]-Freq1)
#[1] 0 0
# }
## Creating output files with allele frequencies and allele origins:
# \donttest{
rdir <- system.file("extdata", package = "optiSel")
wdir <- file.path(tempdir(), "HaplotypeEval")
chr <- unique(map$Chr)
files <- file.path(rdir, paste("Chr", chr, ".phased", sep=""))
wfile <- haplofreq(files, Cattle, map, thisBreed="Angler", minL=2.0, w.dir=wdir)
View(read.table(wfile$match[1],skip=1))
#unlink(wdir, recursive = TRUE)
# }
Run the code above in your browser using DataLab