Server logic for summary statistics module displaying genetic analysis results including kinship statistics, histograms, box plots, and relationship designation analysis.
Usage
modSummaryStatsServer(
id,
geneticValues,
pedigree,
kinshipMatrix = NULL,
founderStats = NULL,
kinshipOverrides = NULL
)Arguments
- id
character vector of length 1. Module namespace identifier.
- geneticValues
reactive returning genetic value analysis results. Must be a data frame with columns
id,indivMeanKin, andgu. OptionalzScorecolumn enables z-score plots.- pedigree
reactive returning pedigree data frame with columns
id,sire,dam, andsex. Optionallygen.- kinshipMatrix
optional reactive returning kinship matrix. If NULL, the module will calculate kinship from the pedigree.
- founderStats
optional reactive returning a list of founder statistics (
fe,fg,total,nMaleFounders,nFemaleFounders). When supplied, a founder summary table is rendered on the Summary Statistics tab (monolith parity). If NULL, it is omitted.- kinshipOverrides
optional reactive returning a validated outside-information kinship-override data frame (
id1,id2,kinship); seeapplyKinshipOverrides. When the module recomputes kinship from the pedigree (the usual path), the overrides are applied to that matrix, so the relationship table and the kinship CSV export reflect the supplied values regardless of tab order. The override moves the kinship value only; therelationlabel stays pedigree-derived (it is computed from pedigree structure, not from the kinship value). Overridden pairs are flagged with a logicaloverriddencolumn in the relationship table.NULL(the default) is a no-op.
Value
A list with reactive components:
summaryData- Summary statistics (nAnimals, meanMK, meanGU)relationships- Pairwise relationship designations fromconvertRelationships(). WhenkinshipOverridesare supplied, a logicaloverriddencolumn flags the pairs whose kinship value came from an override.relationClasses- Relationship class frequency table frommakeRelationClassesTable()firstOrderCounts- First-order relative counts per animal fromcountFirstOrder()mkSummary- Six-number summary of mean kinshipguSummary- Six-number summary of genome uniqueness
Details
This module provides:
Summary statistics (counts, mean kinship, genome uniqueness)
Histograms and box plots for genetic value distributions
Relationship classification using
convertRelationships()Relationship class frequency tables using
makeRelationClassesTable()First-order relative counts using
countFirstOrder()Export functionality for kinship matrix, founders, and relationships
See also
modSummaryStatsUI for the user interface
convertRelationships for relationship classification
makeRelationClassesTable for relationship class
summary
countFirstOrder for first-order relative counting
kinship for kinship matrix calculation
Other Shiny modules:
modBreedingGroupsServer(),
modBreedingGroupsUI(),
modGeneticDiversityServer(),
modGeneticDiversityUI(),
modGeneticValueServer(),
modGeneticValueUI(),
modGvAndBgDescServer(),
modGvAndBgDescUI(),
modInputServer(),
modInputUI(),
modORIPReportingServer(),
modORIPReportingUI(),
modPedigreeServer(),
modPedigreeUI(),
modPotentialParentsServer(),
modPotentialParentsUI(),
modPyramidServer(),
modPyramidUI(),
modSummaryStatsUI()
