View source: R/script_simulMGF.R
simulN | R Documentation |
This function simulate a SNP matrix (coded as 0, 1, 2) and traits with a selected number of QTLs and their effects that will be sampled from a Normal distribution.
simulN(Nind, Nmarkers, Nqtl, Esigma, Pmean, Perror)
Nind |
number of individuals to simulate. |
Nmarkers |
number of SNP markers to generate. |
Nqtl |
number of QTLs controlling the trait. |
Esigma |
standard deviation of effects with distribution N~(0,Esigma^2). |
Pmean |
phenotype mean. |
Perror |
standard deviation of error (portion of phenotype not explained by genomic information). |
Genotypic data is simulated as the round value sampled from an uniform distribution with interval (-.5,2.5). Phenotypic data are obtained as a linear function defined by:
y = Pmean + \sum QTN*Meffects + Perror
An object of class list containing the SNP matrix, the trait, the markers associated and their effects.
geno |
SNP matrix generated. |
pheno |
vector with the trait values simulated. |
QTN |
column in the SNP matrix with the SNP associated. |
Meffects |
effects of the associated SNPs. |
The genotype is simulated in the same way of simGeno function. The trait, QTLs and their effects are simulated in the same way of simPheno function.
Martin Nahuel Garcia <orcid:0000-0001-5760-986X>
Wu, R., Ma, C., & Casella, G. (2007). Statistical genetics of quantitative traits: linkage, maps and QTL. Springer Science & Business Media.
simGeno, simPheno, simulU
set.seed(123)
simulN(100, 1000, 50, .9, 12, .5)
#[1] "nsimout was generated"
str(nsimout)
#List of 4
#$ geno : num [1:100, 1:1000] 0 2 1 2 2 0 1 2 1 1 ...
#$ pheno : num [1:100, 1] 25.4 21.6 16 13.8 19.4 ...
#$ QTN : int [1:50] 568 474 529 349 45 732 416 51 413 514 ...
#$ Meffects: num [1:50] 0.2696 -0.1552 1.0192 0.0209 1.2023 ...
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.