Skip to contents

Reports eligible individual mate-pair candidates via reportMatePairs (issue #151 Slice 1), wrapped in a curator-facing configuration panel for the D4-ratified population scope (populationSource: "allAlive" – ids with no recorded ped$exit date; "topRanked" – the top nTopAnimals ids in geneticValues' own report order, mirroring modBreedingGroupsServer's own topRanked reading; "custom" – a pasted, delimiter-separated id list), the D2 minimum- age floor, and the D5-ratified exclude-list textarea. Kept structurally and file-wise separate from modBreedingGroupsServer (D1) – this module shares no code with it.

Usage

modMatePairServer(
  id,
  pedigree,
  kinshipMatrix,
  markerKinshipMatrix,
  geneticValues
)

Arguments

id

character vector of length 1. Module namespace identifier.

pedigree

reactive returning the current pedigree data frame (columns id, sire, dam, sex, age, optionally exit).

kinshipMatrix

reactive returning the full pedigree-based kinship matrix (row/column names are animal IDs), typically the same shared reactive passed to modBreedingGroupsServer/ modMarkerGeneticsServer.

markerKinshipMatrix

reactive returning the genotype-only KING- robust kinship matrix from modMarkerGeneticsServer's own markerKinshipMatrix return element, or NULL before a genotype file has been uploaded.

geneticValues

reactive returning the current genetic-value report data.frame (shared$geneticValues, with id, indivMeanKin, gu columns), or NULL before the Genetic Value Analysis tab has been run.

Value

A list with three reactive elements: pairs, the eligible- pairs data.frame from the most recent reportMatePairs() run (see that function's own return documentation for columns); excluded, the corresponding excluded-pairs data.frame; and isReady, TRUE once a run has completed.

Details

The geneticValues wiring detail. shared$geneticValues (as threaded from appServer.R, matching every other module's own convention) is the flat reportGV()$report data.frame, not the list(report = ...) shape reportMatePairs itself expects. This server wraps it (list(report = geneticValues())) immediately before calling reportMatePairs() – omitting the wrap would not error (a data.frame's $report accessor returns NULL, not a condition), it would silently leave every genetic- value column NA.

Population scoping is a hard dependency, not a fallback-recompute. Unlike modBreedingGroupsServer's optional kinshipMatrix (which recomputes from pedigree when absent), this module always receives the already-computed shared kinship reactive from appServer.R and simply depends on it (module-contract rule 5: upstream absence is req()), matching modMarkerGeneticsServer's own simpler precedent – there is no standalone use case for this module that would need an independent recompute path.