
Remove one scope of generated effects
Source:R/remove_generated_effects.R
remove_generated_effects.RdDeletes every term a generator wrote for trait_name at exactly one
scope, (line_name, parent_origin) — the scope a re-run of
define_additive_effects() would replace — whatever its kind:
additive, dominance and interaction terms at that scope go together. A
generated model is calibrated as a whole, so it is removed as a whole and
never one component at a time (for "A without D", re-run the generator with
an additive-only target, which re-calibrates). Every other scope stands.
This is the only way to remove a generated variant:
define_genome_effect_terms() and
remove_rows() refuse the reserved owner "generated", so that
"generated" keeps meaning "calibrated to the stored target".
The usual reason is a variant added by mistake, such as a re-run with a new
parent_origin, which adds a variant beside the old one rather than
replacing it. Two parent scopes at one line are a legal model, but no
stored target describes their combined variance, so
define_phenotype(prevalence = ) refuses such a trait.
A define_genome_effects() model is common-scope (no line_name, no
parent_origin), so remove_generated_effects(pop, trait_name) removes it
whole: its additive, dominance and additive-by-additive terms together.
Nothing else changes:
The stored targets in
trait_var_compstay. A target with no terms of its kind is ignored by theprevalencethreshold, but it still counts for generation:define_additive_effects()refuses a trait with a storeddominanceoradditive_by_additivetarget unlesstrait_var_comp_tblselects the additive rows alone (or those targets are removed withremove_rows());define_genome_effects()calibrates to all of them again.The values already in
ind_tgvstay. They describe the old model untiladd_tgv()(oradd_phenotype(), which calls it) re-evaluates the individuals. If the removal leaves the trait with no terms at all, that re-evaluation is an error ("No genome effects found"), so the old values cannot be refreshed and are still whatget_table()shows: write a new model before computing genetic values or recording phenotypes again. No new record is ever made from them.
Removing a line's variant makes that line's copies fall back to the common variant, where there is one.
Arguments
- pop
A
tidybreed_popobject.- trait_name
Character vector. The trait(s) whose variant is removed.
- line_name
NULL(the population-wide scope) or one line name, as passed todefine_additive_effects().- parent_origin
NULL(both parents' copies),1(sire) or2(dam), as passed todefine_additive_effects(). A generator with no scope arguments writes the common scope,line_name = NULL, parent_origin = NULL.