Creates one row in trait_meta describing a genetic component trait: a
quantity with QTL effects in genome_effects, genetic values in ind_tgv, and
additive genetic variance in trait_var_comp. Contains no
phenotype-level information.
To register the observed phenotype that individuals receive records for,
call define_phenotype() after this function.
The trait's genetic targets are not set here. Store them with
define_effect_cov_matrix() (effect_name = "additive"), or pass G to
define_additive_effects(), which writes the target together with the
effects calibrated to it. The usual chain is define_trait() →
define_additive_effects(G = ) → define_phenotype().
Arguments
- pop
A
tidybreed_popobject.- trait_name
Character. Unique identifier for this genetic component trait. Must be a valid SQL identifier.
- description
Character. Free-text description of the trait.
- units
Character. Measurement units, e.g.
"kg","count".- overwrite
Logical. If
TRUEand a trait with the same name already exists, replace itstrait_metarow and clear associatedphenotype_effectsrows. DefaultFALSEerrors if the trait already exists.
Examples
if (FALSE) { # \dontrun{
# Simple genetic component trait, its target and its effects:
pop <- pop |>
define_trait("ADG", units = "g/day")
pop <- get_table(pop, "genome_meta") |>
define_additive_effects("ADG", G = 100)
# Maternal component traits (no define_phenotype call needed for WWD/WWM):
pop <- pop |>
define_trait("WWD") |>
define_trait("WWM")
pop <- get_table(pop, "genome_meta") |>
define_additive_effects(c("WWD", "WWM"),
G = matrix(c(200, -40, -40, 80), 2, 2))
# Then define the observed composite phenotype:
pop <- pop |>
define_phenotype("WW", type = "continuous", mean = 230,
residual_var = 180,
components = tibble::tribble(
~source_trait_name, ~contributor_type,
"WWD", "self",
"WWM", "dam"
))
} # }
