Generates a small marker matrix and a phenotype with a known narrow-sense heritability, for examples, tests and demonstrations. Markers are coded as allele dosages (0, 1, 2). A random subset of markers are QTL with additive effects; the phenotype is the resulting breeding value plus normal noise scaled to the target heritability.
Arguments
- n
Number of individuals. Default 200.
- m
Number of markers. Default 1000.
- n_qtl
Number of markers with a non-zero (QTL) effect. Default 50.
- h2
Target narrow-sense heritability in (0, 1]. Default 0.5.
- seed
Optional integer seed for reproducibility. Applied with
withr::with_seed(), which scopes the seed locally and leaves the caller's random-number state unchanged.