
Genetic-Health Trends Module - Server Function
Source:R/modSnapshotTrends.R
modSnapshotTrendsServer.RdGenetic-Health Trends Module - Server Function
Arguments
- id
character vector of length 1. Module namespace identifier.
- snapshotSource
reactive returning
list(ped, geneticValue, guIter, guThresh)from the most recent Genetic Value Analysis run (seemodGeneticValueServer'ssnapshotSourcereturn element), or erroring (shinyreq()semantics) before any run has happened.- fullPedigree
reactive returning the full quality-controlled pedigree (the Pedigree tab's
processedPedigree, never the focal-trimmedanalysisPedigree, which would shrink every past population), or erroring (shinyreq()semantics) before a studbook is loaded. Feeds the "Build Earlier Snapshots" box. Defaults toreactive(NULL): no pedigree, so the box waits.
Value
A list with reactive components:
history- the current validated snapshot history (orNULLbefore any upload or generation).deltas- the current delta comparison (seecalcSnapshotDeltas), keyed off the sidebar's rule/from/ to selectors.isReady- logical:TRUEoncehistoryis non-NULL(a history has been uploaded or generated).backfillSupport- the table of what each date of the default earlier-snapshot series rests on (previewBackfillSupportoffullPedigree()), independent of the chosen start year; erroring (req()) until a pedigree is loaded.
The "Build Earlier Snapshots" button calls
backfillColonySnapshots with the full pedigree, the
guIter, guThresh and reportArgs of
snapshotSource(), the chosen start year and the history already
held, and adds nothing of its own to the numbers. It does nothing before an
analysis has run. Warnings from the build are summarized in one
notification; a failure is reported and leaves the history as it was.
The generated snapshot's membershipRule is auto-derived from
snapshotSource()$ped$population (issue #167 Slice 4, S760 owner
decision): "focalPopulation" when the analyzed pedigree's
population column excludes any animal, "wholePedigree" otherwise
– truthful by construction from what reportGV() actually
analyzed, never a user-set dropdown that could contradict the data and
hit createColonySnapshot's stop(). The delta
comparison keeps a user-facing rule selector, populated from the
uploaded/generated history's own membershipRule values.
A checkSnapshotHistory violation on a malformed history
upload surfaces as a notification (module-contract rule 5: this is not
the same seam as inter-module malleability – the specific violation is
shown, not disguised as "no data yet") and leaves the current history
unchanged.
See also
modSnapshotTrendsUI for the user interface.
Other Shiny modules:
modBreedingGroupsServer(),
modBreedingGroupsUI(),
modCrossCenterIdentityServer(),
modCrossCenterIdentityUI(),
modDeidentifiedExportServer(),
modDeidentifiedExportUI(),
modGeneticDiversityServer(),
modGeneticDiversityUI(),
modGeneticValueServer(),
modGeneticValueUI(),
modGvAndBgDescServer(),
modGvAndBgDescUI(),
modInputServer(),
modInputUI(),
modMarkerGeneticsServer(),
modMarkerGeneticsUI(),
modMatePairServer(),
modMatePairUI(),
modORIPReportingServer(),
modORIPReportingUI(),
modPedigreeServer(),
modPedigreeUI(),
modPotentialParentsServer(),
modPotentialParentsUI(),
modPyramidServer(),
modPyramidUI(),
modSnapshotTrendsUI(),
modSummaryStatsServer(),
modSummaryStatsUI()