Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Data Simulation for Life Science and Breeding

License

NotificationsYou must be signed in to change notification settings

xiaolei-lab/SIMER

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GitHub issuesCRAN VersionHits

Data Simulation for Life Science and Breeding

Authors:

Design and Maintenance: Dong Yin, Xuanning Zhang, Lilin Yin ,Haohao Zhang, andXiaolei Liu.
Contributors: Zhenshuang Tang, Jingya Xu, Xiaohui Yuan, Xiang Zhou, Xinyun Li, and Shuhong Zhao.
Citation: Yin D., Zhang X, Yin L, Zhang H, Tang Z, Xu J, Yuan X, Zhou X, Li X, Zhao S, Liu X.SIMER: an accurate and intelligent tool for simulating customizable population data across species in complex scenarios,Journal of Big Data , 2025, 12 (49), doi:https://doi.org/10.1186/s40537-025-01102-z.

If you have any bug reports or questions, please feed back 👉here👈.

🧰 Relevant software tools for genetic analyses and genomic breeding

📫HIBLUP: Versatile and easy-to-use GS toolbox.🏔️IAnimal: an omics knowledgebase for animals.
🚴‍♂️KAML: Advanced GS method for complex traits.📊CMplot: A drawing tool for genetic analyses.
📮rMVP: Efficient and easy-to-use GWAS tool.🏊hibayes: A Bayesian-based GWAS and GS tool.

Contents


Installation

back to top

WE STRONGLY RECOMMEND TO INSTALL SIMER ON Microsoft R Open (https://mran.microsoft.com/download/).

Installation

  • The stable version:
install.packages("simer")
  • The latest version:
devtools::install_github("xiaolei-lab/SIMER")

After installed successfully,SIMER can be loaded by typing

> library(simer)

Typing?simer could get the details of all parameters.


Data Preparation

Genotype

back to top

Genotype data should beNumeric format (either m * n or n * m is acceptable,m is the number of SNPs,n is the number of individuals). Othergenotype data, such asPLINK Binary format (details seehttp://zzz.bwh.harvard.edu/plink/data.shtml#bed),VCF, orHapmap can be converted toNumeric format usingMVP.Data function in therMVP (https://github.com/xiaolei-lab/rMVP).

genotype.txt

210100
120100
112100
110210
000020

Genetic map

back to top
Agenetic map is necessary inSIMER. The first column is theSNP name, the second column is theChromosome ID, the third column isphysical position, the fourth column isREF, and the fifth column isALT. This will be used to generateannotation data,genotype data, andphenotype data.

map.txt

SNPChromBPREFALT
1_10673082110673082TC
1_10723065110723065AG
1_11407894111407894AG
1_11426075111426075TC
1_13996200113996200TC
1_14638936114638936TC

Pedigree

back to top
SIMER supportsuser designed pedigree to control mating process.User designed pedigree is useful only inuserped reproduction. The first column issample id, the second column ispaternal id, and the third column ismaternal id. Please make sure thatpaternal id andmaternal id can match togenotype data.

userped.txt

IndexSireDam
41111
42111
43111
44111
45212
46212

Data Input

Basic

back to top
At least users should prepare two datasets:genetic map andgenotype data.

genetic map, SNP map information, the first column isSNP name, the second column isChromosome ID, the third column isphysical position, the fourth column isREF, and the fifth column isALT.
genotype data,Numeric format (either m * n or n * m is acceptable,m is the number of SNPs,n is the number of individuals)

pop.map<- read.table("map.txt",head=TRUE)pop.geno<- read.table("genotype.txt")

SIMER also supports genotype data in bigmemory format.

pop.map<- read.table("map.geno.map",head=TRUE)pop.geno<-bigmemory::attach.big.matrix("genotype.geno.desc")

Optional

back to top
The mating process can be designed byuser-designed pedigree.

pedigree, pedigree information, the first column issample id, the second column ispaternal id, and the third column ismaternal id. Note that the individuals in thepedigree do not need to be sorted by the date of birth, and the missing value can be replaced by NA or 0.

userped<- read.table("userped.txt",header=TRUE)

Quick Start

back to top

All simulation processes can be divided into two steps:1) generation of simulation parameters;2) run simulation process.

Quick Start for Population Simulation

back to top

A quick start forPopulation Simulation is shown below:

# Generate all simulation parametersSP<- param.simer(out="simer")# Run SimerSP<- simer(SP)

Quick Start for Genotype Simulation

back to top

A quick start forGenotype Simulation is shown below:

# Generate annotation simulation parametersSP<- param.annot(species="pig")# Generate genotype simulation parametersSP<- param.geno(SP=SP,pop.ind=1e2)# Run annotation simulationSP<- annotation(SP)# Run genotype simulationSP<- genotype(SP)

Quick Start for Phenotype Simulation

back to top

A quick start forPhenotype Simulation is shown below:

# Generate annotation simulation parametersSP<- param.annot(species="pig")# Generate genotype simulation parametersSP<- param.geno(SP=SP,pop.ind=1e2)# Generate phenotype simulation parametersSP<- param.pheno(SP=SP,phe.h2A=list(tr1=0.3))# Run annotation simulationSP<- annotation(SP)# Run genotype simulationSP<- genotype(SP)# Run phenotype simulationSP<- phenotype(SP)

Genotype Simulation

back to top

Genotype data inSIMER is generated randomly or through an external genotype matrix. Chromosome crossovers and base mutations depend on block information and recombination information ofAnnotation data.

Gallery of genotype simulation parameters

back to top

genotype, main function ofGenotype Simulation:

ParamaterDefaultOptionsDescription
pop.genoNULLbig.matrix or matrix (either m * n or n * m is acceptable, m is the number of SNPs, n is the number of individuals)the genotype data.
inrows11 or 2"1": one-row genotype represents an individual; "2": two-row genotype represents an individual.
pop.marker1e4numthe number of markers.
pop.ind1e2numthe number of individuals in the base population.
probNULLnum vectorthe genotype code probability.
rate.mutlist(qtn = 1e-8, snp = 1e-8)listthe mutation rate of the genotype data.
cldFALSETRUE or FALSEwhether to generate a complete LD genotype data when "inrows == 2".

annotation, main function ofAnnotation Simulation:

ParamaterDefaultOptionsDescription
pop.mapNULLdata.framethe map data with annotation information.
speciesNULLcharacterthe species of genetic map, which can be "arabidopsis", "cattle", "chicken", "dog", "horse", "human", "maize", "mice", "pig", and "rice".
pop.marker1e4numthe number of markers.
num.chr18numthe number of chromosomes.
len.chr1.5e8numthe length of chromosomes.
recom.spotFALSETRUE or FALSEwhether to generate recombination events.
range.hot4:6num vectorthe recombination times range in the hot spot.
range.cold1:5num vectorthe recombination times range in the cold spot.

Generate an external or species-specific or random genetic map

back to top

Users can generate a genetic map by inputting an external genetic map.

# Real genotypic mapmapPath<- system.file("extdata","06map","pig_map.txt",package="simer")pop.map<- read.table(mapPath,header=TRUE)# Generate annotation simulation parametersSP<- param.annot(pop.map=pop.map)# Run annotation simulationSP<- annotation(SP)

Users can also use the inner real genetic map withspecies, which can be "arabidopsis", "cattle", "chicken", "dog", "horse", "human", "maize", "mice", "pig", and "rice".

# Generate annotation simulation parametersSP<- param.annot(species="pig")# Run annotation simulationSP<- annotation(SP)

Users can generate a random genetic map withpop.marker,num.chr, andlen.chr.

# Generate annotation simulation parametersSP<- param.annot(pop.marker=1e4,num.chr=18,len.chr=1.5e8)# Run annotation simulationSP<- annotation(SP)

Generate an external or species-specific or random genotype matrix

back to top

Users can usereal genotype data with specific genetic structure for subsequent simulation.

# Create a genotype matrix# pop.geno <- read.table("genotype.txt")# pop.geno <- bigmemory::attach.big.matrix("genotype.geno.desc")pop.geno<-matrix(c(0,1,2),nrow=1e2,ncol=1e4,byrow=TRUE)# Generate annotation simulation parametersSP<- param.annot(pop.marker=1e4)# Generate genotype simulation parametersSP<- param.geno(SP=SP,pop.geno=pop.geno)# Run annotation simulationSP<- annotation(SP)# Run genotype simulationSP<- genotype(SP)

Users can also generate genotype matrix with the inner real genetic map withspecies, which can be "arabidopsis", "cattle", "chicken", "dog", "horse", "human", "maize", "mice", "pig", and "rice".

# Generate annotation simulation parametersSP<- param.annot(species="pig")# Generate genotype simulation parametersSP<- param.geno(SP=SP,pop.ind=1e2)# Run annotation simulationSP<- annotation(SP)# Run genotype simulationSP<- genotype(SP)

Users can also specifypop.marker andpop.ind to generaterandom genotype data.

# Generate annotation simulation parametersSP<- param.annot(pop.marker=1e4)# Generate genotype simulation parametersSP<- param.geno(SP=SP,pop.ind=1e2)# Run annotation simulationSP<- annotation(SP)# Run genotype simulationSP<- genotype(SP)

Generate a genotype matrix with complete linkage disequilibrium

back to top

Users can generate a genotype matrix withcomplete linkage disequilibrium byinrows = 2 andcld = TRUE.

# Generate annotation simulation parametersSP<- param.annot(pop.marker=1e4)# Generate genotype simulation parametersSP<- param.geno(SP=SP,pop.ind=1e2,inrows=2,cld=TRUE)# Run annotation simulationSP<- annotation(SP)# Run genotype simulationSP<- genotype(SP)

Add chromosome crossovers and mutations to genotype matrix

back to top

Withannotation data, chromosome crossovers and mutations can be added to a genotype matrix.

# Generate annotation simulation parameters# If recom.spot = TRUE, chromosome crossovers will be added to genotype matrixSP<- param.annot(pop.marker=1e4,recom.spot=TRUE)# Generate genotype simulation parameters# Base mutation rate of QTN and SNP are 1e-8SP<- param.geno(SP=SP,pop.ind=1e2,rate.mut=list(qtn=1e-8,snp=1e-8))# Run annotation simulationSP<- annotation(SP)# Run genotype simulationSP<- genotype(SP)

Note that recombination only exists in meiosis. Therefore, some reproduction methods such asclone do not have recombination processes. Users can setrecom.spot = FALSE to add only mutations to the genotype matrix.

# Generate annotation simulation parameters# If recom.spot = FALSE, chromosome crossovers will not be added to genotype matrixSP<- param.annot(pop.marker=1e4,recom.spot=FALSE)# Generate genotype simulation parameters# Base mutation rate of QTN and SNP are 1e8SP<- param.geno(SP=SP,pop.ind=1e2,rate.mut=list(qtn=1e-8,snp=1e-8))# Run annotation simulationSP<- annotation(SP)# Run genotype simulationSP<- genotype(SP)

Phenotype Simulation

back to top

Phenotype data inSIMER is generated according to different models, which include:
(1) Single-Trait Model
(2) Multiple-Trait Model
(3) Repeated Record Model
(4) Genetic Effect Model (Additive effect,Dominant effect, andGenetic-Genetic interaction effect)
(5) Genetic Model with Varied QTN Effect Distributions (QTN effect distribution:Normal distribution,Geometric distribution,Gamma distribution,Beta distribution, and their combination)
(6) Linear Mixed Model (Fixed effect,Covariate,EnvironmentalRandom effect,GeneticRandom effect,Genetic-Environmental interaction effect, andEnvironmental-Environmental interaction effect)

Gallery of phenotype simulation parameters

back to top

phenotype, main function ofPhenotype Simulation:

ParamaterDefaultOptionsDescription
popNULLdata.framethe population information containing environmental factors and other effects.
pop.ind100numthe number of individuals in the base population.
pop.rep1numthe repeated times of repeated records.
pop.rep.balTRUETRUE or FALSEwhether repeated records are balanced.
pop.envNULLlista list of environmental factors setting.
phe.typelist(tr1 = "continuous")lista list of phenotype types.
phe.modellist(tr1 = "T1 = A + E")lista list of genetic model of phenotype such as "T1 = A + E".
phe.h2Alist(tr1 = 0.3)lista list of additive heritability.
phe.h2Dlist(tr1 = 0.1)lista list of dominant heritability.
phe.h2GxGlist(tr1 = 0.1)lista list of GxG interaction heritability.
phe.h2GxElist(tr1 = 0.1)lista list of GxE interaction heritability.
phe.h2PElist(tr1 = 0.1)lista list of permanent environmental heritability.
phe.varNULLlista list of phenotype variance.
phe.corAdiag(nTrait)matrixthe additive genetic correlation matrix.
phe.corDdiag(nTrait)matrixthe dominant genetic correlation matrix.
phe.corGxGlist(diag(nTrait))lista list of the GxG genetic correlation matrix.
phe.corPEdiag(nTrait)matrixthe permanent environmental correlation matrix.
phe.corEdiag(nTrait)matrixthe residual correlation matrix.

annotation, main function ofAnnotation Simulation:

ParamaterDefaultOptionsDescription
pop.mapNULLdata.framethe map data with annotation information.
qtn.model"A"characterthe genetic model of QTN such as "A + D".
qtn.indexNULLlistthe QTN index for each trait.
qtn.numlist(tr1 = 10)listthe QTN number for (each group in) each trait.
qtn.distlist(tr1 = "norm")listthe QTN distribution containing "norm", "geom", "gamma" or "beta".
qtn.varlist(tr1 = 0.01)listthe variances for normal distribution.
qtn.problist(tr1 = 0.5)listthe probability of success for geometric distribution.
qtn.shapelist(tr1 = 1)listthe shape parameter for gamma distribution.
qtn.scalelist(tr1 = 1)listthe scale parameter for gamma distribution.
qtn.shape1list(tr1 = 1)listthe shape1 parameter for beta distribution.
qtn.shape2list(tr1 = 1)listthe shape2 parameter for beta distribution.
qtn.ncplist(tr1 = 0)listthe ncp parameter for beta distribution.
qtn.spotFALSETRUE or FALSEthe QTN distribution probability in each block.
len.block5e7numthe block length.
mafNULLnumthe maf threshold, markers less than this threshold will be exclude.

Generate phenotype using an external or species-specific or random genotype matrix

back to top

Users can usereal genotype data with specific genetic structure to generate phenotype.

# Create a genotype matrix# pop.geno <- read.table("genotype.txt")# pop.geno <- bigmemory::attach.big.matrix("genotype.geno.desc")pop.geno<-matrix(c(0,1,2),nrow=1e2,ncol=1e4,byrow=TRUE)# Generate annotation simulation parametersSP<- param.annot(pop.marker=1e4)# Generate genotype simulation parametersSP<- param.geno(SP=SP,pop.geno=pop.geno)# Generate phenotype simulation parametersSP<- param.pheno(SP=SP,phe.h2A=list(tr1=0.3))# Run annotation simulationSP<- annotation(SP)# Run genotype simulationSP<- genotype(SP)# Run phenotype simulationSP<- phenotype(SP)

Users can also generate phenotype using species-specific genotype matrix.

# Generate annotation simulation parametersSP<- param.annot(species="pig")# Generate genotype simulation parametersSP<- param.geno(SP=SP,pop.ind=1e2)# Generate phenotype simulation parametersSP<- param.pheno(SP=SP,phe.h2A=list(tr1=0.3))# Run annotation simulationSP<- annotation(SP)# Run genotype simulationSP<- genotype(SP)# Run phenotype simulationSP<- phenotype(SP)

Users can also generate phenotype using random genotype.

# Generate annotation simulation parametersSP<- param.annot(pop.marker=1e4)# Generate genotype simulation parametersSP<- param.geno(SP=SP,pop.ind=1e2)# Generate phenotype simulation parametersSP<- param.pheno(SP=SP,phe.h2A=list(tr1=0.3))# Run annotation simulationSP<- annotation(SP)# Run genotype simulationSP<- genotype(SP)# Run phenotype simulationSP<- phenotype(SP)

Generate continuous phenotype

back to top

SIMER generates continuous phenotypes by default. Continuous phenotype simulation is displayed as follows:
If users want to output files, please seeFile output.

# Generate annotation simulation parametersSP<- param.annot(pop.marker=1e4,qtn.num=list(tr1=10),qtn.model="A")# Additive effect# Generate genotype simulation parametersSP<- param.geno(SP=SP,pop.ind=1e2)# random genotype# Generate phenotype simulation parametersSP<- param.pheno(SP=SP,phe.type=list(tr1="continuous"),phe.model=list(tr1="T1 = A + E"),# "T1" (Trait 1) consists of Additive effect and Residual effect# phe.var = list(tr1 = 100),phe.h2A=list(tr1=0.3))# Run annotation simulationSP<- annotation(SP)# Run genotype simulationSP<- genotype(SP)# Run phenotype simulationSP<- phenotype(SP)

Multiple-trait simulation of continuous phenotype is displayed as follows:
If users want to output files, please seeFile output.

# Generate annotation simulation parametersSP<- param.annot(pop.marker=1e4,qtn.num=list(tr1=10,tr2=10),qtn.model="A")# Additive effect# Generate genotype simulation parametersSP<- param.geno(SP=SP,pop.ind=1e2)# random genotype# Generate phenotype simulation parametersSP<- param.pheno(SP=SP,phe.type=list(tr1="continuous",tr2="continuous"),phe.model=list(tr1="T1 = A + E",# "T1" (Trait 1) consists of Additive effect and Residual effecttr2="T2 = A + E"# "T2" (Trait 2) consists of Additive effect and Residual effect  ),# phe.var = list(tr1 = 100, tr2 = 100),phe.h2A=list(tr1=0.3,tr2=0.3),phe.corA=matrix(c(1,0.5,0.5,1),2,2)# Additive genetic correlation)# Run annotation simulationSP<- annotation(SP)# Run genotype simulationSP<- genotype(SP)# Run phenotype simulationSP<- phenotype(SP)

Generate case-control phenotype

back to top

SIMER generates case-control phenotypes byphe.type.phe.type consists of the variable names and their percentages. Case-control phenotype simulation is displayed as follows:
If users want to output files, please seeFile output.

# Generate annotation simulation parametersSP<- param.annot(pop.marker=1e4,qtn.num=list(tr1=10),qtn.model="A")# Additive effect# Generate genotype simulation parametersSP<- param.geno(SP=SP,pop.ind=1e2)# random genotype# Generate phenotype simulation parametersSP<- param.pheno(SP=SP,phe.type=list(tr1=list(case=0.01,control=0.99)),# "T1" (Trait 1) consists of 1% case and 99% controlphe.model=list(tr1="T1 = A + E"),# "T1" (Trait 1) consists of Additive effect and Residual effect# phe.var = list(tr1 = 100),phe.h2A=list(tr1=0.3))# Run annotation simulationSP<- annotation(SP)# Run genotype simulationSP<- genotype(SP)# Run phenotype simulationSP<- phenotype(SP)

Multiple-trait simulation of case-control phenotype is displayed as follows:
If users want to output files, please seeFile output.

# Generate annotation simulation parametersSP<- param.annot(pop.marker=1e4,qtn.num=list(tr1=10,tr2=10),qtn.model="A")# Additive effect# Generate genotype simulation parametersSP<- param.geno(SP=SP,pop.ind=1e2)# random genotype# Generate phenotype simulation parametersSP<- param.pheno(SP=SP,phe.type=list(tr1=list(case=0.01,control=0.99),# "T1" (Trait 1) consists of 1% case and 99% controltr2=list(case=0.01,control=0.99)# "T2" (Trait 2) consists of 1% case and 99% control   ),phe.model=list(tr1="T1 = A + E",# "T1" (Trait 1) consists of Additive effect and Residual effecttr2="T2 = A + E"# "T2" (Trait 2) consists of Additive effect and Residual effect  ),# phe.var = list(tr1 = 100, tr2 = 100),phe.h2A=list(tr1=0.3,tr2=0.3),phe.corA=matrix(c(1,0.5,0.5,1),2,2)# Additive genetic correlation)# Run annotation simulationSP<- annotation(SP)# Run genotype simulationSP<- genotype(SP)# Run phenotype simulationSP<- phenotype(SP)

Generate categorical phenotype

back to top

SIMER generates categorical phenotypes byphe.type.phe.type consists of the variable names and their percentages. Categorical phenotype simulation is displayed as follows:
If users want to output files, please seeFile output.

# Generate annotation simulation parametersSP<- param.annot(pop.marker=1e4,qtn.num=list(tr1=10),qtn.model="A")# Additive effect# Generate genotype simulation parametersSP<- param.geno(SP=SP,pop.ind=1e2)# random genotype# Generate phenotype simulation parametersSP<- param.pheno(SP=SP,phe.type=list(tr1=list(low=0.3,medium=0.4,high=0.3)),# "T1" (Trait 1) consists of 30% low, 40% medium, and 30% highphe.model=list(tr1="T1 = A + E"),# "T1" (Trait 1) consists of Additive effect and Residual effect# phe.var = list(tr1 = 100),phe.h2A=list(tr1=0.3))# Run annotation simulationSP<- annotation(SP)# Run genotype simulationSP<- genotype(SP)# Run phenotype simulationSP<- phenotype(SP)

Multiple-trait simulation of categorical phenotype is displayed as follows:
If users want to output files, please seeFile output.

# Generate annotation simulation parametersSP<- param.annot(pop.marker=1e4,qtn.num=list(tr1=10,tr2=10),qtn.model="A")# Additive effect# Generate genotype simulation parametersSP<- param.geno(SP=SP,pop.ind=1e2)# random genotype# Generate phenotype simulation parametersSP<- param.pheno(SP=SP,phe.type=list(tr1=list(low=0.3,medium=0.4,high=0.3),# "T1" (Trait 1) consists of 30% low, 40% medium, and 30% hightr2=list(low=0.3,medium=0.4,high=0.3)# "T2" (Trait 2) consists of 30% low, 40% medium, and 30% high   ),phe.model=list(tr1="T1 = A + E",# "T1" (Trait 1) consists of Additive effect and Residual effecttr2="T2 = A + E"# "T2" (Trait 2) consists of Additive effect and Residual effect  ),# phe.var = list(tr1 = 100, tr2 = 100),phe.h2A=list(tr1=0.3,tr2=0.3),phe.corA=matrix(c(1,0.5,0.5,1),2,2)# Additive genetic correlation)# Run annotation simulationSP<- annotation(SP)# Run genotype simulationSP<- genotype(SP)# Run phenotype simulationSP<- phenotype(SP)

Generate phenotype using A model

back to top

In an "A" model,SIMER only considers anAdditive effect as a genetic effect. Users should prepareAdditiveQTN effect in theAnnotation data to generate anAdditiveIndividual effect. AnAdditive single-trait simulation is displayed as follows:
If users want to output files, please seeFile output.

# Generate annotation simulation parametersSP<- param.annot(pop.marker=1e4,qtn.num=list(tr1=10),qtn.model="A")# Additive effect# Generate genotype simulation parametersSP<- param.geno(SP=SP,pop.ind=1e2)# random genotype# Generate phenotype simulation parametersSP<- param.pheno(SP=SP,phe.model=list(tr1="T1 = A + E"),# "T1" (Trait 1) consists of Additive effect and Residual effect# phe.var = list(tr1 = 100),phe.h2A=list(tr1=0.3))# Run annotation simulationSP<- annotation(SP)# Run genotype simulationSP<- genotype(SP)# Run phenotype simulationSP<- phenotype(SP)

In the multiple-trait simulation,SIMER buildsaccurate Additive genetic correlation among multiple traits. AnAdditive multiple-trait simulation is displayed as follows:
If users want to output files, please seeFile output.

# Generate annotation simulation parametersSP<- param.annot(pop.marker=1e4,qtn.num=list(tr1=10,tr2=10),qtn.model="A")# Additive effect# Generate genotype simulation parametersSP<- param.geno(SP=SP,pop.ind=1e2)# random genotype# Generate phenotype simulation parametersSP<- param.pheno(SP=SP,phe.model=list(tr1="T1 = A + E",# "T1" (Trait 1) consists of Additive effect and Residual effecttr2="T2 = A + E"# "T2" (Trait 2) consists of Additive effect and Residual effect  ),# phe.var = list(tr1 = 100, tr2 = 100),phe.h2A=list(tr1=0.3,tr2=0.3),phe.corA=matrix(c(1,0.5,0.5,1),2,2)# Additive genetic correlation)# Run annotation simulationSP<- annotation(SP)# Run genotype simulationSP<- genotype(SP)# Run phenotype simulationSP<- phenotype(SP)

Generate phenotype using AD model

back to top

In an "AD" model,SIMER considersAdditive effect andDominant effect as genetic effect. Users should prepareAdditiveQTN effect andDominantQTN effect in theAnnotation data to generate anAdditiveIndividual effect andDominantIndividual effect.Additive andDominant single-trait simulation is displayed as follows:
If users want to output files, please seeFile output.

# Generate annotation simulation parametersSP<- param.annot(pop.marker=1e4,qtn.num=list(tr1=10),qtn.model="A + D")# Additive effect and Dominant effect# Generate genotype simulation parametersSP<- param.geno(SP=SP,pop.ind=1e2)# random genotype# Generate phenotype simulation parametersSP<- param.pheno(SP=SP,phe.model=list(tr1="T1 = A + D + E"),# "T1" (Trait 1) consists of Additive effect, Dominant effect, and Residual effect# phe.var = list(tr1 = 100),phe.h2A=list(tr1=0.3),phe.h2D=list(tr1=0.1))# Run annotation simulationSP<- annotation(SP)# Run genotype simulationSP<- genotype(SP)# Run phenotype simulationSP<- phenotype(SP)

In multiple-trait simulation,SIMER buildsaccurate Additive genetic correlation andaccurate Dominant genetic correlation among multiple traits. AnAdditive andDominant multiple-trait simulation is displayed as follows:
If users want to output files, please seeFile output.

# Generate annotation simulation parametersSP<- param.annot(pop.marker=1e4,qtn.num=list(tr1=10,tr2=10),qtn.model="A + D")# Additive effect and Dominant effect# Generate genotype simulation parametersSP<- param.geno(SP=SP,pop.ind=1e2)# random genotype# Generate phenotype simulation parametersSP<- param.pheno(SP=SP,phe.model=list(tr1="T1 = A + D + E",# "T1" (Trait 1) consists of Additive effect, Dominant effect, and Residual effecttr2="T2 = A + D + E"# "T2" (Trait 2) consists of Additive effect, Dominant effect, and Residual effect  ),# phe.var = list(tr1 = 100, tr2 = 100),phe.h2A=list(tr1=0.3,tr2=0.3),phe.h2D=list(tr1=0.1,tr2=0.1),phe.corA=matrix(c(1,0.5,0.5,1),2,2),# Additive genetic correlationphe.corD=matrix(c(1,0.5,0.5,1),2,2)# Dominant genetic correlation)# Run annotation simulationSP<- annotation(SP)# Run genotype simulationSP<- genotype(SP)# Run phenotype simulationSP<- phenotype(SP)

Generate phenotype using GxG model

back to top

In a "GxG" model,SIMER considersGenetic-Genetic effect as a genetic effect. Users should prepareGenetic-GeneticQTN effect in theAnnotation data to generateGenetic-GeneticIndividual effect. An example ofAdditive-Dominant interaction in single-trait simulation is displayed as follows:
If users want to output files, please seeFile output.

# Generate annotation simulation parametersSP<- param.annot(pop.marker=1e4,qtn.num=list(tr1=10),qtn.model="A + D + A:D")# Additive effect, Dominant effect, and Additive-Dominant interaction effect# Generate genotype simulation parametersSP<- param.geno(SP=SP,pop.ind=1e2)# random genotype# Generate phenotype simulation parametersSP<- param.pheno(SP=SP,phe.model=list(tr1="T1 = A + D + A:D + E"),# "T1" (Trait 1) consists of Additive effect, Dominant effect, Additive-Dominant interaction effect, and Residual effect# phe.var = list(tr1 = 100),phe.h2A=list(tr1=0.3),phe.h2D=list(tr1=0.1),phe.h2GxG=list(tr1=list("A:D"=0.1)))# Run annotation simulationSP<- annotation(SP)# Run genotype simulationSP<- genotype(SP)# Run phenotype simulationSP<- phenotype(SP)

In the multiple-trait simulation,SIMER buildsaccurate Genetic-Genetic interaction correlation among multiple traits. An example ofAdditive-Dominant interaction in multiple-trait simulation is displayed as follows:
If users want to output files, please seeFile output.

# Generate annotation simulation parametersSP<- param.annot(pop.marker=1e4,qtn.num=list(tr1=10,tr2=10),qtn.model="A + D + A:D")# Additive effect, Dominant effect, and Additive-Dominant interaction effect# Generate genotype simulation parametersSP<- param.geno(SP=SP,pop.ind=1e2)# random genotype# Generate phenotype simulation parametersSP<- param.pheno(SP=SP,phe.model=list(tr1="T1 = A + D + A:D + E",# "T1" (Trait 1) consists of Additive effect, Dominant effect, Additive-Dominant interaction effect, and Residual effecttr2="T2 = A + D + A:D + E"# "T2" (Trait 2) consists of Additive effect, Dominant effect, Additive-Dominant interaction effect, and Residual effect  ),# phe.var = list(tr1 = 100, tr2 = 100),phe.h2A=list(tr1=0.3,tr2=0.3),phe.h2D=list(tr1=0.1,tr2=0.1),phe.h2GxG=list(tr1=list("A:D"=0.1),tr2=list("A:D"=0.1)),phe.corA=matrix(c(1,0.5,0.5,1),2,2),# Additive genetic correlationphe.corD=matrix(c(1,0.5,0.5,1),2,2),# Dominant genetic correlationphe.corGxG=list("A:D"=matrix(c(1,0.5,0.5,1),2,2))# Additive-Dominant interaction genetic correlation)# Run annotation simulationSP<- annotation(SP)# Run genotype simulationSP<- genotype(SP)# Run phenotype simulationSP<- phenotype(SP)

Generate phenotype using Repeated Record model

back to top

In theRepeated Record model,SIMER adds aPE (PermanentEnvironmental) effect to the phenotype. The number of repeated records can be set bypop.rep. In the meantime,pop.rep.bal can be used to determine whether repeated records are balanced. TheRepeated Record in a single-trait simulation is displayed as follows:
If users want to output files, please seeFile output.

# Generate annotation simulation parametersSP<- param.annot(pop.marker=1e4,qtn.num=list(tr1=10),qtn.model="A")# Additive effect# Generate genotype simulation parametersSP<- param.geno(SP=SP,pop.ind=1e2)# random genotype# Generate phenotype simulation parametersSP<- param.pheno(SP=SP,pop.rep=2,# The number of repeated records is 2pop.rep.bal=TRUE,# Repeated records are balancedphe.model=list(tr1="T1 = A + E"),# "T1" (Trait 1) consists of Additive effect and Residual effect# phe.var = list(tr1 = 100),phe.h2A=list(tr1=0.3),phe.h2PE=list(tr1=0.1))SP$global$useAllGeno<-TRUE# Run annotation simulationSP<- annotation(SP)# Run genotype simulationSP<- genotype(SP)# Run phenotype simulationSP<- phenotype(SP)

In the multiple-trait simulation,SIMER buildsaccurate Permanent Environmental correlation among multiple traits.Repeated Record in multiple-trait simulation is displayed as follows:
If users want to output files, please seeFile output.

# Generate annotation simulation parametersSP<- param.annot(pop.marker=1e4,qtn.num=list(tr1=10,tr2=10),qtn.model="A")# Additive effect# Generate genotype simulation parametersSP<- param.geno(SP=SP,pop.ind=1e2)# random genotype# Generate phenotype simulation parametersSP<- param.pheno(SP=SP,pop.rep=2,# The number of repeated records is 2pop.rep.bal=TRUE,# Repeated records are balancedphe.model=list(tr1="T1 = A + E",# "T1" (Trait 1) consists of Additive effect and Residual effecttr2="T2 = A + E"# "T2" (Trait 2) consists of Additive effect and Residual effect  ),# phe.var = list(tr1 = 100, tr2 = 100),phe.h2A=list(tr1=0.3,tr2=0.3),phe.h2PE=list(tr1=0.1,tr2=0.1)phe.corA=matrix(c(1,0.5,0.5,1),2,2),# Additive genetic correlationphe.corPE=matrix(c(1,0.5,0.5,1),2,2)# Permanent Environmental correlation)SP$global$useAllGeno<-TRUE# Run annotation simulationSP<- annotation(SP)# Run genotype simulationSP<- genotype(SP)# Run phenotype simulationSP<- phenotype(SP)

Generate phenotype controlled by QTNs subject to Normal distribution

back to top

Normal distribution is the most common QTN effect distribution. Phenotype controlled by QTNs subject toNormal distribution in single-trait simulation is displayed as follows:
If users want to output files, please seeFile output.

# Generate annotation simulation parametersSP<- param.annot(pop.marker=1e4,qtn.num=list(tr1=10),qtn.model="A",qtn.dist=list(tr1="norm"),qtn.var=list(tr1=0.01))# Generate genotype simulation parametersSP<- param.geno(SP=SP,pop.ind=1e2)# random genotype# Generate phenotype simulation parametersSP<- param.pheno(SP=SP,phe.model=list(tr1="T1 = A + E"),# "T1" (Trait 1) consists of Additive effect and Residual effect# phe.var = list(tr1 = 100),phe.h2A=list(tr1=0.3))# Run annotation simulationSP<- annotation(SP)# Run genotype simulationSP<- genotype(SP)# Run phenotype simulationSP<- phenotype(SP)

Phenotype controlled by QTNs subject toNormal distribution in multiple-trait simulation is displayed as follows:
If users want to output files, please seeFile output.

# Generate annotation simulation parametersSP<- param.annot(pop.marker=1e4,qtn.num=list(tr1=10,tr2=10),qtn.model="A",qtn.dist=list(tr1="norm",tr2="norm"),qtn.var=list(tr1=0.01,tr2=0.01))# Generate genotype simulation parametersSP<- param.geno(SP=SP,pop.ind=1e2)# random genotype# Generate phenotype simulation parametersSP<- param.pheno(SP=SP,phe.model=list(tr1="T1 = A + E",# "T1" (Trait 1) consists of Additive effect and Residual effecttr2="T2 = A + E"# "T2" (Trait 2) consists of Additive effect and Residual effect  ),# phe.var = list(tr1 = 100, tr2 = 100),phe.h2A=list(tr1=0.3,tr2=0.3),phe.corA=matrix(c(1,0.5,0.5,1),2,2)# Additive genetic correlation)# Run annotation simulationSP<- annotation(SP)# Run genotype simulationSP<- genotype(SP)# Run phenotype simulationSP<- phenotype(SP)

Generate phenotype controlled by QTNs subject to Geometric distribution

back to top

Geometric distribution is the probability of success for the first time obtained only after K trials among the N Bernoulli trials.Geometric distribution can be used as a QTN effect distribution. Phenotype controlled by QTNs subject toGeometric distribution in single-trait simulation is displayed as follows:
If users want to output files, please seeFile output.

# Generate annotation simulation parametersSP<- param.annot(pop.marker=1e4,qtn.num=list(tr1=10),qtn.model="A",qtn.dist=list(tr1="geom"),qtn.prob=list(tr1=0.5))# Generate genotype simulation parametersSP<- param.geno(SP=SP,pop.ind=1e2)# random genotype# Generate phenotype simulation parametersSP<- param.pheno(SP=SP,phe.model=list(tr1="T1 = A + E"),# "T1" (Trait 1) consists of Additive effect and Residual effect# phe.var = list(tr1 = 100),phe.h2A=list(tr1=0.3))# Run annotation simulationSP<- annotation(SP)# Run genotype simulationSP<- genotype(SP)# Run phenotype simulationSP<- phenotype(SP)

Phenotype controlled by QTNs subject toGeometric distribution in multiple-trait simulation is displayed as follows:
If users want to output files, please seeFile output.

# Generate annotation simulation parametersSP<- param.annot(pop.marker=1e4,qtn.num=list(tr1=10,tr2=10),qtn.model="A",qtn.dist=list(tr1="geom",tr2="geom"),qtn.prob=list(tr1=0.5,tr2=0.5))# Generate genotype simulation parametersSP<- param.geno(SP=SP,pop.ind=1e2)# random genotype# Generate phenotype simulation parametersSP<- param.pheno(SP=SP,phe.model=list(tr1="T1 = A + E",# "T1" (Trait 1) consists of Additive effect and Residual effecttr2="T2 = A + E"# "T2" (Trait 2) consists of Additive effect and Residual effect  ),# phe.var = list(tr1 = 100, tr2 = 100),phe.h2A=list(tr1=0.3,tr2=0.3),phe.corA=matrix(c(1,0.5,0.5,1),2,2)# Additive genetic correlation)# Run annotation simulationSP<- annotation(SP)# Run genotype simulationSP<- genotype(SP)# Run phenotype simulationSP<- phenotype(SP)

Generate phenotype controlled by QTNs subject to Gamma distribution

back to top

Gamma distribution is the sum of N independent exponential random variables. Note thatExponential distribution is a special form ofGamma distribution whenqtn.shape = 1 andqtn.scale = 1. Phenotype controlled by QTNs subject toGamma distribution in single-trait simulation is displayed as follows:
If users want to output files, please seeFile output.

# Generate annotation simulation parametersSP<- param.annot(pop.marker=1e4,qtn.num=list(tr1=10),qtn.model="A",qtn.dist=list(tr1="gamma"),qtn.shape=list(tr1=1),qtn.scale=list(tr1=1))# Generate genotype simulation parametersSP<- param.geno(SP=SP,pop.ind=1e2)# random genotype# Generate phenotype simulation parametersSP<- param.pheno(SP=SP,phe.model=list(tr1="T1 = A + E"),# "T1" (Trait 1) consists of Additive effect and Residual effect# phe.var = list(tr1 = 100),phe.h2A=list(tr1=0.3))# Run annotation simulationSP<- annotation(SP)# Run genotype simulationSP<- genotype(SP)# Run phenotype simulationSP<- phenotype(SP)

Phenotype controlled by QTNs subject toGamma distribution in multiple-trait simulation is displayed as follows:
If users want to output files, please seeFile output.

# Generate annotation simulation parametersSP<- param.annot(pop.marker=1e4,qtn.num=list(tr1=10,tr2=10),qtn.model="A",qtn.dist=list(tr1="gamma",tr2="gamma"),qtn.shape=list(tr1=1,tr2=1),qtn.scale=list(tr1=1,tr2=1))# Generate genotype simulation parametersSP<- param.geno(SP=SP,pop.ind=1e2)# random genotype# Generate phenotype simulation parametersSP<- param.pheno(SP=SP,phe.model=list(tr1="T1 = A + E",# "T1" (Trait 1) consists of Additive effect and Residual effecttr2="T2 = A + E"# "T2" (Trait 2) consists of Additive effect and Residual effect  ),# phe.var = list(tr1 = 100, tr2 = 100),phe.h2A=list(tr1=0.3,tr2=0.3),phe.corA=matrix(c(1,0.5,0.5,1),2,2)# Additive genetic correlation)# Run annotation simulationSP<- annotation(SP)# Run genotype simulationSP<- genotype(SP)# Run phenotype simulationSP<- phenotype(SP)

Generate phenotype controlled by QTNs subject to Beta distribution

back to top

Beta distribution is a density function of conjugate prior distribution as Bernoulli distribution and Binomial distribution. Phenotype controlled by QTNs subject to theBeta distribution in single-trait simulation is displayed as follows:
If users want to output files, please seeFile output.

# Generate annotation simulation parametersSP<- param.annot(pop.marker=1e4,qtn.num=list(tr1=10),qtn.model="A",qtn.dist=list(tr1="beta"),qtn.shape1=list(tr1=1),qtn.shape2=list(tr1=1),qtn.ncp=list(tr1=0))# Generate genotype simulation parametersSP<- param.geno(SP=SP,pop.ind=1e2)# random genotype# Generate phenotype simulation parametersSP<- param.pheno(SP=SP,phe.model=list(tr1="T1 = A + E"),# "T1" (Trait 1) consists of Additive effect and Residual effect# phe.var = list(tr1 = 100),phe.h2A=list(tr1=0.3))# Run annotation simulationSP<- annotation(SP)# Run genotype simulationSP<- genotype(SP)# Run phenotype simulationSP<- phenotype(SP)

Phenotype controlled by QTNs subject toBeta distribution in multiple-trait simulation is displayed as follows:
If users want to output files, please seeFile output.

# Generate annotation simulation parametersSP<- param.annot(pop.marker=1e4,qtn.num=list(tr1=10,tr2=10),qtn.model="A",qtn.dist=list(tr1="beta",tr2="beta"),qtn.shape1=list(tr1=1,tr2=1),qtn.shape2=list(tr1=1,tr2=1),qtn.ncp=list(tr1=0,tr2=0))# Generate genotype simulation parametersSP<- param.geno(SP=SP,pop.ind=1e2)# random genotype# Generate phenotype simulation parametersSP<- param.pheno(SP=SP,phe.model=list(tr1="T1 = A + E",# "T1" (Trait 1) consists of Additive effect and Residual effecttr2="T2 = A + E"# "T2" (Trait 2) consists of Additive effect and Residual effect  ),# phe.var = list(tr1 = 100, tr2 = 100),phe.h2A=list(tr1=0.3,tr2=0.3),phe.corA=matrix(c(1,0.5,0.5,1),2,2)# Additive genetic correlation)# Run annotation simulationSP<- annotation(SP)# Run genotype simulationSP<- genotype(SP)# Run phenotype simulationSP<- phenotype(SP)

Generate phenotype with fixed effect and covariate and environmental random effect

back to top

SIMER supports addingFixed effects,Covariates, andEnvironmentalRandom effects to a phenotype. Users should prepare a list of environmental factors setting.Fixed effects,Covariates , andEnvironmentalRandom effects are determined byeffect,slope, andratio respectively. A phenotype withFixed effect,Covariate, andEnvironmentalRandom effect in single-trait simulation is displayed as follows:
If users want to output files, please seeFile output.

# Prepare environmental factor listpop.env<-list(F1=list(# fixed effect 1level= c("1","2"),effect=list(tr1= c(50,30))  ),F2=list(# fixed effect 2level= c("d1","d2","d3"),effect=list(tr1= c(10,20,30))  ),C1=list(# covariate 1level= c(70,80,90),slope=list(tr1=1.5)  ),R1=list(# random effect 1level= c("l1","l2","l3"),ratio=list(tr1=0.1)  ))# Generate annotation simulation parametersSP<- param.annot(pop.marker=1e4,qtn.num=list(tr1=10),qtn.model="A")# Generate genotype simulation parametersSP<- param.geno(SP=SP,pop.ind=1e2)# random genotype# Generate phenotype simulation parametersSP<- param.pheno(SP=SP,pop.env=pop.env,phe.model=list(tr1="T1 = A + F1 + F2 + C1 + R1 + E"),# "T1" (Trait 1) consists of Additive effect, F1, F2, C1, R1, and Residual effect# phe.var = list(tr1 = 100),phe.h2A=list(tr1=0.3))# Run annotation simulationSP<- annotation(SP)# Run genotype simulationSP<- genotype(SP)# Run phenotype simulationSP<- phenotype(SP)

A phenotype withFixed effect,Covariate, andEnvironmentalRandom effect in multiple-trait simulation is displayed as follows:
If users want to output files, please seeFile output.

# Prepare environmental factor listpop.env<-list(F1=list(# fixed effect 1level= c("1","2"),effect=list(tr1= c(50,30),tr2= c(50,30))  ),F2=list(# fixed effect 2level= c("d1","d2","d3"),effect=list(tr1= c(10,20,30),tr2= c(10,20,30))  ),C1=list(# covariate 1level= c(70,80,90),slope=list(tr1=1.5,tr2=1.5)  ),R1=list(# random effect 1level= c("l1","l2","l3"),ratio=list(tr1=0.1,tr2=0.1)  ))# Generate annotation simulation parametersSP<- param.annot(pop.marker=1e4,qtn.num=list(tr1=10,tr2=10),qtn.model="A")# Generate genotype simulation parametersSP<- param.geno(SP=SP,pop.ind=1e2)# random genotype# Generate phenotype simulation parametersSP<- param.pheno(SP=SP,pop.env=pop.env,phe.model=list(tr1="T1 = A + F1 + F2 + C1 + R1 + E",# "T1" (Trait 1) consists of Additive effect, F1, F2, C1, R1, and Residual effecttr2="T2 = A + F1 + F2 + C1 + R1 + E"# "T2" (Trait 1) consists of Additive effect, F1, F2, C1, R1, and Residual effect  ),# phe.var = list(tr1 = 100, tr2 = 100),phe.h2A=list(tr1=0.3,tr2=0.3),phe.corA=matrix(c(1,0.5,0.5,1),2,2)# Additive genetic correlation)# Run annotation simulationSP<- annotation(SP)# Run genotype simulationSP<- genotype(SP)# Run phenotype simulationSP<- phenotype(SP)

Generate phenotype using GxE model

back to top

In a "GxE" model,SIMER adds aGenetic-Environmental interaction effect to the phenotype. Users should prepare theGeneticQTN effect in theAnnotation data and environmental factor bypop.env to generate aGenetic-EnvironmentalIndividual effect. An example of aGenetic-Environmental interaction in a single-trait simulation is displayed as follows:
If users want to output files, please seeFile output.

# Prepare environmental factor listpop.env<-list(F1=list(# fixed effect 1level= c("1","2"),effect=list(tr1= c(50,30))  ),F2=list(# fixed effect 2level= c("d1","d2","d3"),effect=list(tr1= c(10,20,30))  ),C1=list(# covariate 1level= c(70,80,90),slope=list(tr1=1.5)  ),R1=list(# random effect 1level= c("l1","l2","l3"),ratio=list(tr1=0.1)  ))# Generate annotation simulation parametersSP<- param.annot(pop.marker=1e4,qtn.num=list(tr1=10),qtn.model="A")# Additive effect# Generate genotype simulation parametersSP<- param.geno(SP=SP,pop.ind=1e2)# random genotype# Generate phenotype simulation parametersSP<- param.pheno(SP=SP,pop.env=pop.env,phe.model=list(tr1="T1 = A + F1 + F2 + C1 + R1 + A:F1 + E"# "T1" (Trait 1) consists of Additive effect, F1, F2, C1, R1, Additive-F1 interaction effect, and Residual effect  ),# phe.var = list(tr1 = 100),phe.h2A=list(tr1=0.3),phe.h2GxE=list(tr1=list("A:F1"=0.1)))# Run annotation simulationSP<- annotation(SP)# Run genotype simulationSP<- genotype(SP)# Run phenotype simulationSP<- phenotype(SP)

An example ofGenetic-Environmental interaction in multiple-trait simulation is displayed as follows:
If users want to output files, please seeFile output.

# Prepare environmental factor listpop.env<-list(F1=list(# fixed effect 1level= c("1","2"),effect=list(tr1= c(50,30),tr2= c(50,30))  ),F2=list(# fixed effect 2level= c("d1","d2","d3"),effect=list(tr1= c(10,20,30),tr2= c(10,20,30))  ),C1=list(# covariate 1level= c(70,80,90),slope=list(tr1=1.5,tr2=1.5)  ),R1=list(# random effect 1level= c("l1","l2","l3"),ratio=list(tr1=0.1,tr2=0.1)  ))# Generate annotation simulation parametersSP<- param.annot(pop.marker=1e4,qtn.num=list(tr1=10,tr2=10),qtn.model="A")# Additive effect# Generate genotype simulation parametersSP<- param.geno(SP=SP,pop.ind=1e2)# random genotype# Generate phenotype simulation parametersSP<- param.pheno(SP=SP,pop.env=pop.env,phe.model=list(tr1="T1 = A + F1 + F2 + C1 + R1 + A:F1 + E",# "T1" (Trait 1) consists of Additive effect, F1, F2, C1, R1, Additive-F1 interaction effect, and Residual effecttr2="T2 = A + F1 + F2 + C1 + R1 + A:F1 + E"# "T2" (Trait 2) consists of Additive effect, F1, F2, C1, R1, Additive-F1 interaction effect, and Residual effect  ),# phe.var = list(tr1 = 100, tr2 = 100),phe.h2A=list(tr1=0.3,tr2=0.3),phe.h2GxE=list(tr1=list("A:F1"=0.1),tr2=list("A:F1"=0.1)),phe.corA=matrix(c(1,0.5,0.5,1),2,2)# Additive genetic correlation)# Run annotation simulationSP<- annotation(SP)# Run genotype simulationSP<- genotype(SP)# Run phenotype simulationSP<- phenotype(SP)

Generate phenotype using ExE model

back to top

In an "ExE" model,SIMER addsEnvironmental-Environmental interaction effect to phenotype. Users should prepare environmental factor bypop.env for generatingEnvironmental-EnvironmentalIndividual effect. An example ofEnvironmental-Environmental interaction in single-trait simulation is displayed as follows:
If users want to output files, please seeFile output.

# Prepare environmental factor listpop.env<-list(F1=list(# fixed effect 1level= c("1","2"),effect=list(tr1= c(50,30))  ),F2=list(# fixed effect 2level= c("d1","d2","d3"),effect=list(tr1= c(10,20,30))  ),C1=list(# covariate 1level= c(70,80,90),slope=list(tr1=1.5)  ),R1=list(# random effect 1level= c("l1","l2","l3"),ratio=list(tr1=0.1)  ))# Generate annotation simulation parametersSP<- param.annot(pop.marker=1e4,qtn.num=list(tr1=10),qtn.model="A")# Additive effect# Generate genotype simulation parametersSP<- param.geno(SP=SP,pop.ind=1e2)# random genotype# Generate phenotype simulation parametersSP<- param.pheno(SP=SP,pop.env=pop.env,phe.model=list(tr1="T1 = A + F1 + F2 + C1 + R1 + F1:R1 + E"# "T1" (Trait 1) consists of Additive effect, F1, F2, C1, R1, F1-R1 interaction effect, and Residual effect  ),# phe.var = list(tr1 = 100),phe.h2A=list(tr1=0.3),phe.h2GxE=list(tr1=list("F1:R1"=0.1)))# Run annotation simulationSP<- annotation(SP)# Run genotype simulationSP<- genotype(SP)# Run phenotype simulationSP<- phenotype(SP)

An example ofEnvironmental-Environmental interaction in multiple-trait simulation is displayed as follows:
If users want to output files, please seeFile output.

# Prepare environmental factor listpop.env<-list(F1=list(# fixed effect 1level= c("1","2"),effect=list(tr1= c(50,30),tr2= c(50,30))  ),F2=list(# fixed effect 2level= c("d1","d2","d3"),effect=list(tr1= c(10,20,30),tr2= c(10,20,30))  ),C1=list(# covariate 1level= c(70,80,90),slope=list(tr1=1.5,tr2=1.5)  ),R1=list(# random effect 1level= c("l1","l2","l3"),ratio=list(tr1=0.1,tr2=0.1)  ))# Generate annotation simulation parametersSP<- param.annot(pop.marker=1e4,qtn.num=list(tr1=10,tr2=10),qtn.model="A")# Additive effect# Generate genotype simulation parametersSP<- param.geno(SP=SP,pop.ind=1e2)# random genotype# Generate phenotype simulation parametersSP<- param.pheno(SP=SP,pop.env=pop.env,phe.model=list(tr1="T1 = A + F1 + F2 + C1 + R1 + F1:R1 + E",# "T1" (Trait 1) consists of Additive effect, F1, F2, C1, R1, F1:R1 interaction effect, and Residual effecttr2="T2 = A + F1 + F2 + C1 + R1 + F1:R1 + E"# "T2" (Trait 2) consists of Additive effect, F1, F2, C1, R1, F1:R1 interaction effect, and Residual effect  ),# phe.var = list(tr1 = 100, tr2 = 100),phe.h2A=list(tr1=0.3,tr2=0.3),phe.h2GxE=list(tr1=list("F1:R1"=0.1),tr2=list("F1:R1"=0.1)),phe.corA=matrix(c(1,0.5,0.5,1),2,2)# Additive genetic correlation)# Run annotation simulationSP<- annotation(SP)# Run genotype simulationSP<- genotype(SP)# Run phenotype simulationSP<- phenotype(SP)

Generate phenotype controlled by varied QTN effect distribution

back to top

In the single-trait simulation, the trait can be controlled byvaried QTN effect distribution. An example of the single-trait controlled by two-group QTNs is displayed as follows:
If users want to output files, please seeFile output.

# Generate annotation simulation parametersSP<- param.annot(pop.marker=1e4,qtn.num=list(tr1= c(2,8)),# Group1: 2 QTNs; Group 2: 8 QTNsqtn.dist=list(tr1= c("norm","norm")),qtn.var=list(tr1= c(0.01,0.01)),# Group1: genetic variance of QTNs = 0.01; Group2: genetic variance of QTNs = 0.01qtn.model="A")# Generate genotype simulation parametersSP<- param.geno(SP=SP,pop.ind=1e2)# random genotype# Generate phenotype simulation parametersSP<- param.pheno(SP=SP,phe.model=list(tr1="T1 = A + E"),# "T1" (Trait 1) consists of Additive effect and Residual effect# phe.var = list(tr1 = 100),phe.h2A=list(tr1=0.3))# Run annotation simulationSP<- annotation(SP)# Run genotype simulationSP<- genotype(SP)# Run phenotype simulationSP<- phenotype(SP)

An example of the multiple-trait controlled by two-group QTNs is displayed as follows:
If users want to output files, please seeFile output.

# Generate annotation simulation parametersSP<- param.annot(pop.marker=1e4,qtn.num=list(tr1= c(2,8),tr2= c(2,8)),# Group1: 2 QTNs; Group 2: 8 QTNsqtn.dist=list(tr1= c("norm","norm"),tr2= c("norm","norm")),qtn.var=list(tr1= c(0.01,0.01),tr2= c(0.01,0.01)),# Group1: genetic variance of QTNs = 0.01; Group2: genetic variance of QTNs = 0.01qtn.model="A")# Generate genotype simulation parametersSP<- param.geno(SP=SP,pop.ind=1e2)# random genotype# Generate phenotype simulation parametersSP<- param.pheno(SP=SP,phe.model=list(tr1="T1 = A + E",# "T1" (Trait 1) consists of Additive effect and Residual effecttr2="T2 = A + E"# "T2" (Trait 2) consists of Additive effect and Residual effect  ),# phe.var = list(tr1 = 100, tr2 = 100),phe.h2A=list(tr1=0.3,tr2=0.3),phe.corA=matrix(c(1,0.5,0.5,1),2,2)# Additive genetic correlation)# Run annotation simulationSP<- annotation(SP)# Run genotype simulationSP<- genotype(SP)# Run phenotype simulationSP<- phenotype(SP)

Population Simulation of Multiple-Generation with Genotype and Phenotype

back to top

SIMER imitates the reproductive process of organisms to generate aMultiple-Generation population. Thegenotype data andphenotype data of the population are screened bysingle-trait selection ormultiple-trait selection, and then those data are amplified byspecies-specific reproduction.

Gallery of population simulation parameters

back to top

selects, main function ofSelection:

ParamaterDefaultOptionsDescription
pop.selNULLlistthe selected males and females.
psc(0.8, 0.8)num vectorif ps <= 1, fraction selected in selection of males and females; if ps > 1, ps is number of selected males and females.
decrTRUETRUE or FALSEwhether the sort order is decreasing.
sel.crit"pheno"characterthe selection criteria, it can be "TBV", "TGV", and "pheno".
sel.single"ind"characterthe single-trait selection method, it can be "ind", "fam", "infam", and "comb".
sel.multi"index"characterthe multiple-trait selection method, it can be "index", "indcul", and "tmd".
index.wtc(0.5, 0.5)num vectorthe weight of each trait for multiple-trait selection.
index.tdm1numthe index of tandem selection for multiple-trait selection.
goal.perc0.1numthe percentage of goal more than the mean of scores of individuals.
pass.perc0.9numthe percentage of expected excellent individuals.

reproduces, main function ofReproduction:

ParamaterDefaultOptionsDescription
pop.gen1numthe generations of simulated population.
reprod.way"randmate"characterreproduction method, it consists of "clone", "dh", "selfpol", "randmate", "randexself", "assort", "disassort", "2waycro", "3waycro", "4waycro", "backcro", and "userped".
sex.rate0.5numthe male rate in the population.
prog2numthe progeny number of an individual.

Individual selection for a single trait

back to top

Individual selection is a selection method based on thephenotype of individual traits, which is also known as mixed selection or collective selection. This selection method is simple and easy to use for traits withhigh heritability.
If users want to output files, please seeFile output.

# Generate annotation simulation parametersSP<- param.annot(pop.marker=1e4)# Generate genotype simulation parametersSP<- param.geno(SP=SP,pop.ind=1e2)# Generate phenotype simulation parametersSP<- param.pheno(SP=SP,phe.h2A=list(tr1=0.3))# Generate selection parametersSP<- param.sel(SP=SP,sel.single="ind")SP$global$pop.gen<-2# Run annotation simulationSP<- annotation(SP)# Run genotype simulationSP<- genotype(SP)# Run phenotype simulationSP<- phenotype(SP)# Run selectionSP<- selects(SP)

Family selection for a single trait

back to top

Family selection is a selection method by family based on theaverage of the family. This selection method is used for traits withlow heritability.
If users want to output files, please seeFile output.

# Generate annotation simulation parametersSP<- param.annot(pop.marker=1e4)# Generate genotype simulation parametersSP<- param.geno(SP=SP,pop.ind=1e2)# Generate phenotype simulation parametersSP<- param.pheno(SP=SP,phe.h2A=list(tr1=0.3))# Generate selection parametersSP<- param.sel(SP=SP,sel.single="fam")SP$global$pop.gen<-2# Run annotation simulationSP<- annotation(SP)# Run genotype simulationSP<- genotype(SP)# Run phenotype simulationSP<- phenotype(SP)# Run selectionSP<- selects(SP)

Within-family selection for a single trait

back to top

Within-family selection is a selection method based on thedeviation of individual phenotype and family mean value in each family. This selection method is used for traits withlow heritability and small families.
If users want to output files, please seeFile output.

# Generate annotation simulation parametersSP<- param.annot(pop.marker=1e4)# Generate genotype simulation parametersSP<- param.geno(SP=SP,pop.ind=1e2)# Generate phenotype simulation parametersSP<- param.pheno(SP=SP,phe.h2A=list(tr1=0.3))# Generate selection parametersSP<- param.sel(SP=SP,sel.single="infam")SP$global$pop.gen<-2# Run annotation simulationSP<- annotation(SP)# Run genotype simulationSP<- genotype(SP)# Run phenotype simulationSP<- phenotype(SP)# Run selectionSP<- selects(SP)

Combined selection for a single trait

back to top

Combined selection is a selection method based onweighed combination of the deviation of individual phenotype and family mean value.
If users want to output files, please seeFile output.

# Generate annotation simulation parametersSP<- param.annot(pop.marker=1e4)# Generate genotype simulation parametersSP<- param.geno(SP=SP,pop.ind=1e2)# Generate phenotype simulation parametersSP<- param.pheno(SP=SP,phe.h2A=list(tr1=0.3))# Generate selection parametersSP<- param.sel(SP=SP,sel.single="comb")SP$global$pop.gen<-2# Run annotation simulationSP<- annotation(SP)# Run genotype simulationSP<- genotype(SP)# Run phenotype simulationSP<- phenotype(SP)# Run selectionSP<- selects(SP)

Tandem selection for multiple traits

back to top

Tandem selection is a method forsequentially selecting a plurality of target traits one by one. The index of the selected trait isindex.tdm and this parameter shouldnot be controlled by Users.
If users want to output files, please seeFile output.

# Generate annotation simulation parametersSP<- param.annot(pop.marker=1e4,qtn.num=list(tr1=10,tr2=10))# Generate genotype simulation parametersSP<- param.geno(SP=SP,pop.ind=1e2)# Generate phenotype simulation parametersSP<- param.pheno(SP=SP,# phe.var = list(tr1 = 100, tr2 = 100),phe.model=list(tr1="T1 = A + E",tr2="T2 = A + E"  ))# Generate selection parametersSP<- param.sel(SP=SP,sel.multi="tdm")SP$global$pop.gen<-2# Run annotation simulationSP<- annotation(SP)# Run genotype simulationSP<- genotype(SP)# Run phenotype simulationSP<- phenotype(SP)# Run selectionSP<- selects(SP)

Independent culling selection for multiple traits

back to top

Set aminimum selection criterion for each target trait. Then aIndependent culling selection willeliminate this individual when the candidate's performance on any trait islower than the corresponding criteria.
If users want to output files, please seeFile output.

# Generate annotation simulation parametersSP<- param.annot(pop.marker=1e4,qtn.num=list(tr1=10,tr2=10))# Generate genotype simulation parametersSP<- param.geno(SP=SP,pop.ind=1e2)# Generate phenotype simulation parametersSP<- param.pheno(SP=SP,# phe.var = list(tr1 = 100, tr2 = 100),phe.model=list(tr1="T1 = A + E",tr2="T2 = A + E"  ))# Generate selection parametersSP<- param.sel(SP=SP,sel.multi="indcul")SP$global$pop.gen<-2# Run annotation simulationSP<- annotation(SP)# Run genotype simulationSP<- genotype(SP)# Run phenotype simulationSP<- phenotype(SP)# Run selectionSP<- selects(SP)

Index selection for multiple traits

back to top

Index selection is a comprehensive selection that will consider several traits based on their respectiveheritabilities,phenotypic variances,economic weights, correspondinggenetic correlations, andphenotypes. Then,SIMER calculates theindex value of each trait, eliminates it, or selects it according to its level. Users can set the weight of each trait atindex.wt.
If users want to output files, please seeFile output.

# Generate annotation simulation parametersSP<- param.annot(pop.marker=1e4,qtn.num=list(tr1=10,tr2=10))# Generate genotype simulation parametersSP<- param.geno(SP=SP,pop.ind=1e2)# Generate phenotype simulation parametersSP<- param.pheno(SP=SP,# phe.var = list(tr1 = 100, tr2 = 100),phe.model=list(tr1="T1 = A + E",tr2="T2 = A + E"  ))# Generate selection parametersSP<- param.sel(SP=SP,sel.multi="index")SP$global$pop.gen<-2# Run annotation simulationSP<- annotation(SP)# Run genotype simulationSP<- genotype(SP)# Run phenotype simulationSP<- phenotype(SP)# Run selectionSP<- selects(SP)

Clone for plants

back to top

Clone is a sexual reproduction method that does not involve germ cells and does not require a process of fertilization, but directly forms a new individual's reproductive mode from a part of the mother.Sex of offspring will be0 in theclone.
If users want to output files, please seeFile output.

# Generate annotation simulation parametersSP<- param.annot(pop.marker=1e4)# Generate genotype simulation parametersSP<- param.geno(SP=SP,pop.ind=1e2)# Generate phenotype simulation parametersSP<- param.pheno(SP=SP,phe.h2A=list(tr1=0.3))# Generate selection parametersSP<- param.sel(SP=SP,sel.single="ind")# Generate reproduction parametersSP<- param.reprod(SP=SP,reprod.way="clone",pop.gen=2)# Run annotation simulationSP<- annotation(SP)# Run genotype simulationSP<- genotype(SP)# Run phenotype simulationSP<- phenotype(SP)# Run selectionSP<- selects(SP)# Run reproductionSP<- reproduces(SP)

Doubled haploid for plants

back to top

Doubled haploid is a reproduction method for breeding workers to obtain haploid plants. It induces a doubling of the number of chromosomes and restores the number of chromosomes in normal plants.Sex of offspring will be0 indh.
If users want to output files, please seeFile output.

# Generate annotation simulation parametersSP<- param.annot(pop.marker=1e4)# Generate genotype simulation parametersSP<- param.geno(SP=SP,pop.ind=1e2)# Generate phenotype simulation parametersSP<- param.pheno(SP=SP,phe.h2A=list(tr1=0.3))# Generate selection parametersSP<- param.sel(SP=SP,sel.single="ind")# Generate reproduction parametersSP<- param.reprod(SP=SP,reprod.way="dh",pop.gen=2)# Run annotation simulationSP<- annotation(SP)# Run genotype simulationSP<- genotype(SP)# Run phenotype simulationSP<- phenotype(SP)# Run selectionSP<- selects(SP)# Run reproductionSP<- reproduces(SP)

Self-pollination for plants and micro-organisms

back to top

Self-pollination refers to the combination of male and female gametes from the same individual or between individuals from the same clonal breeding line.Sex of offspring will be0 inselfpol.
If users want to output files, please seeFile output.

# Generate annotation simulation parametersSP<- param.annot(pop.marker=1e4)# Generate genotype simulation parametersSP<- param.geno(SP=SP,pop.ind=1e2)# Generate phenotype simulation parametersSP<- param.pheno(SP=SP,phe.h2A=list(tr1=0.3))# Generate selection parametersSP<- param.sel(SP=SP,sel.single="ind")# Generate reproduction parametersSP<- param.reprod(SP=SP,reprod.way="selfpol",pop.gen=2)# Run annotation simulationSP<- annotation(SP)# Run genotype simulationSP<- genotype(SP)# Run phenotype simulationSP<- phenotype(SP)# Run selectionSP<- selects(SP)# Run reproductionSP<- reproduces(SP)

Random mating for plants and animals

back to top

Inrandom mating, any female or male individual has the same probability to mate with any member of opposite sex in a sexually reproducing organism.Sex of offspring in random mating is controlled bysex.ratio inrandmate.
If users want to output files, please seeFile output.

# Generate annotation simulation parametersSP<- param.annot(pop.marker=1e4)# Generate genotype simulation parametersSP<- param.geno(SP=SP,pop.ind=1e2)# Generate phenotype simulation parametersSP<- param.pheno(SP=SP,phe.h2A=list(tr1=0.3))# Generate selection parametersSP<- param.sel(SP=SP,sel.single="ind")# Generate reproduction parametersSP<- param.reprod(SP=SP,reprod.way="randmate",pop.gen=2)# Run annotation simulationSP<- annotation(SP)# Run genotype simulationSP<- genotype(SP)# Run phenotype simulationSP<- phenotype(SP)# Run selectionSP<- selects(SP)# Run reproductionSP<- reproduces(SP)

Random mating excluding self-pollination for animals

back to top

Inrandom mating excluding self-pollination, an individual cannot mate with itself.Sex of offspring in random mating is controlled bysex.ratio inrandexself.
If users want to output files, please seeFile output.

# Generate annotation simulation parametersSP<- param.annot(pop.marker=1e4)# Generate genotype simulation parametersSP<- param.geno(SP=SP,pop.ind=1e2)# Generate phenotype simulation parametersSP<- param.pheno(SP=SP,phe.h2A=list(tr1=0.3))# Generate selection parametersSP<- param.sel(SP=SP,sel.single="ind")# Generate reproduction parametersSP<- param.reprod(SP=SP,reprod.way="randexself",pop.gen=2)# Run annotation simulationSP<- annotation(SP)# Run genotype simulationSP<- genotype(SP)# Run phenotype simulationSP<- phenotype(SP)# Run selectionSP<- selects(SP)# Run reproductionSP<- reproduces(SP)

Assortative mating for plants and animals

back to top

Inassortative mating, mated pairs are of the same phenotype more often than would occur by chance.Sex of offspring in assortative mating is controlled bysex.ratio inassort.
If users want to output files, please seeFile output.

# Generate annotation simulation parametersSP<- param.annot(pop.marker=1e4)# Generate genotype simulation parametersSP<- param.geno(SP=SP,pop.ind=1e2)# Generate phenotype simulation parametersSP<- param.pheno(SP=SP,phe.h2A=list(tr1=0.3))# Generate selection parametersSP<- param.sel(SP=SP,sel.single="ind")# Generate reproduction parametersSP<- param.reprod(SP=SP,reprod.way="assort",pop.gen=2)# Run annotation simulationSP<- annotation(SP)# Run genotype simulationSP<- genotype(SP)# Run phenotype simulationSP<- phenotype(SP)# Run selectionSP<- selects(SP)# Run reproductionSP<- reproduces(SP)

Disassortative mating for plants and animals

back to top

Indisassortative mating, mated pairs are of the same phenotype less often than would occur by chance.Sex of offspring in disassortative mating is controlled bysex.ratio indisassort.
If users want to output files, please seeFile output.

# Generate annotation simulation parametersSP<- param.annot(pop.marker=1e4)# Generate genotype simulation parametersSP<- param.geno(SP=SP,pop.ind=1e2)# Generate phenotype simulation parametersSP<- param.pheno(SP=SP,phe.h2A=list(tr1=0.3))# Generate selection parametersSP<- param.sel(SP=SP,sel.single="ind")# Generate reproduction parametersSP<- param.reprod(SP=SP,reprod.way="disassort",pop.gen=2)# Run annotation simulationSP<- annotation(SP)# Run genotype simulationSP<- genotype(SP)# Run phenotype simulationSP<- phenotype(SP)# Run selectionSP<- selects(SP)# Run reproductionSP<- reproduces(SP)

Two-way cross for animals

back to top

TheTwo-way cross method needs to usesex to distinguishtwo different breeds, in which thefirst breed issire and thesecond breed isdam.
If users want to output files, please seeFile output.

# Generate annotation simulation parametersSP<- param.annot(pop.marker=1e4)# Generate genotype simulation parametersSP<- param.geno(SP=SP,pop.ind=1e2)# Generate phenotype simulation parametersSP<- param.pheno(SP=SP,phe.h2A=list(tr1=0.3))# Generate selection parametersSP<- param.sel(SP=SP,sel.single="ind")# Generate reproduction parametersSP<- param.reprod(SP=SP,reprod.way="2waycro")# Run annotation simulationSP<- annotation(SP)# Run genotype simulationSP<- genotype(SP)# Run phenotype simulationSP<- phenotype(SP)# Two different breeds are cut by sexSP$pheno$pop$gen1$sex<- rep(c(1,2), c(50,50))# Run selectionSP<- selects(SP)# Run reproductionSP<- reproduces(SP)

Three-way cross for animals

back to top

TheThree-way cross method needs to usesex to distinguishthree different breeds, in which thefirst breed issire and thesecond breed isdam in thefirst two-way cross, and thethird breed is terminalsire.
If users want to output files, please seeFile output.

# Generate annotation simulation parametersSP<- param.annot(pop.marker=1e4)# Generate genotype simulation parametersSP<- param.geno(SP=SP,pop.ind=1e2)# Generate phenotype simulation parametersSP<- param.pheno(SP=SP,phe.h2A=list(tr1=0.3))# Generate selection parametersSP<- param.sel(SP=SP,sel.single="ind")# Generate reproduction parametersSP<- param.reprod(SP=SP,reprod.way="3waycro")# Run annotation simulationSP<- annotation(SP)# Run genotype simulationSP<- genotype(SP)# Run phenotype simulationSP<- phenotype(SP)# Three different breeds are cut by sexSP$pheno$pop$gen1$sex<- rep(c(1,2,1), c(30,30,40))# Run selectionSP<- selects(SP)# Run reproductionSP<- reproduces(SP)

Four-way cross for animals

back to top

TheFour-way cross method needs to usesex to distinguishfour different breeds, in which thefirst breed issire and thesecond breed isdam in thefirst two-way cross, thethird breed issire and thefourth breed isdam in thesecond two-way cross.
If users want to output files, please seeFile output.

# Generate annotation simulation parametersSP<- param.annot(pop.marker=1e4)# Generate genotype simulation parametersSP<- param.geno(SP=SP,pop.ind=1e2)# Generate phenotype simulation parametersSP<- param.pheno(SP=SP,phe.h2A=list(tr1=0.3))# Generate selection parametersSP<- param.sel(SP=SP,sel.single="ind")# Generate reproduction parametersSP<- param.reprod(SP=SP,reprod.way="4waycro")# Run annotation simulationSP<- annotation(SP)# Run genotype simulationSP<- genotype(SP)# Run phenotype simulationSP<- phenotype(SP)# Four different breeds are cut by sexSP$pheno$pop$gen1$sex<- rep(c(1,2,1,2), c(25,25,25,25))# Run selectionSP<- selects(SP)# Run reproductionSP<- reproduces(SP)

Back cross for animal

back to top

TheBack cross method needs to usesex to distinguishtwo different breeds, in which thefirst breed is alwayssire in each generation and thesecond breed isdam in thefirst two-way cross.
If users want to output files, please seeFile output.

# Generate annotation simulation parametersSP<- param.annot(pop.marker=1e4)# Generate genotype simulation parametersSP<- param.geno(SP=SP,pop.ind=1e2)# Generate phenotype simulation parametersSP<- param.pheno(SP=SP,phe.h2A=list(tr1=0.3))# Generate selection parametersSP<- param.sel(SP=SP,sel.single="ind")# Generate reproduction parametersSP<- param.reprod(SP=SP,reprod.way="backcro",pop.gen=2)# Run annotation simulationSP<- annotation(SP)# Run genotype simulationSP<- genotype(SP)# Run phenotype simulationSP<- phenotype(SP)# Two different breeds are cut by sexSP$pheno$pop$gen1$sex<- rep(c(1,2), c(50,50))# Run selectionSP<- selects(SP)# Run reproductionSP<- reproduces(SP)

User-designed pedigree mating for plants and animals

back to top

User-designed pedigree mating needs a specificuser-designed pedigree to control the mating process. The first column issample id, the second column ispaternal id, and the third column ismaternal id. Please make sure thatpaternal id andmaternal id can match the genotype data.
If users want to output files, please seeFile output.

# Generate annotation simulation parametersSP<- param.annot(pop.marker=1e4)# Generate genotype simulation parametersSP<- param.geno(SP=SP,pop.ind=1e2)# Generate phenotype simulation parametersSP<- param.pheno(SP=SP,phe.h2A=list(tr1=0.3))# Generate reproduction parametersSP<- param.reprod(SP=SP,reprod.way="userped")# Run annotation simulationSP<- annotation(SP)# Run genotype simulationSP<- genotype(SP)# Run phenotype simulationSP<- phenotype(SP)# Run reproductionSP<- reproduces(SP)

AN EASY WAY TO GENERATE A POPULATION

back to top

The above methods are to generate populationsstep by step, which areeasy to understand. Actually,SIMER can generate a population directly in aMORE CONVENIENT way.param.simer will callparam.annot,param.geno,param.pheno,param.sel, andparam.reprod, so users can directly pass all parameters intoparam.simer, or pass the generatedSP intoparam.simer.simer will callannotation, genotype,phenotype,selects, andreproduces, so users can directly usesimer to replace the above sub functions.
If users want to output files, please seeFile output.

# Generate all simulation parametersSP<- param.simer(qtn.num=list(tr1=10),pop.marker=1e4,pop.ind=1e2,pop.gen=2,sel.single="ind",reprod.way="randmate")# Run SimerSP<- simer(SP)

Breeding Program Design

back to top

After generating a population, further work can be done. Breeders wish to evaluate theirBreeding Program Design. To save money and time,SIMER can assist breeders to evaluate theirBreeding Program Design by simulation.

Gallery of breeding program design parameters

back to top

simer.Data.Json, main function ofBreeding Program Design:

ParamaterDefaultOptionsDescription
jsonFileNULLcharacterthe path of JSON file.
hiblupPath""characterthe path of HIBLUP software.
out"simer.qc"characterthe prefix of output files.
dataQCTRUETRUE or FALSEwhether to make data quality control.
buildModelTRUETRUE or FALSEwhether to build EBV model.
buildIndexTRUETRUE or FALSEwhether to build Selection Index.
ncpus10numthe number of threads used, if it is 0, (logical core number - 1) is automatically used.
verboseTRUETRUE or FALSEwhether to print detail.

Definition of a breeding program design

back to top

Breeding program design should be stored on aJSON file.

definition.json

genotype: the absolute path or relative path to JSON file of genotype data
pedigree: the filename with absolute path or relative path to JSON file of pedigree data
selection_index: the economic weight of phenotype for each trait
threads: the threads number used in multiple threads computation
genetic_progress: the genetic progress of a breeding plan
breeding_value_index: the economic weight of breeding value for each trait
auto_optimization: optimizing EBV estimated model and selection index automatically
quality_control_plan: the quality control plan for genotype, pedigree, and phenotype

genotype_quality_control: the quality control plan for genotype

filter: the "filter" (individual) condition for genotyped individual
filter_geno: the genotype missing rate filter
filter_mind: the sample missing rate filter
filter_maf: the Minor Allele Frequency filter
filter_hwe: the Hardy-Weinberg Equilibrium filter

pedigree_quality_control: the quality control plan for pedigree

standard_ID: whether ID is standard 15-digit ID
candidate_sire_file: the filename of candidate sire
candidate_dam_file: the filename of candidate dam
exclude_threshold: if the number of base error is more than this threshold, this individual will be excluded
assign_threshold: if the number of base error is less than this threshold, this parent will be assigned to this individual

phenotype_quality_control: the quality control plan for phenotype

job_name: the name of the phenotype quality control job
sample_info: the filename with absolute path or relative path to JSON file of phenotype data
repeated_records: whether phenotype data contains repeated records
multi_trait: whether phenotype data contains multiple traits
filter: the "filter" (individual) condition for phenotyped individual
select: the "select" (trait) condition for phenotyped individual
arrange: the "arrange" (order) condition for phenotyped individual
job_traits: the trait need quality control and its definition and range

breeding_plan: the genetic evaluation plan

job_name: the name of the genetic evaluation job
sample_info: the filename with absolute path or relative path to JSON file of phenotype data
repeated_records: whether phenotype data contains repeated records
multi_trait: whether phenotype data contains multiple traits
vc_vars: the filename of variance component data
vc_covars: the filename of covariance component data
random_ratio: the least random effect variance ratio to phenotype variance
job_traits: the trait need analysis and its covariate, fixed effect, and random effect

Data quality control

back to top

Data quality is an important factor affecting the accuracy of genetic assessment. Therefore,SIMER provides quality control functions for pedigree, genotype, and phenotype data. The design of the data quality control plan is saved in a JSON file:

{"genotype":"../02plinkb","pedigree":"../05others/pedigree.txt","threads":16,"quality_control_plan": {"genotype_quality_control":{"filter":"F1 == 'Male'","filter_geno":0.1,"filter_mind":0.1,"filter_maf":0.05,"filter_hwe":0.001        },"pedigree_quality_control":{"standard_ID":false,"candidate_sire_file": [],"candidate_dam_file": [],"exclude_threshold":0.1,"assign_threshold":0.05        },"phenotype_quality_control":[            {"job_name":"Data_Quality_Control_Demo","sample_info":"../05others/phenotype.txt","repeated_records":false,"multi_trait":true,"filter":"F1 == 'Male'","job_traits": [                    {"traits":"T1","definition":"T1","range": []                    },                    {"traits":"T2","definition":"T2","range": []                    }                ]            }        ]    }}

Running the data quality control plan process only requires two steps, the first step is to read in the JSON file path, and the second step is to usesimer.Data.Json to read in a JSON file. It should be noted that users need to setbuildModel andbuildIndex to FALSE to ensure thatSIMER only runs data quality control processes.

# Get JSON filejsonFile<- system.file("extdata","04breeding_plan","plan1.json",package="simer")# It needs "plink" and "hiblup" softwarejsonList<- simer.Data.Json(jsonFile=jsonFile,dataQC=TRUE,buildModel=FALSE,buildIndex=FALSE)

Model optimization

back to top

In addition to data quality, a suitable breeding value evaluation model is another important factor that affects the accuracy of genetic evaluation. Whenauto_optization is true,SIMER will optimize the environmental factors in the breeding value evaluation model, namely covariates, fixed effects, and random effects. The covariates and fixed effects will be optimized using a multi-step regression method combined with BIC (Bayesian Information Criterion) (the lower the BIC value, the better the model fitting effect), while the random effects will be optimized using the variance component method, which only retains random effects with a variance to phenotype variance ratio greater thanrandom_ratio (the larger the variance to phenotype ratio, the more important the random effect). Whenauto_optization is false,SIMER will directly use the covariates, fixed effects, and random effects provided by the user as the optimal combination of environmental factors. The design of the model optimization plan is saved in a JSON file:

{"genotype":"../02plinkb","pedigree":"../05others/pedigree.txt","threads":16,"auto_optimization":true,"quality_control_plan": {"genotype_quality_control":{"filter":"F1 == 'Male'","filter_geno":0.1,"filter_mind":0.1,"filter_maf":0.05,"filter_hwe":0.001        },"pedigree_quality_control":{"standard_ID":false,"candidate_sire_file": [],"candidate_dam_file": [],"exclude_threshold":0.1,"assign_threshold":0.05        },"phenotype_quality_control":[            {"job_name":"Data_Quality_Control_Demo","sample_info":"../05others/phenotype.txt","repeated_records":false,"multi_trait":true,"filter":"F1 == 'Male'","job_traits": [                    {"traits":"T1","definition":"T1","range": []                    },                    {"traits":"T2","definition":"T2","range": []                    }                ]            }        ]    },"breeding_plan":[        {"job_name":"EBV_Model_Demo","sample_info":"../05others/phenotype.txt","repeated_records":false,"multi_trait":true,"vc_vars": [],"vc_covars": [],"random_ratio":0.05,"job_traits": [                {"traits":"T1","covariates": [],"fixed_effects": ["F1","F2"],"random_effects": ["R1"]                },                {"traits":"T2","covariates": [],"fixed_effects": ["F1","F2"],"random_effects": ["R1"]                }            ]        }    ]}

Running the breeding value evaluation model planning process only requires two steps, the first step is to read in the JSON file path, and the second step is to usesimer.Data.Json reads in a JSON file. It should be noted that users need to setbuildIndex to FALSE to ensure thatSIMER only runs the data quality control process and genetic evaluation process.

# Get JSON filejsonFile<- system.file("extdata","04breeding_plan","plan2.json",package="simer")# It needs "plink" and "hiblup" softwarejsonList<- simer.Data.Json(jsonFile=jsonFile,dataQC=TRUE,buildModel=TRUE,buildIndex=FALSE)

Construction of selection index

back to top

In multiple-trait breeding, constructing an appropriate multiple-trait selection index is a powerful means to improve the accuracy of overall genetic evaluation.SIMER adopts the general selection index method as the core algorithm for constructing multiple-trait selection indices. Whenauto_optization is set to true, users only need to provide the economic weight of the breeding value of each trait,breeding-value_index, andSIMER will automatically calculate the appropriate multiple-trait selection index,selection_index. In the case whereauto_optization is false,SIMER will consider theselection_index provided by the user as the optimal multiple-trait selection index. The design of the multiple-trait selection index plan is saved in a JSON file:

{"genotype":"../02plinkb","pedigree":"../05others/pedigree.txt","selection_index":"100 - 0.2 * T1 + 0.8 * T2","threads":16,"genetic_progress": [],"breeding_value_index":"-0.2 * T1 + 0.8 * T2","auto_optimization":true,"quality_control_plan": {"genotype_quality_control":{"filter":"F1 == 'Male'","filter_geno":0.1,"filter_mind":0.1,"filter_maf":0.05,"filter_hwe":0.001        },"pedigree_quality_control":{"standard_ID":false,"candidate_sire_file": [],"candidate_dam_file": [],"exclude_threshold":0.1,"assign_threshold":0.05        },"phenotype_quality_control":[            {"job_name":"Data_Quality_Control_Demo","sample_info":"../05others/phenotype.txt","repeated_records":false,"multi_trait":true,"filter":"F1 == 'Male'","job_traits": [                    {"traits":"T1","definition":"T1","range": []                    },                    {"traits":"T2","definition":"T2","range": []                    }                ]            }        ]    },"breeding_plan":[        {"job_name":"EBV_Model_Demo","sample_info":"../05others/phenotype.txt","repeated_records":false,"multi_trait":true,"vc_vars": [],"vc_covars": [],"random_ratio":0.05,"job_traits": [                {"traits":"T1","covariates": [],"fixed_effects": ["F1","F2"],"random_effects": ["R1"]                },                {"traits":"T2","covariates": [],"fixed_effects": ["F1","F2"],"random_effects": ["R1"]                }            ]        }    ]}

Running the multiple-trait selection index plan process only requires two steps, the first step is to read in the JSON file path, and the second step is to usesimer.Data.Json to read in a JSON file. It should be noted that constructing a multiple-trait selection index requires the use of genetic evaluation results, thereforedataQC,buildModel, andbuildIndex all need to be set to TRUE.

# Get JSON filejsonFile<- system.file("extdata","04breeding_plan","plan3.json",package="simer")# It needs "plink" and "hiblup" softwarejsonList<- simer.Data.Json(jsonFile=jsonFile,dataQC=TRUE,buildModel=TRUE,buildIndex=TRUE)

Global Options

back to top

Users can use global parameters to control thepopulation properties ,the number of threads used for simulation, and theoutput of simulation data.

Gallery of global parameters

back to top

simer, main function of simulation:

ParamaterDefaultOptionsDescription
replication1numthe replication times of simulation.
seed.simrandomnumsimulation random seed.
out"simer"characterthe prefix of output files.
outpathNULLcharacterthe path of output files, Simer writes files only if outpath is not "NULL".
out.format"numeric""numeric" or "plink""numeric" or "plink", the data format of output files.
pop.gen1numthe generations of simulated population.
out.geno.gen1num vectorthe output generations of genotype data.
out.pheno.gen1num vectorthe output generations of phenotype data.
useAllGenoFALSETRUE or FALSEwhether to use all genotype data to simulate phenotype.
missing.genoNULLnumthe ratio of missing values in genotype data.
missing.pheNULLlistthe ratio of missing values in phenotype data.
ncpus0numthe number of threads used, if it is 0, (logical core number - 1) is automatically used.
verboseTRUETRUE or FALSEwhether to print detail.

Counts of total population size

back to top

Users can calculate thenumber of individuals per generation usingIndPerGen directly.

pop<- generate.pop(pop.ind=100)count.ind<- IndPerGen(pop=pop,pop.gen=2,ps= c(0.8,0.8),reprod.way="randmate",sex.rate=0.5,prog=2)

Multi-thread computation

back to top

This section uses theparam.simer andsimer functions for demonstration. Therefore, please read the usage ofparam.simer andsimer inAN EASY WAY TO GENERATE A POPULATION before reading this section.SIMER runs onmultiple threads. Users can easily change the number of threads used for simulation by the following:

# Generate all simulation parametersSP<- param.simer(out="simer",ncpus=2)# Run SimerSP<- simer(SP)

Multi-population simulation

back to top

This section uses theparam.simer andsimer functions for demonstration. Therefore, please read the usage ofparam.simer andsimer inAN EASY WAY TO GENERATE A POPULATION before reading this section. Simulation ofmultiple populations can be realized byfor by usingR software.

# Replication timesrep<-2# Result listSPs<- rep(list(NULL),rep)for (iin1:rep) {# Generate all simulation parametersSP<- param.simer(replication=i,seed.sim=i,out="simer")# Run SimerSPs[[i]]<- simer(SP)}

File output

back to top

This section uses theparam.simer andsimer functions for demonstration. Therefore, please read the usage ofparam.simer andsimer inAN EASY WAY TO GENERATE A POPULATION before reading this section.SIMER will not output files by default. A series of files with the prefixout will output when specifyingoutpath.

### 01 Numeric Format #### Generate all simulation parametersSP<- param.simer(# SP = SP, # uncomment it when users already have a "SP"out="simer",outpath= getwd(),out.format="numeric" )# Run SimerSP<- simer(SP)### 02 PLINK Binary Format #### Generate all simulation parametersSP<- param.simer(# SP = SP, # uncomment it when users already have a "SP"out="simer",outpath= getwd(),out.format="plink")# Run SimerSP<- simer(SP)### 03 Numeric Format with missing values in genotype and phenotype #### Generate all simulation parametersSP<- param.simer(# SP = SP, # uncomment it when users already have a "SP"out="simer",outpath= getwd(),out.format="numeric",missing.geno=0.01,missing.phe=list(tr1=0.5))# Run SimerSP<- simer(SP)### 04 PLINK Binary Format with missing values in genotype and phenotype #### Generate all simulation parametersSP<- param.simer(# SP = SP, # uncomment it when users already have a "SP"out="simer",outpath= getwd(),out.format="plink",missing.geno=0.01,missing.phe=list(tr1=0.5))# Run SimerSP<- simer(SP)

Generation-selective output

back to top

This section uses theparam.simer andsimer functions for demonstration. Therefore, please read the usage ofparam.simer andsimer inAN EASY WAY TO GENERATE A POPULATION before reading this section. Output of genotype and phenotype can begeneration-selective usingout.geno.gen andout.pheno.gen.

# Generate all simulation parametersSP<- param.simer(out="simer",outpath= getwd(),pop.gen=2,out.geno.gen=1:2,out.pheno.gen=1:2)# Run SimerSP<- simer(SP)

Output

back to top

SIMER outputs data includingannotation data,genotype data, andphenotype data in the following two format.
Numeric format:
simer.geno.ind contains indice of genotyped individuals;
simer.geno.desc andsimer.geno.bin contain genotype matrix of all individuals;
simer.geno.map contains input map with block information and recombination information;
simer.ped contains pedigree of individuals;
simer.phe contains phenotype of individuals.
PLINK Binary format:
simer.bim contains marker information of genotype data;
simer.bed contains genotype data in binary format;
simer.fam contains sample information of genotype data;
simer.ped contains pedigree of individuals;
simer.phe contains phenotype of individuals.

Annotation data

back to top

Annotation data containsSNP name,Chromosome name,Base Position,ALT,REF, and theQTN genetic effect. Note that only markers selected as QTNs have values.

# Generate all simulation parametersSP<- param.simer(out="simer")# Run SimerSP<- simer(SP)# Show annotation datahead(SP$map$pop.map)SNPChromBPALTREFQTN1_A1M11130693CANA2M21168793GANA3M31286553ATNA4M41306913CGNA5M51350926TANA6M61355889ACNA

Genotype data

back to top

Genotype data is stored inbig.matrix format.

# Generate all simulation parametersSP<- param.simer(out="simer")# Run SimerSP<- simer(SP)# Show genotype dataprint(SP$geno$pop.geno)$gen1Anobjectofclass"big.matrix"Slot"address":<pointer:0x00000000176f09e0>$gen2Anobjectofclass"big.matrix"Slot"address":<pointer:0x00000000176ef940>print(SP$geno$pop.geno$gen1[1:6,1:6])     [,1] [,2] [,3] [,4] [,5] [,6][1,]020102[2,]111100[3,]012210[4,]201110[5,]210121[6,]121112

Phenotype data

back to top

Phenotype data containssample ID,generation index,family index,within-family index,sire,dam,sex,phenotype,TBV,TGV, and other effects.

# Generate all simulation parametersSP<- param.simer(out="simer")# Run SimerSP<- simer(SP)# Show phenotype datahead(SP$pheno$pop$gen1)indexgenfaminfamsirdamsexT1T1_TBVT1_TGVT1_A_effT1_E_eff11111001-0.4934935-1.3507888-1.3507888-1.35078880.8572953221220017.7710404-1.6756353-1.6756353-1.67563539.446675733133001-4.6567338-2.2608387-2.2608387-2.2608387-2.395895144144001-5.9064589-1.7394139-1.7394139-1.7394139-4.167045055155001-16.7438931-2.8000846-2.8000846-2.8000846-13.9438085661660016.00439120.34135610.34135610.34135615.6630351

Citation

back to top

For SIMER:Yin, D., Zhang, X., Yin, L. et al. "SIMER: an accurate and intelligent tool for simulating customizable population data across species in complex scenarios." J Big Data 12, 49 (2025). https://doi.org/10.1186/s40537-025-01102-zFor ADI model:Kao, Chenhung, et al. "Modeling Epistasis of Quantitative Trait Loci Using Cockerham's Model." Genetics 160.3 (2002): 1243-1261.For build.cov:B. D. Ripley "Stochastic Simulation." Wiley-Interscience (1987): Page 98.

FAQ and Hints

back to top

🆘Question1: Failing to install "devtools":

ERROR: configuration failed for package ‘git2r’

removing ‘/Users/acer/R/3.4/library/git2r’

ERROR: dependency ‘git2r’ is not available for package ‘devtools’

removing ‘/Users/acer/R/3.4/library/devtools’

😋Answer: Please try following codes in terminal:

apt-get install libssl-dev/unstable

🆘Question2: When installing packages from Github with "devtools", an error occurred:

Error in curl::curl_fetch_disk(url, x$path, handle = handle): Problem with the SSL CA cert (path? access rights?)

😋Answer: Please try following codes and then try agian.

library(httr)set_config(config(ssl_verifypeer=0L))

Questions, suggestions, and bug reports are welcome and appreciated.➡️

back to top


[8]ページ先頭

©2009-2025 Movatter.jp