segBreedComp | R Documentation |
Calculates the segment based Breed Composition: For every individual the breed composition is estimated, including the genetic contribution from native ancestors.
segBreedComp(Native, map, unitP="Mb")
Native |
This parameter is either (1) Mx(2N) logical matrix, with or (2) Mx(2N) character matrix, with components being the first characters of the names of the breeds in which the respective segment has maximum frequency. Segments considered native are coded as or (3) Vector with file names. The files contain for every SNP and for each haplotype 1 if the segment containing the SNP is considered native. Otherwise it is the first letter of the name of the breed in which the segment has maximum frequency. These files are typically created by function haplofreq.
There is one file per chromosome and file names must contain the chromosome name as specified in the |
map |
Data frame providing the marker map with columns including marker name |
unitP |
The unit for measuring the proportion of the genome included in native segments.
Possible units are the number of marker SNPs included in shared segments ( |
For every individual the breed composition is computed, including the genetic contribution from native ancestors (native contribution). The native contribution is the proportion of the genome belonging to segments whose frequency is smaller than a predefined value in all other breeds.
Additionally, for each introgressed breed, the proportion of the genome of each individual is computed that is non-native and has maximum frequency in the respective breed (not if option (1) is used).
Data frame with the number of rows being the number of individuals. The columns are
Indiv |
IDs of the individuals, |
native |
Genetic contributions from native ancestors, |
... |
Contributions from other breeds. |
Robin Wellmann
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:
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.