matings | R Documentation |

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

contains pairwise kinships of the selection candidates.

```
matings(phen, Kin, alpha=1,
ub.n=NA, max=FALSE, solver="default", ...)
```

`phen` |
Data frame with desired number of matings (column |

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

`alpha` |
If |

`ub.n` |
Maximum number of matings of the same individuals. Without this constraint (i.e. |

`max` |
The default |

`solver` |
Either |

`...` |
Further optimization parameters. By default, they are passed to function ecos.control |

.

Males and females are allocated for mating such that all breeding animals have the desired number of matings. If `Kin`

is a kinship matrix, then the mean inbreeding coefficient in the offspring is minimized. In general, the mean similarity of the parents is minimized.

The maximum number of matings of the same individuals can be constrained. For each herd, the proportion `alpha`

of matings with the same male can be constrained as well, but this increases computation time.

Data frame with columns `Sire`

, `Dam`

, `n`

, and possibly `herd`

, whereby column `n`

contains the desired number of matings, and column `herd`

contains the herd of the dam.

The data frame has attributes `objval`

with the value of the objective function (usually the mean inbreeding coefficient), and attribute `info`

describing the solution as reported by the solver.

Robin Wellmann

```
data("map")
data("Cattle")
dir <- system.file("extdata", package = "optiSel")
files <- paste(dir, "/Chr", 1:2, ".phased", sep="")
sKin <- segIBD(files, map, minSNP=20, minL=2.0)
Phen <- Cattle[Cattle$Breed=="Angler", ]
cont <- data.frame(
age = c( 1, 2, 3, 4, 5, 6),
male = c(0.11, 0.11, 0.10, 0.08, 0.06, 0.04),
female= c(0.11, 0.11, 0.10, 0.08, 0.06, 0.04))
cand <- candes(phen=Phen, sKin = sKin, cont=cont)
con <- list(uniform="female", ub.sKin = 0.047)
Offspring <- opticont("max.BV", cand, con, trace=FALSE)
##### Minimize inbreeding #####
Candidate <- Offspring$parent
Candidate$n <- noffspring(Candidate, N=20)$nOff
Mating <- matings(Candidate, sKin)
Mating
attributes(Mating)$objval
## Not run:
## This is faster but not available on all platforms:
library("Rsymphony")
Mating <- matings(Candidate, sKin, alpha=0.30, solver=Rsymphony_solve_LP)
Mating
attributes(Mating)$objval
attributes(Mating)$info
#[1] "Optimum solution found"
## End(Not run)
```

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.