
Define a trait with QTL and sampled effects in one call
Source:R/define_trait_simple.R
define_trait_simple.RdConvenience wrapper that chains define_trait(), define_additive_effects(),
and define_phenotype() for a single uncorrelated trait using random QTL
placement. For correlated multi-trait simulations or custom QTL placement,
use the functions individually with
get_table("genome_meta") |> filter(...) |> define_additive_effects().
Usage
define_trait_simple(
pop,
trait_name,
n_qtl,
target_add_var,
mean = 0,
residual_var,
type = "continuous",
expressed_sex = "both",
repeatable = FALSE,
effect_distribution = "normal",
scale_to_target = TRUE,
seed = NULL,
...
)Arguments
- pop
A
tidybreed_popobject.- trait_name
Character. Trait name; must be a valid SQL identifier.
- n_qtl
Integer. Number of QTL to randomly select from
genome_meta.- target_add_var
Numeric. Additive genetic variance target. Passed to
define_trait().- mean
Numeric. Phenotypic population mean. Passed to
define_phenotype()as themeanargument. Default0.- residual_var
Numeric. Residual variance. Passed to
define_phenotype().- type
Character. One of
"continuous"(default),"count","categorical". Passed todefine_phenotype().- expressed_sex
Character.
"both"(default),"M", or"F". Passed todefine_phenotype().- repeatable
Logical. Whether the trait allows repeated records. Passed to
define_phenotype(). DefaultFALSE.- effect_distribution
Character.
"normal"(default) or"gamma". Passed todefine_additive_effects().- scale_to_target
Logical. Passed to
define_additive_effects(). DefaultTRUE.- seed
Optional integer for reproducibility (applied before QTL draw and effect sampling).
- ...
Additional arguments forwarded to
define_phenotype()(e.g.prevalence,thresholds,cat_values,cat_names,min_value,max_value,store_liability).