Learn R Programming

optiSel (version 0.9.1)

matings: Mate Allocation

Description

Males and females are allocated for mating such that all breeding animals have the desired number of offspring. The mean inbreeding coefficient in the offspring is minimized.

Usage

matings(cand, Kin, N=2*sum(cand$Sex=="female"), alpha=1, ub.nOff=NA, max=FALSE, ...)

Arguments

cand

Data frame with optimum contributions (column oc), sexes (column Sex), and IDs (column Indiv) of the selection candidates. The data frame may also contain column herd containing the names of the herds to which the females belong (NA for males).

Kin

Kinship matrix (or an other similarity matrix) for selection candidates.

N

Desired number of offspring that should be available as selection candidates in the next generation.

alpha

If alpha<1 then the proportion of females mated with the same male is at most alpha in each herd. A value alpha<1 increases genetic connectedness between herds and enables to estimate more accurate breeding values.

ub.nOff

Maximum number of offspring per mating. Without this constraint (i.e. ub.nOff=NA), some superior animals may always be mated to the same inferior animal, so their offspring would likely not be suitable for breeding.

max

The default max=FALSE means that the objective function is minimized.

...

Further optimization parameters passed to function ecos.control

Value

Data frame with columns Sire, Dam, nOff, and herd, whereby column nOff contains the desired number of offspring from each mating, and column herd contains the herd of the dam.

Details

Males and females are allocated for mating such that all breeding animals have the desired number of offspring. If Kin is a kinship matrix, then the mean inbreeding coefficient in the offspring is minimized. The maximum number of offspring per mating can be constrained. For each herd, the proportion alpha of females mated with the same male can be constrained as well, but this increases computation time.

Note that the desired number of offspring per mating is the number of offspring that should be used as selection candidates in the next generation, which is not necessarily the total number of offspring.

Examples

Run this code
# NOT RUN {
data(map)
dir   <- system.file("extdata", package = "optiSel")
files <- paste(dir, "/Chr", 1:2, ".phased", sep="")
sKin  <- segIBD(files, map, minSNP=20, minL=2.0)
Kin   <- kinlist(sKin = sKin)

data(Cattle)
Phen  <- Cattle[Cattle$Breed=="Angler", ]
head(Phen)

help.opticont(Kin, Phen)

con   <- list(ub.sKin = 0.057)
maxBV <- opticont("max.BV", K=Kin, phen=Phen, con=con, solver="cccp2", trace=FALSE)
(summary(maxBV))

#####  Minimize inbreeding   #####
Candidate <- maxBV$parent
Mating <- matings(Candidate, sKin, ub.nOff=5, maxit=50L)
Mating 
attributes(Mating)$objval


# }
# NOT RUN {
# }

Run the code above in your browser using DataLab