Server logic for breeding group formation using the groupAddAssign algorithm. This module integrates with the kinship-based maximal independent set (MIS) algorithm to form optimal breeding groups that minimize relatedness within groups while maximizing group sizes.
modBreedingGroupsServer(
id,
pedigree,
geneticValues = NULL,
kinshipMatrix = NULL,
kinshipOverrides = NULL
)List with reactive components:
groups - List of character vectors with animal IDs per group
nGroups - Number of groups formed
score - Optimization score from groupAddAssign
(minimum group size)
unassigned - Character vector of candidate IDs not placed
in groups
groupKinship - List of kinship matrices per group
(if withKin=TRUE)
character vector of length 1. Module namespace identifier.
reactive returning pedigree data frame with columns: id, sire, dam, sex, and optionally birth, exit, gen.
optional reactive returning genetic value results
from modGeneticValueServer, used to source the
topRanked animal-source candidate list. Unrelated to kinship.
optional reactive returning a kinship matrix,
typically a full-pedigree matrix shared with
modSummaryStatsServer (e.g. from appServer) rather
than independently recomputed. If NULL, the module calculates kinship
from the pedigree.
optional reactive returning a validated
outside-information kinship-override data frame (id1, id2,
kinship); see applyKinshipOverrides.
When the module recomputes kinship from the pedigree (the shared
kinshipMatrix is unavailable), the overrides are applied to that
matrix so group formation reflects them regardless of tab order.
NULL (the default) is a no-op. A provided kinshipMatrix is
expected to already carry overrides applied at its source.
The module supports multiple configuration options:
Animal source: Select top-ranked animals or all available
Kinship threshold: Maximum allowed kinship within groups
Harem mode: Form groups with exactly one male each
Sex ratio: Target female-to-male ratio in groups
modBreedingGroupsUI for the UI component
groupAddAssign for the underlying MIS algorithm
modGeneticValueServer for genetic value analysis
kinship for kinship matrix calculation
Other Shiny modules:
modBreedingGroupsUI(),
modGeneticDiversityServer(),
modGeneticDiversityUI(),
modGeneticValueServer(),
modGeneticValueUI(),
modGvAndBgDescServer(),
modGvAndBgDescUI(),
modInputServer(),
modInputUI(),
modORIPReportingServer(),
modORIPReportingUI(),
modPedigreeServer(),
modPedigreeUI(),
modPotentialParentsServer(),
modPotentialParentsUI(),
modPyramidServer(),
modPyramidUI(),
modSummaryStatsServer(),
modSummaryStatsUI()