View source: R/getGeneticDiversityStats.R
| getGeneticDiversityStats | R Documentation |
Assemble breeding-group genetic diversity heat-map statistics
getGeneticDiversityStats(
groups,
ped,
geneticValues,
kmat,
housing = "shelter_pens",
currentDate = Sys.Date()
)
groups |
List of character vectors of animal IDs, one per breeding
group (for example the |
ped |
Dataframe that is the |
geneticValues |
Dataframe of the genetic value report (for example
|
kmat |
Square kinship matrix whose row and column names are animal IDs
and that covers every member of every group (for example the matrix
returned by |
housing |
Character housing type passed to |
currentDate |
Date used to derive age and the production birth window.
Defaults to |
For each breeding group this builds the heat-map color indices by
calling the per-group providers: Value from getProportionLow, Origin
from getIndianOriginStatus, Production from
getProductionStatus, and Inbreeding from
getKinshipWithMaleStatus. The result is the group-by-metric data
frame consumed by makeGeneticDiversityHeatmap: the first
column holds the group label and each remaining column holds a color index
(1 red, 2 yellow, 3 green).
Age is derived from each member's birth date using currentDate
rather than read from a possibly-absent age column, so the age
filters and the production birth window share one reference date.
Genetic-value labels of "Undetermined" are dropped before the Value
proportion is taken. A group with no assessed value, and a group whose
Inbreeding metric is undefined (no breeding-age females), are both scored
red so that missing data is surfaced rather than shown as healthy green.
When the pedigree has no ancestry column the Origin metric cannot be
computed and its column is omitted.
A data frame with one row per group: the first column group
holds the group label and each remaining column (Value,
Origin when available, Production, Inbreeding) holds an
integer color index in c(1, 2, 3).
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.