View source: R/breeding_game.R
simulTraits12 | R Documentation |
Simulate phenotypes of traits 1 and 2 jointly: Y = Z.J * Alpha + Z.I * G.A + E.
simulTraits12(
dat,
mu = c(trait1 = 100, trait2 = 15),
sigma.alpha2 = c(trait1 = 230, trait2 = 10),
Alpha = NULL,
X,
afs,
Beta,
h2 = NULL,
sigma2 = c(trait1 = 330, trait2 = 0.6),
cor.E.inter.trait = 0,
set.neg.to.zero = TRUE,
verbose = 1
)
dat |
data.frame specifying the structure of the initial data set of phenotypes, with columns "ind", "year", etc |
mu |
vector of global means, for each trait |
sigma.alpha2 |
vector of variance for the "year" effects, for each trait (ignored if |
Alpha |
matrix of "year" effects, for each trait, the years corresponding to those indicated in |
X |
matrix of bi-allelic SNP genotypes encoded in allele dose in 0,1,2, with individuals in rows in the same order as the levels of |
afs |
vector of allele frequencies (to center X so that the genotypic values are also centered) which names are the SNPs |
Beta |
matrix of additive SNP effects, for each trait |
h2 |
vector of heritabilities, with the name of each trait, for instance |
sigma2 |
vector of error variances, with the name of each trait, for instance |
cor.E.inter.trait |
correlation of errors between both traits |
set.neg.to.zero |
if TRUE, the negative phenotypic values, if any, will be set to zero |
verbose |
verbosity level (0/1) |
list
Timothee Flutre
simulSnpEffectsTraits12
, makeDfInitPhenos
## Not run: set.seed(1859)
X <- simulGenosDose(nb.genos=825, nb.snps=2000)
snp.effects12 <- simulSnpEffectsTraits12(snp.ids=colnames(X))
dat <- makeDfInitPhenos(line.ids=rownames(X))
phenos <- simulTraits12(dat, X=X, Beta=snp.effects12$Beta)
regplot(phenos$G.A[,1], phenos$G.A[,2])
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.