Learn R Programming

simulMGF (version 0.1.1)

simulN: Function to simulate a SNP matrix, a phenotypic trait and the effects of associated SNPs.

Description

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.

Usage

simulN(Nind, Nmarkers, Nqtl, Esigma, Pmean, Perror)

Value

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.

Arguments

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).

Author

Martin Nahuel Garcia <orcid:0000-0001-5760-986X>

Details

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 $$

References

Wu, R., Ma, C., & Casella, G. (2007). Statistical genetics of quantitative traits: linkage, maps and QTL. Springer Science & Business Media.

See Also

simGeno, simPheno, simulU

Examples

Run this code
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 ...

Run the code above in your browser using DataLab