Assembles the live breeding-group, genetic-value, and kinship reactive
inputs into the per-group heat-map statistics (via
getGeneticDiversityStats) and renders the red/yellow/green
heat map (via makeGeneticDiversityHeatmap). When breeding
groups have not been formed or the genetic value analysis has not been run,
the module shows guidance instead of an empty plot. When a formed group
holds an animal the loaded pedigree no longer has (a new file was read, or
the view was trimmed, after the groups were formed), the page says so in one
sentence and asks for the groups to be formed again; any other calculation
error is shown once, where the heat map would be. When any animal in the
groups has no birth date, a note under the heat map says how many, and how
many females among them the Production and Inbreeding columns counted (those
the pedigree lists as a dam) and left out.
modGeneticDiversityServer(
id,
groups,
pedigree,
geneticValues,
kinshipMatrix = NULL,
currentDate = Sys.Date(),
kinshipFor = NULL
)A list with two reactive elements: stats, the per-group
metric data frame (or NULL when data are not ready), and
heatmap, the ggplot heat map (or NULL). Errors
raised inside getGeneticDiversityStats (a group member missing
from the kinship matrix) are not caught, so the reactives error instead
of returning NULL.
character vector of length 1. Module namespace identifier.
reactive returning a list of character vectors of animal IDs,
one per breeding group (the groups returned by
modBreedingGroupsServer). That list includes the trailing
"Unused" element when candidates remain unplaced, and the heat map scores
it as another group. If the list is named, the names are the heat map's
row labels (the app passes the names that the Breeding Groups module
returns as groupLabels, so the last row reads "Unused animals"); an
unnamed list gives "Group 1", "Group 2" and so on.
reactive returning the quality-controlled pedigree data frame.
reactive returning the genetic value report data frame
(with id and value columns).
optional reactive returning a square kinship matrix
(row and column names are animal IDs) covering every member of every
group; getGeneticDiversityStats stops when a group member
is missing from it. It is used before kinshipFor.
Date used to derive age and the production birth window.
Defaults to Sys.Date().
optional function of a character vector of animal IDs
that returns those animals' kinship matrix. Once groups, the pedigree and
the genetic value report are all available, the module asks it for the
groups' members. In the app it computes the members' kinship from them
and their ancestors only, so a group may hold any animal of the
pedigree, not only the Genetic Value population. With neither
kinshipMatrix nor kinshipFor the module shows no heat map.
modGeneticDiversityUI
Other Shiny modules:
modBreedingGroupsServer(),
modBreedingGroupsUI(),
modCrossCenterIdentityServer(),
modCrossCenterIdentityUI(),
modDeidentifiedExportServer(),
modDeidentifiedExportUI(),
modGeneticDiversityUI(),
modGeneticValueServer(),
modGeneticValueUI(),
modGvAndBgDescServer(),
modGvAndBgDescUI(),
modInputServer(),
modInputUI(),
modMarkerGeneticsServer(),
modMarkerGeneticsUI(),
modMatePairServer(),
modMatePairUI(),
modORIPReportingServer(),
modORIPReportingUI(),
modPedigreeServer(),
modPedigreeUI(),
modPotentialParentsServer(),
modPotentialParentsUI(),
modPyramidServer(),
modPyramidUI(),
modSnapshotTrendsServer(),
modSnapshotTrendsUI(),
modSummaryStatsServer(),
modSummaryStatsUI()