polyclonal: Integer programming calculations

View source: R/Main.R

polyclonalR Documentation

Integer programming calculations

Description

This function maximizes the predicted genetic gain in the selection of groups of genotypes based on the predictors of genotypic effects.

Usage

polyclonal(
  traits,
  ref = NULL,
  clmin = 2,
  clmax,
  dmg = NULL,
  meanvec = NULL,
  criteria = NULL,
  data
)

Arguments

traits

A vector with the names of the columns in the data corresponding to the target traits to be optimized, i.e., those included in the objective function.

ref

Name of the reference column (e.g., genotype ID). Defaults to the first column.

clmin

An integer specifying the minimum group size. If omitted, equal to 2.

clmax

An integer specifying the maximum group size. If omitted, equal to clmin.

dmg

A data.frame with three columns defining constraints: trait names; constraints signs (">=", "<=" or "=="); and right-hand side values of the constraints.

meanvec

A named numeric vector of trait means; if omitted, data are assumed to be already normalized by the mean.

criteria

A named numeric vector indicating the selection criterion for each trait: 1 for traits to be increased, -1 for traits to be decreased. If omitted, all traits are assumed to be selected for increase.

data

A data frame comprising the input data consisting of the Predictors of genetic effects, which serve as the basis for the selection procedure.

Value

A list with the following components:

  • gain with the gains of the several traits in each dimension

  • selected with the reference os the clones selected in the group of each dimension

Note

The order of traits must be consistent across traits, dmg, meanvec, and criteria. Both meanvec and criteria must include values for all traits specified in traits and dmg.

References

Surgy, S., Cadima, J. & Gonçalves, E. Integer programming as a powerful tool for polyclonal selection in ancient grapevine varieties. Theor Appl Genet 138, 122 (2025). \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1007/s00122-025-04885-0")}

Examples

mymeanvec <- c(yd = 3.517, pa = 12.760, ta = 4.495, ph = 3.927, bw = 1.653)
mytraits <- c("yd", "pa",  "ta", "ph", "bw")
mydmg <- data.frame(
  lhs = c("yd", "pa", "ta", "ph", "bw"),
  rel = c(">=", ">=", ">=", ">=", ">="),
  rhs = c(20, 3, 3, 1, 2)
  )
mycriteria <- c(yd = 1, pa = 1, ta = 1, ph = -1, bw = -1)
selections <- polyclonal(
   traits = mytraits,
   clmin = 7,
   clmax = 20,
   dmg = mydmg,
   meanvec = mymeanvec,
   criteria = mycriteria,
   data = Gouveio
   )
selections
summary(selections)

maxRgain documentation built on Aug. 18, 2025, 5:28 p.m.