
Potential Parents Module - Server Function
Source:R/modPotentialParents.R
modPotentialParentsServer.RdServer logic for the Potential Parents module. On button press, it calls
getPotentialParents against the current pedigree, flattens the
result into a sortable table, and exposes it for CSV download. The surface
degrades gracefully when no pedigree is loaded, when the pedigree lacks the
fromCenter colony-origin field, or when no in-colony animal has an
unknown parent.
Usage
modPotentialParentsServer(
id,
pedigree = NULL,
minSireAge = NULL,
minDamAge = NULL,
gestationTable = NULL,
gestationDefault = NULL
)Arguments
- id
character vector of length 1. Module namespace identifier.
- pedigree
reactive returning the current pedigree data.frame.
- minSireAge
minimum age in years for a male to be proposed as a sire. May be a plain numeric,
NULL, or a reactive returning either.NULL(the default) uses the species- and sex-specific breeding-age table default viagetPotentialParents.- minDamAge
minimum age in years for a female to be proposed as a dam. Same forms and default as
minSireAge, applied to females.- gestationTable
optional species-to-gestation lookup passed to
getSpeciesGestationwhen defaulting the gestation window;NULL(the default) uses the bundledspeciesGestationtable. Supplied at boot from the user-configurable species overrides, so a colony's CSV values drive the prefill default.- gestationDefault
optional integer fallback (days) for a pedigree whose species is absent from
gestationTable, passed through to the gestation prefill;NULL(the default) keeps the built-in 210. Supplied at boot from the user-configurable species overrides.
Value
A list of reactive expressions:
potentialParents- the rawgetPotentialParentsresult (orNULL).tableData- the flattened results data.frame.gestationDefault- the species-keyed default gestation window (days) used to prefill the maximum-gestational-period input.
See also
modPotentialParentsUI for the user interface.
getPotentialParents for the underlying computation.
Other Shiny modules:
modBreedingGroupsServer(),
modBreedingGroupsUI(),
modGeneticDiversityServer(),
modGeneticDiversityUI(),
modGeneticValueServer(),
modGeneticValueUI(),
modGvAndBgDescServer(),
modGvAndBgDescUI(),
modInputServer(),
modInputUI(),
modORIPReportingServer(),
modORIPReportingUI(),
modPedigreeServer(),
modPedigreeUI(),
modPotentialParentsUI(),
modPyramidServer(),
modPyramidUI(),
modSummaryStatsServer(),
modSummaryStatsUI()