Title: | Data Simulation for Life Science and Breeding |
---|---|
Description: | Data simulator including genotype, phenotype, pedigree, selection and reproduction in R. It simulates most of reproduction process of animals or plants and provides data for GS (Genomic Selection), GWAS (Genome-Wide Association Study), and Breeding. For ADI model, please see Kao C and Zeng Z (2002) <doi:10.1093/genetics/160.3.1243>. For build.cov, please see B. D. Ripley (1987) <ISBN:9780470009604>. |
Authors: | Dong Yin [aut], Xuanning Zhang [aut], Lilin Yin [aut], Haohao Zhang [aut], Zhenshuang Tang [aut], Jingya Xu [aut], Xiaohui Yuan [aut], Xiang Zhou [aut], Xinyun Li [aut], Shuhong Zhao [aut], Xiaolei Liu [cre, aut, cph] |
Maintainer: | Xiaolei Liu <[email protected]> |
License: | Apache License 2.0 |
Version: | 0.9.0.5 |
Built: | 2024-10-31 22:26:16 UTC |
Source: | CRAN |
Generating a map with annotation information
annotation(SP, verbose = TRUE)
annotation(SP, verbose = TRUE)
SP |
a list of all simulation parameters. |
verbose |
whether to print detail. |
Build date: Nov 14, 2018 Last update: Jul 10, 2022
the function returns a list containing
the map data with annotation information.
the species of genetic map, which can be "arabidopsis", "cattle", "chicken", "dog", "horse", "human", "maize", "mice", "pig", and "rice".
the number of markers.
the number of chromosomes.
the length of chromosomes.
the genetic model of QTN such as 'A + D'.
the QTN index for each trait.
the QTN number for (each group in) each trait.
the QTN distribution containing 'norm', 'geom', 'gamma' or 'beta'.
the variances for normal distribution.
the probability of success for geometric distribution.
the shape parameter for gamma distribution.
the scale parameter for gamma distribution.
the shape1 parameter for beta distribution.
the shape2 parameter for beta distribution.
the ncp parameter for beta distribution.
the QTN distribution probability in each block.
the block length.
the maf threshold, markers less than this threshold will be exclude.
whether to generate recombination events.
the recombination times range in the hot spot.
the recombination times range in the cold spot.
Dong Yin
# Generate annotation simulation parameters SP <- param.annot(qtn.num = list(tr1 = 10)) # Run annotation simulation SP <- annotation(SP)
# Generate annotation simulation parameters SP <- param.annot(qtn.num = list(tr1 = 10)) # Run annotation simulation SP <- annotation(SP)
To bulid correlation of variables.
build.cov(df = NULL, mu = rep(0, nrow(Sigma)), Sigma = diag(2), tol = 1e-06)
build.cov(df = NULL, mu = rep(0, nrow(Sigma)), Sigma = diag(2), tol = 1e-06)
df |
a data frame needing building correlation. |
mu |
means of the variables. |
Sigma |
covariance matrix of variables. |
tol |
tolerance (relative to largest variance) for numerical lack of positive-definiteness in Sigma. |
Build date: Oct 10, 2019 Last update: Apr 28, 2022
a data frame with expected correlation
Dong Yin and R
B. D. Ripley (1987) Stochastic Simulation. Wiley. Page 98
df <- data.frame(tr1 = rnorm(100), tr2 = rnorm(100)) df.cov <- build.cov(df) var(df.cov)
df <- data.frame(tr1 = rnorm(100), tr2 = rnorm(100)) df.cov <- build.cov(df) var(df.cov)
Calculate for genetic effects vector of selected markers.
cal.eff( qtn.num = 10, qtn.dist = "norm", qtn.var = 1, qtn.prob = 0.5, qtn.shape = 1, qtn.scale = 1, qtn.shape1 = 1, qtn.shape2 = 1, qtn.ncp = 0 )
cal.eff( qtn.num = 10, qtn.dist = "norm", qtn.var = 1, qtn.prob = 0.5, qtn.shape = 1, qtn.scale = 1, qtn.shape1 = 1, qtn.shape2 = 1, qtn.ncp = 0 )
qtn.num |
integer: the QTN number of single trait; vector: the multiple group QTN number of single trait; matrix: the QTN number of multiple traits. |
qtn.dist |
the QTN distribution containing 'norm', 'geom', 'gamma' or 'beta'. |
qtn.var |
the standard deviations for normal distribution. |
qtn.prob |
the probability of success for geometric distribution. |
qtn.shape |
the shape parameter for gamma distribution. |
qtn.scale |
the scale parameter for gamma distribution. |
qtn.shape1 |
the shape1 parameter for beta distribution. |
qtn.shape2 |
the shape2 parameter for beta distribution. |
qtn.ncp |
the ncp parameter for beta distribution. |
Build date: Nov 14, 2018 Last update: Apr 28, 2022
a vector of genetic effect.
Dong Yin
eff <- cal.eff(qtn.num = 10) str(eff)
eff <- cal.eff(qtn.num = 10) str(eff)
Check the levels of environmental factors.
checkEnv(data, envName, verbose = TRUE)
checkEnv(data, envName, verbose = TRUE)
data |
data needing check. |
envName |
the environmental factor name within the data. |
verbose |
whether to print detail. |
Build date: Sep 10, 2021 Last update: Apr 28, 2022
data without environmental factors of wrong level.
Dong Yin
data <- data.frame(a = c(1, 1, 2), b = c(2, 2, 3), c = c(3, 3, 4)) envName <- c("a", "b", "c") data <- checkEnv(data = data, envName = envName)
data <- data.frame(a = c(1, 1, 2), b = c(2, 2, 3), c = c(3, 3, 4)) envName <- c("a", "b", "c") data <- checkEnv(data = data, envName = envName)
Generate map data with marker information.
generate.map( species = NULL, pop.marker = NULL, num.chr = 18, len.chr = 1.5e+08 )
generate.map( species = NULL, pop.marker = NULL, num.chr = 18, len.chr = 1.5e+08 )
species |
the species of genetic map, which can be "arabidopsis", "cattle", "chicken", "dog", "horse", "human", "maize", "mice", "pig", and "rice". |
pop.marker |
the number of markers. |
num.chr |
the number of chromosomes. |
len.chr |
the length of chromosomes. |
Build date: Mar 19, 2022 Last update: Apr 28, 2022
a data frame with marker information.
Dong Yin
pop.map <- generate.map(pop.marker = 1e4) str(pop.map)
pop.map <- generate.map(pop.marker = 1e4) str(pop.map)
Generate population according to the number of individuals.
generate.pop(pop.ind = 100, from = 1, ratio = 0.5, gen = 1)
generate.pop(pop.ind = 100, from = 1, ratio = 0.5, gen = 1)
pop.ind |
the number of the individuals in a population. |
from |
initial index of the population. |
ratio |
sex ratio of males in a population. |
gen |
generation ID of the population. |
Build date: Nov 14, 2018 Last update: Apr 28, 2022
a data frame of population information.
Dong Yin
pop <- generate.pop(pop.ind = 100) head(pop)
pop <- generate.pop(pop.ind = 100) head(pop)
Convert genotype matrix from (0, 1) to (0, 1, 2).
geno.cvt1(pop.geno)
geno.cvt1(pop.geno)
pop.geno |
genotype matrix of (0, 1). |
Build date: Nov 14, 2018 Last update: Apr 28, 2022
genotype matrix of (0, 1, 2).
Dong Yin
SP <- param.geno(pop.marker = 1e4, pop.ind = 1e2, incols = 2) SP <- genotype(SP) geno1 <- SP$geno$pop.geno$gen1 geno2 <- geno.cvt1(geno1) geno1[1:6, 1:4] geno2[1:6, 1:2]
SP <- param.geno(pop.marker = 1e4, pop.ind = 1e2, incols = 2) SP <- genotype(SP) geno1 <- SP$geno$pop.geno$gen1 geno2 <- geno.cvt1(geno1) geno1[1:6, 1:4] geno2[1:6, 1:2]
Convert genotype matrix from (0, 1, 2) to (0, 1).
geno.cvt2(pop.geno)
geno.cvt2(pop.geno)
pop.geno |
genotype matrix of (0, 1, 2). |
Build date: Jul 11, 2020 Last update: Apr 28, 2022
genotype matrix of (0, 1).
Dong Yin
SP <- param.geno(pop.marker = 1e4, pop.ind = 1e2, incols = 1) SP <- genotype(SP) geno1 <- SP$geno$pop.geno$gen1 geno2 <- geno.cvt2(geno1) geno1[1:6, 1:2] geno2[1:6, 1:4]
SP <- param.geno(pop.marker = 1e4, pop.ind = 1e2, incols = 1) SP <- genotype(SP) geno1 <- SP$geno$pop.geno$gen1 geno2 <- geno.cvt2(geno1) geno1[1:6, 1:2] geno2[1:6, 1:4]
Generating and editing genotype data.
genotype(SP = NULL, ncpus = 0, verbose = TRUE)
genotype(SP = NULL, ncpus = 0, verbose = TRUE)
SP |
a list of all simulation parameters. |
ncpus |
the number of threads used, if NULL, (logical core number - 1) is automatically used. |
verbose |
whether to print detail. |
Build date: Nov 14, 2018 Last update: Apr 28, 2022
the function returns a list containing
the genotype data.
'1': one-column genotype represents an individual; '2': two-column genotype represents an individual.
the number of markers.
the number of individuals in the base population.
the genotype code probability.
the mutation rate of the genotype data.
whether to generate a complete LD genotype data when 'incols == 2'.
Dong Yin
# Generate genotype simulation parameters SP <- param.geno(pop.marker = 1e4, pop.ind = 1e2) # Run genotype simulation SP <- genotype(SP)
# Generate genotype simulation parameters SP <- param.geno(pop.marker = 1e4, pop.ind = 1e2) # Run genotype simulation SP <- genotype(SP)
Get indice of family and within-family
getfam(sir, dam, fam.op, mode = c("pat", "mat", "pm"))
getfam(sir, dam, fam.op, mode = c("pat", "mat", "pm"))
sir |
the indice of sires. |
dam |
the indice of dams. |
fam.op |
the initial index of family indice. |
mode |
"pat": paternal mode; "mat": maternal mode; "pm": paternal and maternal mode. |
Build date: Nov 14, 2018 Last update: Apr 30, 2022
a matrix with family indice and within-family indice.
Dong Yin
s <- c(0, 0, 0, 0, 1, 3, 3, 1, 5, 7, 5, 7, 1, 3, 5, 7) d <- c(0, 0, 0, 0, 2, 4, 4, 2, 6, 8, 8, 6, 6, 8, 4, 8) fam <- getfam(sir = s, dam = d, fam.op = 1, mode = "pm") fam
s <- c(0, 0, 0, 0, 1, 3, 3, 1, 5, 7, 5, 7, 1, 3, 5, 7) d <- c(0, 0, 0, 0, 2, 4, 4, 2, 6, 8, 8, 6, 6, 8, 4, 8) fam <- getfam(sir = s, dam = d, fam.op = 1, mode = "pm") fam
Generate genetic interaction effect combination network.
GxG.network(pop.map = NULL, qtn.pos = 1:10, qtn.model = "A:D")
GxG.network(pop.map = NULL, qtn.pos = 1:10, qtn.model = "A:D")
pop.map |
the map data with annotation information. |
qtn.pos |
the index of QTNs in the map data. |
qtn.model |
the genetic model of QTN such as 'A:D'. |
Build date: Mar 19, 2022 Last update: Apr 28, 2022
a data frame of genetic interaction effect.
Dong Yin
pop.map <- generate.map(pop.marker = 1e4) GxG.net <- GxG.network(pop.map) head(GxG.net)
pop.map <- generate.map(pop.marker = 1e4) GxG.net <- GxG.network(pop.map) head(GxG.net)
Calculate the individual number per generation.
IndPerGen( pop, pop.gen = 2, ps = c(0.8, 0.8), reprod.way = "randmate", sex.rate = 0.5, prog = 2 )
IndPerGen( pop, pop.gen = 2, ps = c(0.8, 0.8), reprod.way = "randmate", sex.rate = 0.5, prog = 2 )
pop |
the population information containing environmental factors and other effects. |
pop.gen |
the generations of simulated population. |
ps |
if ps <= 1, fraction selected in selection of males and females; if ps > 1, ps is number of selected males and females. |
reprod.way |
reproduction method, it consists of 'clone', 'dh', 'selfpol', 'randmate', 'randexself', 'assort', 'disassort', '2waycro', '3waycro', '4waycro', 'backcro', and 'userped'. |
sex.rate |
the sex ratio of simulated population. |
prog |
the progeny number of an individual. |
Build date: Apr 12, 2022 Last update: Apr 30, 2022
the vector containing the individual number per generation.
Dong Yin
pop <- generate.pop(pop.ind = 100) count.ind <- IndPerGen(pop)
pop <- generate.pop(pop.ind = 100) count.ind <- IndPerGen(pop)
Initialize the logging process.
logging.initialize(module, outpath)
logging.initialize(module, outpath)
module |
the module name. |
outpath |
the path of output files, Simer writes files only if outpath is not 'NULL'. |
Build date: Jul 11, 2020 Last update: Apr 28, 2022
none.
Dong Yin
Print or write log.
logging.log( ..., file = NULL, sep = " ", fill = FALSE, labels = NULL, verbose = TRUE )
logging.log( ..., file = NULL, sep = " ", fill = FALSE, labels = NULL, verbose = TRUE )
... |
R objects. |
file |
a connection or a character string naming the file to print to. If "" (the default), cat prints to the standard output connection, the console unless redirected by sink. If it is "|cmd", the output is piped to the command given by ‘cmd’, by opening a pipe connection. |
sep |
a character vector of strings to append after each element. |
fill |
a logical or (positive) numeric controlling how the output is broken into successive lines. |
labels |
a character vector of labels for the lines printed. Ignored if fill is FALSE. |
verbose |
whether to print detail. |
Build date: Jul 11, 2020 Last update: Apr 28, 2022
none.
Dong Yin
logging.log('simer')
logging.log('simer')
Print R object information into file.
logging.print(x, file = NULL, append = TRUE, verbose = TRUE)
logging.print(x, file = NULL, append = TRUE, verbose = TRUE)
x |
a matrix or a list. |
file |
the filename of output file. |
append |
logical. If TRUE, output will be appended to file; otherwise, it will overwrite the contents of file. |
verbose |
whether to print details. |
Build date: Feb 7, 2020 Last update: Apr 28, 2022
none.
Dong Yin
x <- list(a = "a", b = "b") logging.print(x)
x <- list(a = "a", b = "b") logging.print(x)
Mating according to the indice of sires and dams.
mate(pop.geno, index.sir, index.dam, ncpus = 0)
mate(pop.geno, index.sir, index.dam, ncpus = 0)
pop.geno |
the genotype data. |
index.sir |
the indice of sires. |
index.dam |
the indice of dams. |
ncpus |
the number of threads used, if NULL, (logical core number - 1) is automatically used. |
Build date: Nov 14, 2018 Last update: Apr 30, 2022
a genotype matrix after mating
Dong Yin
# Generate the genotype data SP <- param.geno(pop.marker = 1e4, pop.ind = 1e2) SP <- genotype(SP) pop.geno <- SP$geno$pop.geno$gen1 # The mating design index.sir <- rep(1:50, each = 2) index.dam <- rep(51:100, each = 2) # Mate according to mating design geno.curr <- mate(pop.geno = pop.geno, index.sir = index.sir, index.dam = index.dam) geno.curr[1:5, 1:5]
# Generate the genotype data SP <- param.geno(pop.marker = 1e4, pop.ind = 1e2) SP <- genotype(SP) pop.geno <- SP$geno$pop.geno$gen1 # The mating design index.sir <- rep(1:50, each = 2) index.dam <- rep(51:100, each = 2) # Mate according to mating design geno.curr <- mate(pop.geno = pop.geno, index.sir = index.sir, index.dam = index.dam) geno.curr[1:5, 1:5]
Produce individuals by two-way cross.
mate.2waycro(SP, ncpus = 0, verbose = TRUE)
mate.2waycro(SP, ncpus = 0, verbose = TRUE)
SP |
a list of all simulation parameters. |
ncpus |
the number of threads used, if NULL, (logical core number - 1) is automatically used. |
verbose |
whether to print detail. |
Build date: Nov 14, 2018 Last update: Apr 30, 2022
the function returns a list containing
the generations of simulated population.
reproduction method, it consists of 'clone', 'dh', 'selfpol', 'randmate', 'randexself', 'assort', 'disassort', 'assort', 'disassort', '2waycro', '3waycro', '4waycro', 'backcro', and 'userped'.
the sex ratio of simulated population.
the progeny number of an individual.
a list of genotype simulation parameters.
a list of phenotype simulation parameters.
Dong Yin
# Generate annotation simulation parameters SP <- param.annot(qtn.num = list(tr1 = 10)) # Generate genotype simulation parameters SP <- param.geno(SP = SP, pop.marker = 1e4, pop.ind = 1e2) # Generate phenotype simulation parameters SP <- param.pheno(SP = SP, pop.ind = 100) # Generate selection parameters SP <- param.sel(SP = SP, sel.single = "ind") # Generate reproduction parameters SP <- param.reprod(SP = SP, reprod.way = "2waycro") # Run annotation simulation SP <- annotation(SP) # Run genotype simulation SP <- genotype(SP) # Run phenotype simulation SP <- phenotype(SP) # Two different breeds are cut by sex SP$pheno$pop$gen1$sex <- rep(c(1, 2), c(50, 50)) # Run selection SP <- selects(SP) # Run two-way cross SP <- mate.2waycro(SP)
# Generate annotation simulation parameters SP <- param.annot(qtn.num = list(tr1 = 10)) # Generate genotype simulation parameters SP <- param.geno(SP = SP, pop.marker = 1e4, pop.ind = 1e2) # Generate phenotype simulation parameters SP <- param.pheno(SP = SP, pop.ind = 100) # Generate selection parameters SP <- param.sel(SP = SP, sel.single = "ind") # Generate reproduction parameters SP <- param.reprod(SP = SP, reprod.way = "2waycro") # Run annotation simulation SP <- annotation(SP) # Run genotype simulation SP <- genotype(SP) # Run phenotype simulation SP <- phenotype(SP) # Two different breeds are cut by sex SP$pheno$pop$gen1$sex <- rep(c(1, 2), c(50, 50)) # Run selection SP <- selects(SP) # Run two-way cross SP <- mate.2waycro(SP)
Produce individuals by three-way cross.
mate.3waycro(SP, ncpus = 0, verbose = TRUE)
mate.3waycro(SP, ncpus = 0, verbose = TRUE)
SP |
a list of all simulation parameters. |
ncpus |
the number of threads used, if NULL, (logical core number - 1) is automatically used. |
verbose |
whether to print detail. |
Build date: Apr 11, 2022 Last update: Apr 30, 2022
the function returns a list containing
the generations of simulated population.
reproduction method, it consists of 'clone', 'dh', 'selfpol', 'randmate', 'randexself', 'assort', 'disassort', '2waycro', '3waycro', '4waycro', 'backcro', and 'userped'.
the sex ratio of simulated population.
the progeny number of an individual.
a list of genotype simulation parameters.
a list of phenotype simulation parameters.
Dong Yin
# Generate annotation simulation parameters SP <- param.annot(qtn.num = list(tr1 = 10)) # Generate genotype simulation parameters SP <- param.geno(SP = SP, pop.marker = 1e4, pop.ind = 1e2) # Generate phenotype simulation parameters SP <- param.pheno(SP = SP, pop.ind = 100) # Generate selection parameters SP <- param.sel(SP = SP, sel.single = "ind") # Generate reproduction parameters SP <- param.reprod(SP = SP, reprod.way = "3waycro") # Run annotation simulation SP <- annotation(SP) # Run genotype simulation SP <- genotype(SP) # Run phenotype simulation SP <- phenotype(SP) # Three different breeds are cut by sex SP$pheno$pop$gen1$sex <- rep(c(1, 2, 1), c(30, 30, 40)) # Run selection SP <- selects(SP) # Run three-way cross SP <- mate.3waycro(SP)
# Generate annotation simulation parameters SP <- param.annot(qtn.num = list(tr1 = 10)) # Generate genotype simulation parameters SP <- param.geno(SP = SP, pop.marker = 1e4, pop.ind = 1e2) # Generate phenotype simulation parameters SP <- param.pheno(SP = SP, pop.ind = 100) # Generate selection parameters SP <- param.sel(SP = SP, sel.single = "ind") # Generate reproduction parameters SP <- param.reprod(SP = SP, reprod.way = "3waycro") # Run annotation simulation SP <- annotation(SP) # Run genotype simulation SP <- genotype(SP) # Run phenotype simulation SP <- phenotype(SP) # Three different breeds are cut by sex SP$pheno$pop$gen1$sex <- rep(c(1, 2, 1), c(30, 30, 40)) # Run selection SP <- selects(SP) # Run three-way cross SP <- mate.3waycro(SP)
Produce individuals by four-way cross.
mate.4waycro(SP, ncpus = 0, verbose = TRUE)
mate.4waycro(SP, ncpus = 0, verbose = TRUE)
SP |
a list of all simulation parameters. |
ncpus |
the number of threads used, if NULL, (logical core number - 1) is automatically used. |
verbose |
whether to print detail. |
Build date: Apr 11, 2022 Last update: Apr 30, 2022
the function returns a list containing
the generations of simulated population.
reproduction method, it consists of 'clone', 'dh', 'selfpol', 'randmate', 'randexself', 'assort', 'disassort', '2waycro', '3waycro', '4waycro', 'backcro', and 'userped'.
the sex ratio of simulated population.
the progeny number of an individual.
a list of genotype simulation parameters.
a list of phenotype simulation parameters.
Dong Yin
# Generate annotation simulation parameters SP <- param.annot(qtn.num = list(tr1 = 10)) # Generate genotype simulation parameters SP <- param.geno(SP = SP, pop.marker = 1e4, pop.ind = 1e2) # Generate phenotype simulation parameters SP <- param.pheno(SP = SP, pop.ind = 100) # Generate selection parameters SP <- param.sel(SP = SP, sel.single = "ind") # Generate reproduction parameters SP <- param.reprod(SP = SP, reprod.way = "4waycro") # Run annotation simulation SP <- annotation(SP) # Run genotype simulation SP <- genotype(SP) # Run phenotype simulation SP <- phenotype(SP) # Four different breeds are cut by sex SP$pheno$pop$gen1$sex <- rep(c(1, 2, 1, 2), c(25, 25, 25, 25)) # Run selection SP <- selects(SP) # Run four-way cross SP <- mate.4waycro(SP)
# Generate annotation simulation parameters SP <- param.annot(qtn.num = list(tr1 = 10)) # Generate genotype simulation parameters SP <- param.geno(SP = SP, pop.marker = 1e4, pop.ind = 1e2) # Generate phenotype simulation parameters SP <- param.pheno(SP = SP, pop.ind = 100) # Generate selection parameters SP <- param.sel(SP = SP, sel.single = "ind") # Generate reproduction parameters SP <- param.reprod(SP = SP, reprod.way = "4waycro") # Run annotation simulation SP <- annotation(SP) # Run genotype simulation SP <- genotype(SP) # Run phenotype simulation SP <- phenotype(SP) # Four different breeds are cut by sex SP$pheno$pop$gen1$sex <- rep(c(1, 2, 1, 2), c(25, 25, 25, 25)) # Run selection SP <- selects(SP) # Run four-way cross SP <- mate.4waycro(SP)
Produce individuals by assortative mating.
mate.assort(SP, ncpus = 0, verbose = TRUE)
mate.assort(SP, ncpus = 0, verbose = TRUE)
SP |
a list of all simulation parameters. |
ncpus |
the number of threads used, if NULL, (logical core number - 1) is automatically used. |
verbose |
whether to print detail. |
Build date: Sep 30, 2022 Last update: Sep 30, 2022
the function returns a list containing
the generations of simulated population.
reproduction method, it consists of 'clone', 'dh', 'selfpol', 'randmate', 'randexself', 'assort', 'disassort', '2waycro', '3waycro', '4waycro', 'backcro', and 'userped'.
the sex ratio of simulated population.
the progeny number of an individual.
a list of genotype simulation parameters.
a list of phenotype simulation parameters.
Dong Yin
# Generate annotation simulation parameters SP <- param.annot(qtn.num = list(tr1 = 10)) # Generate genotype simulation parameters SP <- param.geno(SP = SP, pop.marker = 1e4, pop.ind = 1e2) # Generate phenotype simulation parameters SP <- param.pheno(SP = SP, pop.ind = 100) # Generate selection parameters SP <- param.sel(SP = SP, sel.single = "ind") # Generate reproduction parameters SP <- param.reprod(SP = SP, reprod.way = "assort") # Run annotation simulation SP <- annotation(SP) # Run genotype simulation SP <- genotype(SP) # Run phenotype simulation SP <- phenotype(SP) # Run selection SP <- selects(SP) # Run random mating SP <- mate.assort(SP)
# Generate annotation simulation parameters SP <- param.annot(qtn.num = list(tr1 = 10)) # Generate genotype simulation parameters SP <- param.geno(SP = SP, pop.marker = 1e4, pop.ind = 1e2) # Generate phenotype simulation parameters SP <- param.pheno(SP = SP, pop.ind = 100) # Generate selection parameters SP <- param.sel(SP = SP, sel.single = "ind") # Generate reproduction parameters SP <- param.reprod(SP = SP, reprod.way = "assort") # Run annotation simulation SP <- annotation(SP) # Run genotype simulation SP <- genotype(SP) # Run phenotype simulation SP <- phenotype(SP) # Run selection SP <- selects(SP) # Run random mating SP <- mate.assort(SP)
Produce individuals by back cross.
mate.backcro(SP, ncpus = 0, verbose = TRUE)
mate.backcro(SP, ncpus = 0, verbose = TRUE)
SP |
a list of all simulation parameters. |
ncpus |
the number of threads used, if NULL, (logical core number - 1) is automatically used. |
verbose |
whether to print detail. |
Build date: Apr 12, 2022 Last update: Apr 30, 2022
the function returns a list containing
the generations of simulated population.
reproduction method, it consists of 'clone', 'dh', 'selfpol', 'randmate', 'randexself', 'assort', 'disassort', '2waycro', '3waycro', '4waycro', 'backcro', and 'userped'.
the sex ratio of simulated population.
the progeny number of an individual.
a list of genotype simulation parameters.
a list of phenotype simulation parameters.
Dong Yin
# Generate annotation simulation parameters SP <- param.annot(qtn.num = list(tr1 = 10)) # Generate genotype simulation parameters SP <- param.geno(SP = SP, pop.marker = 1e4, pop.ind = 1e2) # Generate phenotype simulation parameters SP <- param.pheno(SP = SP, pop.ind = 100) # Generate selection parameters SP <- param.sel(SP = SP, sel.single = "ind") # Generate reproduction parameters SP <- param.reprod(SP = SP, reprod.way = "backcro") # Run annotation simulation SP <- annotation(SP) # Run genotype simulation SP <- genotype(SP) # Run phenotype simulation SP <- phenotype(SP) # Two different breeds are cut by sex SP$pheno$pop$gen1$sex <- rep(c(1, 2), c(50, 50)) # Run selection SP <- selects(SP) # Run back cross SP <- mate.backcro(SP)
# Generate annotation simulation parameters SP <- param.annot(qtn.num = list(tr1 = 10)) # Generate genotype simulation parameters SP <- param.geno(SP = SP, pop.marker = 1e4, pop.ind = 1e2) # Generate phenotype simulation parameters SP <- param.pheno(SP = SP, pop.ind = 100) # Generate selection parameters SP <- param.sel(SP = SP, sel.single = "ind") # Generate reproduction parameters SP <- param.reprod(SP = SP, reprod.way = "backcro") # Run annotation simulation SP <- annotation(SP) # Run genotype simulation SP <- genotype(SP) # Run phenotype simulation SP <- phenotype(SP) # Two different breeds are cut by sex SP$pheno$pop$gen1$sex <- rep(c(1, 2), c(50, 50)) # Run selection SP <- selects(SP) # Run back cross SP <- mate.backcro(SP)
Produce individuals by clone.
mate.clone(SP, ncpus = 0, verbose = TRUE)
mate.clone(SP, ncpus = 0, verbose = TRUE)
SP |
a list of all simulation parameters. |
ncpus |
the number of threads used, if NULL, (logical core number - 1) is automatically used. |
verbose |
whether to print detail. |
Build date: Nov 14, 2018 Last update: Apr 30, 2022
the function returns a list containing
the generations of simulated population.
reproduction method, it consists of 'clone', 'dh', 'selfpol', 'randmate', 'randexself', 'assort', 'disassort', '2waycro', '3waycro', '4waycro', 'backcro', and 'userped'.
the sex ratio of simulated population.
the progeny number of an individual.
a list of genotype simulation parameters.
a list of phenotype simulation parameters.
Dong Yin
# Generate annotation simulation parameters SP <- param.annot(qtn.num = list(tr1 = 10)) # Generate genotype simulation parameters SP <- param.geno(SP = SP, pop.marker = 1e4, pop.ind = 1e2) # Generate phenotype simulation parameters SP <- param.pheno(SP = SP, pop.ind = 100) # Generate selection parameters SP <- param.sel(SP = SP, sel.single = "ind") # Generate reproduction parameters SP <- param.reprod(SP = SP, reprod.way = "clone") # Run annotation simulation SP <- annotation(SP) # Run genotype simulation SP <- genotype(SP) # Run phenotype simulation SP <- phenotype(SP) # Run selection SP <- selects(SP) # Run clone SP <- mate.clone(SP)
# Generate annotation simulation parameters SP <- param.annot(qtn.num = list(tr1 = 10)) # Generate genotype simulation parameters SP <- param.geno(SP = SP, pop.marker = 1e4, pop.ind = 1e2) # Generate phenotype simulation parameters SP <- param.pheno(SP = SP, pop.ind = 100) # Generate selection parameters SP <- param.sel(SP = SP, sel.single = "ind") # Generate reproduction parameters SP <- param.reprod(SP = SP, reprod.way = "clone") # Run annotation simulation SP <- annotation(SP) # Run genotype simulation SP <- genotype(SP) # Run phenotype simulation SP <- phenotype(SP) # Run selection SP <- selects(SP) # Run clone SP <- mate.clone(SP)
Produce individuals by doubled haploid.
mate.dh(SP, ncpus = 0, verbose = TRUE)
mate.dh(SP, ncpus = 0, verbose = TRUE)
SP |
a list of all simulation parameters. |
ncpus |
the number of threads used, if NULL, (logical core number - 1) is automatically used. |
verbose |
whether to print detail. |
Build date: Nov 14, 2018 Last update: Apr 30, 2022
the function returns a list containing
the generations of simulated population.
reproduction method, it consists of 'clone', 'dh', 'selfpol', 'randmate', 'randexself', 'assort', 'disassort', '2waycro', '3waycro', '4waycro', 'backcro', and 'userped'.
the sex ratio of simulated population.
the progeny number of an individual.
a list of genotype simulation parameters.
a list of phenotype simulation parameters.
Dong Yin
# Generate annotation simulation parameters SP <- param.annot(qtn.num = list(tr1 = 10)) # Generate genotype simulation parameters SP <- param.geno(SP = SP, pop.marker = 1e4, pop.ind = 1e2) # Generate phenotype simulation parameters SP <- param.pheno(SP = SP, pop.ind = 100) # Generate selection parameters SP <- param.sel(SP = SP, sel.single = "ind") # Generate reproduction parameters SP <- param.reprod(SP = SP, reprod.way = "dh") # Run annotation simulation SP <- annotation(SP) # Run genotype simulation SP <- genotype(SP) # Run phenotype simulation SP <- phenotype(SP) # Run selection SP <- selects(SP) # Run doubled haploid SP <- mate.dh(SP)
# Generate annotation simulation parameters SP <- param.annot(qtn.num = list(tr1 = 10)) # Generate genotype simulation parameters SP <- param.geno(SP = SP, pop.marker = 1e4, pop.ind = 1e2) # Generate phenotype simulation parameters SP <- param.pheno(SP = SP, pop.ind = 100) # Generate selection parameters SP <- param.sel(SP = SP, sel.single = "ind") # Generate reproduction parameters SP <- param.reprod(SP = SP, reprod.way = "dh") # Run annotation simulation SP <- annotation(SP) # Run genotype simulation SP <- genotype(SP) # Run phenotype simulation SP <- phenotype(SP) # Run selection SP <- selects(SP) # Run doubled haploid SP <- mate.dh(SP)
Produce individuals by disassortative mating.
mate.disassort(SP, ncpus = 0, verbose = TRUE)
mate.disassort(SP, ncpus = 0, verbose = TRUE)
SP |
a list of all simulation parameters. |
ncpus |
the number of threads used, if NULL, (logical core number - 1) is automatically used. |
verbose |
whether to print detail. |
Build date: Sep 30, 2022 Last update: Sep 30, 2022
the function returns a list containing
the generations of simulated population.
reproduction method, it consists of 'clone', 'dh', 'selfpol', 'randmate', 'randexself', 'assort', 'disassort', '2waycro', '3waycro', '4waycro', 'backcro', and 'userped'.
the sex ratio of simulated population.
the progeny number of an individual.
a list of genotype simulation parameters.
a list of phenotype simulation parameters.
Dong Yin
# Generate annotation simulation parameters SP <- param.annot(qtn.num = list(tr1 = 10)) # Generate genotype simulation parameters SP <- param.geno(SP = SP, pop.marker = 1e4, pop.ind = 1e2) # Generate phenotype simulation parameters SP <- param.pheno(SP = SP, pop.ind = 100) # Generate selection parameters SP <- param.sel(SP = SP, sel.single = "ind") # Generate reproduction parameters SP <- param.reprod(SP = SP, reprod.way = "disassort") # Run annotation simulation SP <- annotation(SP) # Run genotype simulation SP <- genotype(SP) # Run phenotype simulation SP <- phenotype(SP) # Run selection SP <- selects(SP) # Run random mating SP <- mate.assort(SP)
# Generate annotation simulation parameters SP <- param.annot(qtn.num = list(tr1 = 10)) # Generate genotype simulation parameters SP <- param.geno(SP = SP, pop.marker = 1e4, pop.ind = 1e2) # Generate phenotype simulation parameters SP <- param.pheno(SP = SP, pop.ind = 100) # Generate selection parameters SP <- param.sel(SP = SP, sel.single = "ind") # Generate reproduction parameters SP <- param.reprod(SP = SP, reprod.way = "disassort") # Run annotation simulation SP <- annotation(SP) # Run genotype simulation SP <- genotype(SP) # Run phenotype simulation SP <- phenotype(SP) # Run selection SP <- selects(SP) # Run random mating SP <- mate.assort(SP)
Produce individuals by random mating excluding self-pollination.
mate.randexself(SP, ncpus = 0, verbose = TRUE)
mate.randexself(SP, ncpus = 0, verbose = TRUE)
SP |
a list of all simulation parameters. |
ncpus |
the number of threads used, if NULL, (logical core number - 1) is automatically used. |
verbose |
whether to print detail. |
Build date: Nov 14, 2018 Last update: Apr 30, 2022
the function returns a list containing
the generations of simulated population.
reproduction method, it consists of 'clone', 'dh', 'selfpol', 'randmate', 'randexself', 'assort', 'disassort', '2waycro', '3waycro', '4waycro', 'backcro', and 'userped'.
the sex ratio of simulated population.
the progeny number of an individual.
a list of genotype simulation parameters.
a list of phenotype simulation parameters.
Dong Yin
# Generate annotation simulation parameters SP <- param.annot(qtn.num = list(tr1 = 10)) # Generate genotype simulation parameters SP <- param.geno(SP = SP, pop.marker = 1e4, pop.ind = 1e2) # Generate phenotype simulation parameters SP <- param.pheno(SP = SP, pop.ind = 100) # Generate selection parameters SP <- param.sel(SP = SP, sel.single = "ind") # Generate reproduction parameters SP <- param.reprod(SP = SP, reprod.way = "randexself") # Run annotation simulation SP <- annotation(SP) # Run genotype simulation SP <- genotype(SP) # Run phenotype simulation SP <- phenotype(SP) # Run selection SP <- selects(SP) # Run random mating excluding self-pollination SP <- mate.randexself(SP)
# Generate annotation simulation parameters SP <- param.annot(qtn.num = list(tr1 = 10)) # Generate genotype simulation parameters SP <- param.geno(SP = SP, pop.marker = 1e4, pop.ind = 1e2) # Generate phenotype simulation parameters SP <- param.pheno(SP = SP, pop.ind = 100) # Generate selection parameters SP <- param.sel(SP = SP, sel.single = "ind") # Generate reproduction parameters SP <- param.reprod(SP = SP, reprod.way = "randexself") # Run annotation simulation SP <- annotation(SP) # Run genotype simulation SP <- genotype(SP) # Run phenotype simulation SP <- phenotype(SP) # Run selection SP <- selects(SP) # Run random mating excluding self-pollination SP <- mate.randexself(SP)
Produce individuals by random-mating.
mate.randmate(SP, ncpus = 0, verbose = TRUE)
mate.randmate(SP, ncpus = 0, verbose = TRUE)
SP |
a list of all simulation parameters. |
ncpus |
the number of threads used, if NULL, (logical core number - 1) is automatically used. |
verbose |
whether to print detail. |
Build date: Nov 14, 2018 Last update: Apr 30, 2022
the function returns a list containing
the generations of simulated population.
reproduction method, it consists of 'clone', 'dh', 'selfpol', 'randmate', 'randexself', 'assort', 'disassort', '2waycro', '3waycro', '4waycro', 'backcro', and 'userped'.
the sex ratio of simulated population.
the progeny number of an individual.
a list of genotype simulation parameters.
a list of phenotype simulation parameters.
Dong Yin
# Generate annotation simulation parameters SP <- param.annot(qtn.num = list(tr1 = 10)) # Generate genotype simulation parameters SP <- param.geno(SP = SP, pop.marker = 1e4, pop.ind = 1e2) # Generate phenotype simulation parameters SP <- param.pheno(SP = SP, pop.ind = 100) # Generate selection parameters SP <- param.sel(SP = SP, sel.single = "ind") # Generate reproduction parameters SP <- param.reprod(SP = SP, reprod.way = "randmate") # Run annotation simulation SP <- annotation(SP) # Run genotype simulation SP <- genotype(SP) # Run phenotype simulation SP <- phenotype(SP) # Run selection SP <- selects(SP) # Run random mating SP <- mate.randmate(SP)
# Generate annotation simulation parameters SP <- param.annot(qtn.num = list(tr1 = 10)) # Generate genotype simulation parameters SP <- param.geno(SP = SP, pop.marker = 1e4, pop.ind = 1e2) # Generate phenotype simulation parameters SP <- param.pheno(SP = SP, pop.ind = 100) # Generate selection parameters SP <- param.sel(SP = SP, sel.single = "ind") # Generate reproduction parameters SP <- param.reprod(SP = SP, reprod.way = "randmate") # Run annotation simulation SP <- annotation(SP) # Run genotype simulation SP <- genotype(SP) # Run phenotype simulation SP <- phenotype(SP) # Run selection SP <- selects(SP) # Run random mating SP <- mate.randmate(SP)
Produce individuals by self-pollination.
mate.selfpol(SP, ncpus = 0, verbose = TRUE)
mate.selfpol(SP, ncpus = 0, verbose = TRUE)
SP |
a list of all simulation parameters. |
ncpus |
the number of threads used, if NULL, (logical core number - 1) is automatically used. |
verbose |
whether to print detail. |
Build date: Nov 14, 2018 Last update: Apr 30, 2022
the function returns a list containing
the generations of simulated population.
reproduction method, it consists of 'clone', 'dh', 'selfpol', 'randmate', 'randexself', 'assort', 'disassort', '2waycro', '3waycro', '4waycro', 'backcro', and 'userped'.
the sex ratio of simulated population.
the progeny number of an individual.
a list of genotype simulation parameters.
a list of phenotype simulation parameters.
Dong Yin
# Generate annotation simulation parameters SP <- param.annot(qtn.num = list(tr1 = 10)) # Generate genotype simulation parameters SP <- param.geno(SP = SP, pop.marker = 1e4, pop.ind = 1e2) # Generate phenotype simulation parameters SP <- param.pheno(SP = SP, pop.ind = 100) # Generate selection parameters SP <- param.sel(SP = SP, sel.single = "ind") # Generate reproduction parameters SP <- param.reprod(SP = SP, reprod.way = "selfpol") # Run annotation simulation SP <- annotation(SP) # Run genotype simulation SP <- genotype(SP) # Run phenotype simulation SP <- phenotype(SP) # Run selection SP <- selects(SP) # Run self-pollination SP <- mate.selfpol(SP)
# Generate annotation simulation parameters SP <- param.annot(qtn.num = list(tr1 = 10)) # Generate genotype simulation parameters SP <- param.geno(SP = SP, pop.marker = 1e4, pop.ind = 1e2) # Generate phenotype simulation parameters SP <- param.pheno(SP = SP, pop.ind = 100) # Generate selection parameters SP <- param.sel(SP = SP, sel.single = "ind") # Generate reproduction parameters SP <- param.reprod(SP = SP, reprod.way = "selfpol") # Run annotation simulation SP <- annotation(SP) # Run genotype simulation SP <- genotype(SP) # Run phenotype simulation SP <- phenotype(SP) # Run selection SP <- selects(SP) # Run self-pollination SP <- mate.selfpol(SP)
Produce individuals by user-specified pedigree mating.
mate.userped(SP, ncpus = 0, verbose = TRUE)
mate.userped(SP, ncpus = 0, verbose = TRUE)
SP |
a list of all simulation parameters. |
ncpus |
the number of threads used, if NULL, (logical core number - 1) is automatically used. |
verbose |
whether to print detail. |
Build date: Apr 12, 2022 Last update: Apr 30, 2022
the function returns a list containing
the generations of simulated population.
reproduction method, it consists of 'clone', 'dh', 'selfpol', 'randmate', 'randexself', 'assort', 'disassort', '2waycro', '3waycro', '4waycro', 'backcro', and 'userped'.
the sex ratio of simulated population.
the progeny number of an individual.
a list of genotype simulation parameters.
a list of phenotype simulation parameters.
Dong Yin
# Generate annotation simulation parameters SP <- param.annot(qtn.num = list(tr1 = 10)) # Generate genotype simulation parameters SP <- param.geno(SP = SP, pop.marker = 1e4, pop.ind = 1e2) # Generate phenotype simulation parameters SP <- param.pheno(SP = SP, pop.ind = 100) # Generate reproduction parameters SP <- param.reprod(SP = SP, reprod.way = "userped") # Run annotation simulation SP <- annotation(SP) # Run genotype simulation SP <- genotype(SP) # Run phenotype simulation SP <- phenotype(SP) # Run user-specified pedigree mating SP <- mate.userped(SP)
# Generate annotation simulation parameters SP <- param.annot(qtn.num = list(tr1 = 10)) # Generate genotype simulation parameters SP <- param.geno(SP = SP, pop.marker = 1e4, pop.ind = 1e2) # Generate phenotype simulation parameters SP <- param.pheno(SP = SP, pop.ind = 100) # Generate reproduction parameters SP <- param.reprod(SP = SP, reprod.way = "userped") # Run annotation simulation SP <- annotation(SP) # Run genotype simulation SP <- genotype(SP) # Run phenotype simulation SP <- phenotype(SP) # Run user-specified pedigree mating SP <- mate.userped(SP)
Generate parameters for annotation data simulation.
param.annot(SP = NULL, ...)
param.annot(SP = NULL, ...)
SP |
a list of all simulation parameters. |
... |
one or more parameter(s) for map simulation. |
Build date: Feb 24, 2022 Last update: Jul 10, 2022
the function returns a list containing
the map data with annotation information.
the species of genetic map, which can be "arabidopsis", "cattle", "chicken", "dog", "horse", "human", "maize", "mice", "pig", and "rice".
the number of markers.
the number of chromosomes.
the length of chromosomes.
the genetic model of QTN such as 'A + D'.
the QTN index for each trait.
the QTN number for (each group in) each trait.
the QTN distribution containing 'norm', 'geom', 'gamma' or 'beta'.
the standard deviations for normal distribution.
the probability of success for geometric distribution.
the shape parameter for gamma distribution.
the scale parameter for gamma distribution.
the shape1 parameter for beta distribution.
the shape2 parameter for beta distribution.
the ncp parameter for beta distribution.
the QTN distribution probability in each block.
the block length.
the maf threshold, markers less than this threshold will be exclude.
whether to generate recombination events.
the recombination times range in the hot spot.
the recombination times range in the cold spot.
Dong Yin
SP <- param.annot(qtn.num = list(tr1 = 10)) str(SP)
SP <- param.annot(qtn.num = list(tr1 = 10)) str(SP)
Generate parameters for genotype data simulation.
param.geno(SP = NULL, ...)
param.geno(SP = NULL, ...)
SP |
a list of all simulation parameters. |
... |
one or more parameter(s) for genotype simulation. |
Build date: Feb 21, 2022 Last update: Jul 4, 2022
the function returns a list containing
the genotype data.
'1':one-column genotype represents an individual; '2': two-column genotype represents an individual.
the number of markers.
the number of individuals in the base population.
the genotype code probability.
the mutation rate of the genotype data.
whether to generate a complete LD genotype data when 'incols == 2'.
Dong Yin
SP <- param.geno(pop.marker = 1e4, pop.ind = 1e2) str(SP)
SP <- param.geno(pop.marker = 1e4, pop.ind = 1e2) str(SP)
Generate parameters for global options.
param.global(SP = NULL, ...)
param.global(SP = NULL, ...)
SP |
a list of all simulation parameters. |
... |
one or more parameter(s) for global options. |
Build date: Apr 16, 2022 Last update: Jul 4, 2022
the function returns a list containing
the replication times of simulation.
simulation random seed.
the prefix of output files.
the path of output files, Simer writes files only if outpath is not 'NULL'.
'numeric' or 'plink', the data format of output files.
the generations of simulated population.
the output generations of genotype data.
the output generations of phenotype data.
whether to use all genotype data to simulate phenotype.
the number of threads used, if NULL, (logical core number - 1) is automatically used.
whether to print detail.
Dong Yin
SP <- param.global(out = "simer") str(SP)
SP <- param.global(out = "simer") str(SP)
Generate parameters for phenotype data simulation.
param.pheno(SP = NULL, ...)
param.pheno(SP = NULL, ...)
SP |
a list of all simulation parameters. |
... |
one or more parameter(s) for phenotype simulation. |
Build date: Feb 21, 2022 Last update: Jul 4, 2022
the function returns a list containing
the population information containing environmental factors and other effects.
the number of individuals in the base population.
the repeated times of repeated records.
whether repeated records are balanced.
a list of environmental factors setting.
a list of phenotype types.
a list of genetic model of phenotype such as "T1 = A + E".
a list of additive heritability.
a list of dominant heritability.
a list of GxG interaction heritability.
a list of GxE interaction heritability.
a list of permanent environmental heritability.
a list of phenotype variance.
the additive genetic correlation matrix.
the dominant genetic correlation matrix.
the GxG genetic correlation matrix.
the permanent environmental correlation matrix.
the residual correlation matrix.
Dong Yin
SP <- param.pheno(phe.model = list(tr1 = "T1 = A + E")) str(SP)
SP <- param.pheno(phe.model = list(tr1 = "T1 = A + E")) str(SP)
Generate parameters for reproduction.
param.reprod(SP = NULL, ...)
param.reprod(SP = NULL, ...)
SP |
a list of all simulation parameters. |
... |
one or more parameter(s) for reproduction. |
Build date: Apr 6, 2022 Last update: Jul 4, 2022
the function returns a list containing
the generations of simulated population.
reproduction method, it consists of 'clone', 'dh', 'selfpol', 'randmate', 'randexself', 'assort', 'disassort', '2waycro', '3waycro', '4waycro', 'backcro', and 'userped'.
the male rate in the population.
the progeny number of an individual.
Dong Yin
SP <- param.reprod(reprod.way = "randmate") str(SP)
SP <- param.reprod(reprod.way = "randmate") str(SP)
Generate parameters for selection.
param.sel(SP = NULL, ...)
param.sel(SP = NULL, ...)
SP |
a list of all simulation parameters. |
... |
one or more parameter(s) for selection. |
Build date: Apr 6, 2022 Last update: Jul 4, 2022
the function returns a list containing
the selected males and females.
if ps <= 1, fraction selected in selection of males and females; if ps > 1, ps is number of selected males and females.
whether the sort order is decreasing.
the selection criteria, it can be 'TBV', 'TGV', and 'pheno'.
the single-trait selection method, it can be 'ind', 'fam', 'infam', and 'comb'.
the multiple-trait selection method, it can be 'index', 'indcul', and 'tmd'.
the weight of each trait for multiple-trait selection.
the index of tandem selection for multiple-trait selection.
the percentage of goal more than the mean of scores of individuals.
the percentage of expected excellent individuals.
Dong Yin
SP <- param.sel(sel.single = "ind") str(SP)
SP <- param.sel(sel.single = "ind") str(SP)
Generate parameters for Simer.
param.simer(SP = NULL, ...)
param.simer(SP = NULL, ...)
SP |
a list of all simulation parameters. |
... |
one or more parameter(s) for simer. |
Build date: Apr 17, 2022 Last update: Jul 4, 2022
the function returns a list containing
a list of global parameters.
a list of marker information parameters.
a list of genotype simulation parameters.
a list of phenotype simulation parameters.
a list of selection parameters.
a list of reproduction parameters.
Dong Yin
SP <- param.simer(out = "simer") str(SP)
SP <- param.simer(out = "simer") str(SP)
Generate single-trait or multiple-trait phenotype by mixed model.
phenotype(SP = NULL, verbose = TRUE)
phenotype(SP = NULL, verbose = TRUE)
SP |
a list of all simulation parameters. |
verbose |
whether to print detail. |
Build date: Nov 14, 2018 Last update: Apr 28, 2022
the function returns a list containing
the population information containing environmental factors and other effects.
the number of individuals in the base population.
the repeated times of repeated records.
whether repeated records are balanced.
a list of environmental factors setting.
a list of phenotype types.
a list of genetic model of phenotype such as "T1 = A + E".
a list of additive heritability.
a list of dominant heritability.
a list of GxG interaction heritability.
a list of GxE interaction heritability.
a list of permanent environmental heritability.
a list of phenotype variance.
the additive genetic correlation matrix.
the dominant genetic correlation matrix.
the GxG genetic correlation matrix.
the permanent environmental correlation matrix.
the residual correlation matrix.
Dong Yin
Kao C and Zeng Z (2002) <https://www.genetics.org/content/160/3/1243.long>
# Prepare environmental factor list pop.env <- list( F1 = list( # fixed effect 1 level = c("1", "2"), effect = list(tr1 = c(50, 30), tr2 = c(50, 30)) ), F2 = list( # fixed effect 2 level = c("d1", "d2", "d3"), effect = list(tr1 = c(10, 20, 30), tr2 = c(10, 20, 30)) ), C1 = list( # covariate 1 level = c(70, 80, 90), slope = list(tr1 = 1.5, tr2 = 1.5) ), R1 = list( # random effect 1 level = c("l1", "l2", "l3"), ratio = list(tr1 = 0.1, tr2 = 0.1) ) ) # Generate genotype simulation parameters SP <- param.annot(qtn.num = list(tr1 = c(2, 8), tr2 = 10), qtn.model = "A + D + A:D") # Generate annotation simulation parameters SP <- param.geno(SP = SP, pop.marker = 1e4, pop.ind = 1e2) # Generate phenotype simulation parameters SP <- param.pheno( SP = SP, pop.ind = 100, pop.rep = 2, # 2 repeated record pop.rep.bal = TRUE, # balanced repeated record pop.env = pop.env, phe.type = list( tr1 = "continuous", tr2 = list(case = 0.01, control = 0.99) ), phe.model = list( tr1 = "T1 = A + D + A:D + F1 + F2 + C1 + R1 + A:F1 + E", tr2 = "T2 = A + D + A:D + F1 + F2 + C1 + R1 + A:F1 + E" ), phe.var = list(tr1 = 100, tr2 = 100) ) # Run annotation simulation SP <- annotation(SP) # Run genotype simulation SP <- genotype(SP) # Run phenotype simulation SP <- phenotype(SP)
# Prepare environmental factor list pop.env <- list( F1 = list( # fixed effect 1 level = c("1", "2"), effect = list(tr1 = c(50, 30), tr2 = c(50, 30)) ), F2 = list( # fixed effect 2 level = c("d1", "d2", "d3"), effect = list(tr1 = c(10, 20, 30), tr2 = c(10, 20, 30)) ), C1 = list( # covariate 1 level = c(70, 80, 90), slope = list(tr1 = 1.5, tr2 = 1.5) ), R1 = list( # random effect 1 level = c("l1", "l2", "l3"), ratio = list(tr1 = 0.1, tr2 = 0.1) ) ) # Generate genotype simulation parameters SP <- param.annot(qtn.num = list(tr1 = c(2, 8), tr2 = 10), qtn.model = "A + D + A:D") # Generate annotation simulation parameters SP <- param.geno(SP = SP, pop.marker = 1e4, pop.ind = 1e2) # Generate phenotype simulation parameters SP <- param.pheno( SP = SP, pop.ind = 100, pop.rep = 2, # 2 repeated record pop.rep.bal = TRUE, # balanced repeated record pop.env = pop.env, phe.type = list( tr1 = "continuous", tr2 = list(case = 0.01, control = 0.99) ), phe.model = list( tr1 = "T1 = A + D + A:D + F1 + F2 + C1 + R1 + A:F1 + E", tr2 = "T2 = A + D + A:D + F1 + F2 + C1 + R1 + A:F1 + E" ), phe.var = list(tr1 = 100, tr2 = 100) ) # Run annotation simulation SP <- annotation(SP) # Run genotype simulation SP <- genotype(SP) # Run phenotype simulation SP <- phenotype(SP)
Raw genotype matrix from outside in simdata
data(simdata)
data(simdata)
matrix
data(simdata) dim(pop.geno) head(pop.geno)
data(simdata) dim(pop.geno) head(pop.geno)
Map file from outside in simdata
data(simdata)
data(simdata)
list
data(simdata) dim(pop.map) head(pop.map)
data(simdata) dim(pop.map) head(pop.map)
Remove big.matrix safely.
remove_bigmatrix(x, desc_suffix = ".geno.desc", bin_suffix = ".geno.bin")
remove_bigmatrix(x, desc_suffix = ".geno.desc", bin_suffix = ".geno.bin")
x |
the filename of big.matrix. |
desc_suffix |
the suffix of description file of big.matrix. |
bin_suffix |
the suffix of binary file of big.matrix. |
Build date: Aug 8, 2019 Last update: Apr 30, 2022
TRUE or FALSE
Haohao Zhang and Dong Yin
library(bigmemory) mat <- filebacked.big.matrix( nrow = 10, ncol = 10, init = 0, type = 'char', backingpath = ".", backingfile = 'simer.geno.bin', descriptorfile = 'simer.geno.desc') remove_bigmatrix(x = "simer")
library(bigmemory) mat <- filebacked.big.matrix( nrow = 10, ncol = 10, init = 0, type = 'char', backingpath = ".", backingfile = 'simer.geno.bin', descriptorfile = 'simer.geno.desc') remove_bigmatrix(x = "simer")
Population reproduction by different mate design.
reproduces(SP, ncpus = 0, verbose = TRUE)
reproduces(SP, ncpus = 0, verbose = TRUE)
SP |
a list of all simulation parameters. |
ncpus |
the number of threads used, if NULL, (logical core number - 1) is automatically used. |
verbose |
whether to print detail. |
Build date: Nov 14, 2018 Last update: Apr 29, 2022
the function returns a list containing
the generations of simulated population.
reproduction method, it consists of 'clone', 'dh', 'selfpol', 'randmate', 'randexself', 'assort', 'disassort', '2waycro', '3waycro', '4waycro', 'backcro', and 'userped'.
the male rate in the population.
the progeny number of an individual.
a list of genotype simulation parameters.
a list of phenotype simulation parameters.
Dong Yin
# Generate annotation simulation parameters SP <- param.annot(qtn.num = list(tr1 = 10)) # Generate genotype simulation parameters SP <- param.geno(SP = SP, pop.marker = 1e4, pop.ind = 1e2) # Generate phenotype simulation parameters SP <- param.pheno(SP = SP, pop.ind = 100) # Generate selection parameters SP <- param.sel(SP = SP, sel.single = "ind") # Generate reproduction parameters SP <- param.reprod(SP = SP, reprod.way = "randmate") # Run annotation simulation SP <- annotation(SP) # Run genotype simulation SP <- genotype(SP) # Run phenotype simulation SP <- phenotype(SP) # Run selection SP <- selects(SP) # Run reproduction SP <- reproduces(SP)
# Generate annotation simulation parameters SP <- param.annot(qtn.num = list(tr1 = 10)) # Generate genotype simulation parameters SP <- param.geno(SP = SP, pop.marker = 1e4, pop.ind = 1e2) # Generate phenotype simulation parameters SP <- param.pheno(SP = SP, pop.ind = 100) # Generate selection parameters SP <- param.sel(SP = SP, sel.single = "ind") # Generate reproduction parameters SP <- param.reprod(SP = SP, reprod.way = "randmate") # Run annotation simulation SP <- annotation(SP) # Run genotype simulation SP <- genotype(SP) # Run phenotype simulation SP <- phenotype(SP) # Run selection SP <- selects(SP) # Run reproduction SP <- reproduces(SP)
Select individuals by combination of selection method and criterion.
selects(SP = NULL, verbose = TRUE)
selects(SP = NULL, verbose = TRUE)
SP |
a list of all simulation parameters. |
verbose |
whether to print detail. |
Build date: Sep 8, 2018 Last update: Apr 30, 2022
the function returns a list containing
the selected males and females.
if ps <= 1, fraction selected in selection of males and females; if ps > 1, ps is number of selected males and females.
whether the sort order is decreasing.
the selection criteria, it can be 'TBV', 'TGV', and 'pheno'.
the single-trait selection method, it can be 'ind', 'fam', 'infam', and 'comb'.
the multiple-trait selection method, it can be 'index', 'indcul', and 'tmd'.
the weight of each trait for multiple-trait selection.
the index of tandem selection for multiple-trait selection.
the percentage of goal more than the mean of scores of individuals.
the percentage of expected excellent individuals.
Dong Yin
# Generate annotation simulation parameters SP <- param.annot(qtn.num = list(tr1 = 10)) # Generate genotype simulation parameters SP <- param.geno(SP = SP, pop.marker = 1e4, pop.ind = 1e2) # Generate phenotype simulation parameters SP <- param.pheno(SP = SP, pop.ind = 100) # Generate selection parameters SP <- param.sel(SP = SP, sel.single = "ind") # Run annotation simulation SP <- annotation(SP) # Run genotype simulation SP <- genotype(SP) # Run phenotype simulation SP <- phenotype(SP) # Run selection SP <- selects(SP)
# Generate annotation simulation parameters SP <- param.annot(qtn.num = list(tr1 = 10)) # Generate genotype simulation parameters SP <- param.geno(SP = SP, pop.marker = 1e4, pop.ind = 1e2) # Generate phenotype simulation parameters SP <- param.pheno(SP = SP, pop.ind = 100) # Generate selection parameters SP <- param.sel(SP = SP, sel.single = "ind") # Run annotation simulation SP <- annotation(SP) # Run genotype simulation SP <- genotype(SP) # Run phenotype simulation SP <- phenotype(SP) # Run selection SP <- selects(SP)
Main function of Simer.
simer(SP)
simer(SP)
SP |
a list of all simulation parameters. |
Build date: Jan 7, 2019 Last update: Apr 29, 2022
the function returns a list containing
a list of global parameters.
a list of marker information parameters.
a list of genotype simulation parameters.
a list of phenotype simulation parameters.
a list of selection parameters.
a list of reproduction parameters.
Dong Yin, Lilin Yin, Haohao Zhang, and Xiaolei Liu
# Generate all simulation parameters SP <- param.simer(out = "simer") # Run Simer SP <- simer(SP)
# Generate all simulation parameters SP <- param.simer(out = "simer") # Run Simer SP <- simer(SP)
Make data quality control for genotype, phenotype, and pedigree.
simer.Data(jsonList = NULL, out = "simer.qc", ncpus = 0, verbose = TRUE)
simer.Data(jsonList = NULL, out = "simer.qc", ncpus = 0, verbose = TRUE)
jsonList |
a list of data quality control parameters. |
out |
the prefix of output files. |
ncpus |
the number of threads used, if NULL, (logical core number - 1) is automatically used. |
verbose |
whether to print detail. |
Build date: May 26, 2021 Last update: Apr 28, 2022
the function returns a list containing
the path of genotype data.
the filename of pedigree data.
the selection index for all traits.
the breeding value index for all traits.
a list of parameters for data quality control.
a list of parameters for genetic evaluation.
Dong Yin
# Read JSON file jsonFile <- system.file("extdata", "04breeding_plan", "plan1.json", package = "simer") jsonList <- jsonlite::fromJSON(txt = jsonFile, simplifyVector = FALSE) ## Not run: # It needs 'plink' and 'hiblup' software jsonList <- simer.Data(jsonList = jsonList) ## End(Not run)
# Read JSON file jsonFile <- system.file("extdata", "04breeding_plan", "plan1.json", package = "simer") jsonList <- jsonlite::fromJSON(txt = jsonFile, simplifyVector = FALSE) ## Not run: # It needs 'plink' and 'hiblup' software jsonList <- simer.Data(jsonList = jsonList) ## End(Not run)
transforming plink binary data to MVP package.
simer.Data.Bfile2MVP( bfile, out = "simer", maxLine = 10000, priority = "speed", type.geno = "char", threads = 10, verbose = TRUE )
simer.Data.Bfile2MVP( bfile, out = "simer", maxLine = 10000, priority = "speed", type.geno = "char", threads = 10, verbose = TRUE )
bfile |
Genotype in binary format (.bed, .bim, .fam). |
out |
the name of output file. |
maxLine |
the max number of line to write to big matrix for each loop. |
priority |
'memory' or 'speed'. |
type.geno |
the type of genotype elements. |
threads |
number of thread for transforming. |
verbose |
whether to print the reminder. |
Build date: Sep 12, 2018 Last update: July 25, 2022
number of individuals and markers. Output files: genotype.desc, genotype.bin: genotype file in bigmemory format phenotype.phe: ordered phenotype file, same taxa order with genotype file map.map: SNP information
Haohao Zhang and Dong Yin
# Get bfile path bfilePath <- file.path(system.file("extdata", "02plinkb", package = "simer"), "demo") # Data converting simer.Data.Bfile2MVP(bfilePath, tempfile("outfile"))
# Get bfile path bfilePath <- file.path(system.file("extdata", "02plinkb", package = "simer"), "demo") # Data converting simer.Data.Bfile2MVP(bfilePath, tempfile("outfile"))
The function of calling HIBLUP software of C version.
simer.Data.cHIBLUP( jsonList = NULL, hiblupPath = "", mode = "A", vc.method = "AI", ncpus = 10, verbose = TRUE )
simer.Data.cHIBLUP( jsonList = NULL, hiblupPath = "", mode = "A", vc.method = "AI", ncpus = 10, verbose = TRUE )
jsonList |
the list of genetic evaluation parameters. |
hiblupPath |
the path of HIBLUP software. |
mode |
'A' or 'AD', Additive effect model or Additive and Dominance model. |
vc.method |
default is 'AI', the method of calculating variance components in HIBLUP software. |
ncpus |
the number of threads used, if NULL, (logical core number - 1) is automatically used. |
verbose |
whether to print detail. |
Build date: June 28, 2021 Last update: Apr 28, 2022
the function returns a list containing
a list of estimated random effects.
a list of variance components.
the genetic covariance matrix for all traits.
the genetic correlation matrix for all traits.
Dong Yin
# Read JSON file jsonFile <- system.file("extdata", "04breeding_plan", "plan1.json", package = "simer") jsonList <- jsonlite::fromJSON(txt = jsonFile, simplifyVector = FALSE) ## Not run: # It needs 'hiblup' software gebvs <- simer.Data.cHIBLUP(jsonList = jsonList) ## End(Not run)
# Read JSON file jsonFile <- system.file("extdata", "04breeding_plan", "plan1.json", package = "simer") jsonList <- jsonlite::fromJSON(txt = jsonFile, simplifyVector = FALSE) ## Not run: # It needs 'hiblup' software gebvs <- simer.Data.cHIBLUP(jsonList = jsonList) ## End(Not run)
To find appropriate fixed effects, covariates, and random effects.
simer.Data.Env( jsonList = NULL, hiblupPath = "", header = TRUE, sep = "\t", ncpus = 10, verbose = TRUE )
simer.Data.Env( jsonList = NULL, hiblupPath = "", header = TRUE, sep = "\t", ncpus = 10, verbose = TRUE )
jsonList |
the list of environmental factor selection parameters. |
hiblupPath |
the path of HIBLUP software. |
header |
the header of file. |
sep |
the separator of file. |
ncpus |
the number of threads used, if NULL, (logical core number - 1) is automatically used. |
verbose |
whether to print detail. |
Build date: July 17, 2021 Last update: Apr 28, 2022
the function returns a list containing
the path of genotype data.
the filename of pedigree data.
the selection index for all traits.
the breeding value index for all traits.
a list of parameters for data quality control.
a list of parameters for genetic evaluation.
Dong Yin
# Read JSON file jsonFile <- system.file("extdata", "04breeding_plan", "plan1.json", package = "simer") jsonList <- jsonlite::fromJSON(txt = jsonFile, simplifyVector = FALSE) ## Not run: # It needs 'hiblup' solfware jsonList <- simer.Data.Env(jsonList = jsonList) ## End(Not run)
# Read JSON file jsonFile <- system.file("extdata", "04breeding_plan", "plan1.json", package = "simer") jsonList <- jsonlite::fromJSON(txt = jsonFile, simplifyVector = FALSE) ## Not run: # It needs 'hiblup' solfware jsonList <- simer.Data.Env(jsonList = jsonList) ## End(Not run)
Data quality control for genotype data in MVP format and PLINK format.
simer.Data.Geno( fileMVP = NULL, fileBed = NULL, filePlinkPed = NULL, filePed = NULL, filePhe = NULL, out = "simer.qc", genoType = "char", filter = NULL, filterGeno = NULL, filterHWE = NULL, filterMind = NULL, filterMAF = NULL, ncpus = 0, verbose = TRUE )
simer.Data.Geno( fileMVP = NULL, fileBed = NULL, filePlinkPed = NULL, filePed = NULL, filePhe = NULL, out = "simer.qc", genoType = "char", filter = NULL, filterGeno = NULL, filterHWE = NULL, filterMind = NULL, filterMAF = NULL, ncpus = 0, verbose = TRUE )
fileMVP |
genotype in MVP format. |
fileBed |
genotype in PLINK binary format. |
filePlinkPed |
genotype in PLINK numeric format. |
filePed |
the filename of pedigree data. |
filePhe |
the filename of phenotype data, it can be a vector. |
out |
the prefix of output files. |
genoType |
type parameter in bigmemory, genotype data. The default is char, it is highly recommended *NOT* to modify this parameter. |
filter |
filter of genotyped individual. |
filterGeno |
threshold of sample miss rate. |
filterHWE |
threshold of Hardy-Weinberg Test. |
filterMind |
threshold of variant miss rate. |
filterMAF |
threshold of Minor Allele Frequency. |
ncpus |
the number of threads used, if NULL, (logical core number - 1) is automatically used. |
verbose |
whether to print detail. |
Build date: May 26, 2021 Last update: Apr 28, 2022
the function returns files
the .bed file of PLINK binary format.
the .bim file of PLINK binary format.
the .fam file of PLINK binary format.
Dong Yin
# Get the prefix of genotype data fileBed <- system.file("extdata", "02plinkb", "demo", package = "simer") ## Not run: # It needs 'plink' software simer.Data.Geno(fileBed=fileBed) ## End(Not run)
# Get the prefix of genotype data fileBed <- system.file("extdata", "02plinkb", "demo", package = "simer") ## Not run: # It needs 'plink' software simer.Data.Geno(fileBed=fileBed) ## End(Not run)
Impute the missing value within genotype data.
simer.Data.Impute( fileMVP = NULL, fileBed = NULL, out = NULL, maxLine = 10000, ncpus = 0, verbose = TRUE )
simer.Data.Impute( fileMVP = NULL, fileBed = NULL, out = NULL, maxLine = 10000, ncpus = 0, verbose = TRUE )
fileMVP |
genotype in MVP format. |
fileBed |
genotype in PLINK binary format. |
out |
the name of output file. |
maxLine |
number of SNPs, only used for saving memory when calculate kinship matrix. |
ncpus |
the number of threads used, if NULL, (logical core number - 1) is automatically used. |
verbose |
whether to print detail. |
Build date: May 26, 2021 Last update: Apr 28, 2022
the function returns files
the description file of genotype data.
the binary file of genotype data.
the genotyped individual file.
the marker information data file.
Dong Yin
# Get the prefix of genotype data fileMVP <- system.file("extdata", "02plinkb", "demo", package = "simer") ## Not run: # It needs 'beagle' software fileMVPimp <- simer.Data.Impute(fileBed = fileBed) ## End(Not run)
# Get the prefix of genotype data fileMVP <- system.file("extdata", "02plinkb", "demo", package = "simer") ## Not run: # It needs 'beagle' software fileMVPimp <- simer.Data.Impute(fileBed = fileBed) ## End(Not run)
Make data quality control by JSON file.
simer.Data.Json( jsonFile, hiblupPath = "", out = "simer.qc", dataQC = TRUE, buildModel = TRUE, buildIndex = TRUE, ncpus = 10, verbose = TRUE )
simer.Data.Json( jsonFile, hiblupPath = "", out = "simer.qc", dataQC = TRUE, buildModel = TRUE, buildIndex = TRUE, ncpus = 10, verbose = TRUE )
jsonFile |
the path of JSON file. |
hiblupPath |
the path of HIBLUP software. |
out |
the prefix of output files. |
dataQC |
whether to make data quality control. |
buildModel |
whether to build EBV model. |
buildIndex |
whether to build Selection Index. |
ncpus |
the number of threads used, if NULL, (logical core number - 1) is automatically used. |
verbose |
whether to print detail. |
Build date: Oct 19, 2020 Last update: Apr 28, 2022
the function returns a list containing
the path of genotype data.
the filename of pedigree data.
the selection index for all traits.
the breeding value index for all traits.
a list of parameters for data quality control.
a list of parameters for genetic evaluation.
Dong Yin
# Get JSON file jsonFile <- system.file("extdata", "04breeding_plan", "plan1.json", package = "simer") ## Not run: # It needs 'plink' and 'hiblup' software jsonList <- simer.Data.Json(jsonFile = jsonFile) ## End(Not run)
# Get JSON file jsonFile <- system.file("extdata", "04breeding_plan", "plan1.json", package = "simer") ## Not run: # It needs 'plink' and 'hiblup' software jsonList <- simer.Data.Json(jsonFile = jsonFile) ## End(Not run)
constructing EMMA kinship matrix.
simer.Data.Kin( fileKin = TRUE, fileMVP = "simer", out = NULL, method = "EMMA", sep = "\t", threads = 10, verbose = TRUE )
simer.Data.Kin( fileKin = TRUE, fileMVP = "simer", out = NULL, method = "EMMA", sep = "\t", threads = 10, verbose = TRUE )
fileKin |
kinship that represents relationship among individuals, n * n matrix, n is sample size. |
fileMVP |
prefix for mvp format files. |
out |
prefix of output file name. |
method |
only"EMMA" method for now. |
sep |
seperator for Kinship file. |
threads |
the number of cpu. |
verbose |
whether to print detail. |
Build date: Apr 19, 2023 Last update: Apr 19, 2023
Output file: <out>.kin.bin <out>.kin.desc
Haohao Zhang and Dong Yin
# Get the prefix of genotype data fileMVP <- system.file("extdata", "01bigmemory", "demo", package = "simer") # Check map data simer.Data.Kin(fileKin = TRUE, fileMVP = fileMVP, out = tempfile("outfile"))
# Get the prefix of genotype data fileMVP <- system.file("extdata", "01bigmemory", "demo", package = "simer") # Check map data simer.Data.Kin(fileKin = TRUE, fileMVP = fileMVP, out = tempfile("outfile"))
checking map file.
simer.Data.Map( map, out = "simer", cols = 1:5, header = TRUE, sep = "\t", verbose = TRUE )
simer.Data.Map( map, out = "simer", cols = 1:5, header = TRUE, sep = "\t", verbose = TRUE )
map |
the name of map file or map object(data.frame or matrix). |
out |
the name of output file. |
cols |
selected columns. |
header |
whether the file contains header. |
sep |
seperator of the file. |
verbose |
whether to print detail. |
Build date: Sep 12, 2018 Last update: July 25, 2022
Output file: <out>.map
Haohao Zhang and Dong Yin
# Get map path mapPath <- system.file("extdata", "01bigmemory", "demo.geno.map", package = "simer") # Check map data simer.Data.Map(mapPath, tempfile("outfile"))
# Get map path mapPath <- system.file("extdata", "01bigmemory", "demo.geno.map", package = "simer") # Check map data simer.Data.Map(mapPath, tempfile("outfile"))
transforming MVP data to binary format.
simer.Data.MVP2Bfile( bigmat, map, pheno = NULL, out = "simer", threads = 10, verbose = TRUE )
simer.Data.MVP2Bfile( bigmat, map, pheno = NULL, out = "simer", threads = 10, verbose = TRUE )
bigmat |
Genotype in bigmatrix format (0,1,2). |
map |
the map file. |
pheno |
the phenotype file. |
out |
the name of output file. |
threads |
the number of threads used, if NULL, (logical core number - 1) is automatically used. |
verbose |
whether to print the reminder. |
Build date: Sep 12, 2018 Last update: July 20, 2022
NULL Output files: .bed, .bim, .fam
Haohao Zhang and Dong Yin
# Generate bigmat and map bigmat <- as.big.matrix(matrix(1:6, 3, 2)) map <- generate.map(pop.marker = 3) # Data converting simer.Data.MVP2Bfile(bigmat, map, out=tempfile("outfile"))
# Generate bigmat and map bigmat <- as.big.matrix(matrix(1:6, 3, 2)) map <- generate.map(pop.marker = 3) # Data converting simer.Data.MVP2Bfile(bigmat, map, out=tempfile("outfile"))
Convert genotype data from MVP format to MVP format.
simer.Data.MVP2MVP(fileMVP, genoType = "char", out = "simer", verbose = TRUE)
simer.Data.MVP2MVP(fileMVP, genoType = "char", out = "simer", verbose = TRUE)
fileMVP |
the prefix of MVP file. |
genoType |
type parameter in bigmemory data. The default is 'char', it is highly recommended *NOT* to modify this parameter. |
out |
the prefix of output files. |
verbose |
whether to print detail. |
Build date: May 26, 2021 Last update: Apr 28, 2022
the function returns files
the description file of genotype data.
the binary file of genotype data.
the genotyped individual file.
the marker information data file.
Dong Yin
# Get the prefix of genotype data fileMVP <- system.file("extdata", "01bigmemory", "demo", package = "simer") # Convert genotype data from MVP to MVP simer.Data.MVP2MVP(fileMVP, out = tempfile("outfile"))
# Get the prefix of genotype data fileMVP <- system.file("extdata", "01bigmemory", "demo", package = "simer") # Convert genotype data from MVP to MVP simer.Data.MVP2MVP(fileMVP, out = tempfile("outfile"))
Data quality control for pedigree data.
simer.Data.Ped( filePed, fileMVP = NULL, out = NULL, standardID = FALSE, fileSir = NULL, fileDam = NULL, exclThres = 0.1, assignThres = 0.05, header = TRUE, sep = "\t", ncpus = 0, verbose = TRUE )
simer.Data.Ped( filePed, fileMVP = NULL, out = NULL, standardID = FALSE, fileSir = NULL, fileDam = NULL, exclThres = 0.1, assignThres = 0.05, header = TRUE, sep = "\t", ncpus = 0, verbose = TRUE )
filePed |
the filename of pedigree need correcting. |
fileMVP |
genotype in MVP format. |
out |
the prefix of output file. |
standardID |
whether kid id is 15-character standard. |
fileSir |
the filename of candidate sires. |
fileDam |
the filename of candidate dams. |
exclThres |
if conflict ratio is more than exclThres, exclude this parent. |
assignThres |
if conflict ratio is less than assignThres, assign this parent to the individual. |
header |
whether the file contains header. |
sep |
separator of the file. |
ncpus |
the number of threads used, if NULL, (logical core number - 1) is automatically used. |
verbose |
whether to print detail. |
Build date: May 6, 2021 Last update: Apr 28, 2022
the function returns files
the report file containing correction condition.
the file containing pedigree error.
the pedigree file after correction.
Lilin Yin and Dong Yin
# Get the filename of pedigree data filePed <- system.file("extdata", "05others", "pedigree.txt", package = "simer") # Get the prefix of genotype data fileMVP <- system.file("extdata", "01bigmemory", "demo", package = "simer") # Run pedigree correction simer.Data.Ped(filePed = filePed, fileMVP = fileMVP, out = tempfile("outfile"))
# Get the filename of pedigree data filePed <- system.file("extdata", "05others", "pedigree.txt", package = "simer") # Get the prefix of genotype data fileMVP <- system.file("extdata", "01bigmemory", "demo", package = "simer") # Run pedigree correction simer.Data.Ped(filePed = filePed, fileMVP = fileMVP, out = tempfile("outfile"))
Data quality control for phenotype data.
simer.Data.Pheno( filePhe = NULL, filePed = NULL, out = NULL, planPhe = NULL, pheCols = NULL, header = TRUE, sep = "\t", missing = c(NA, "NA", "Na", ".", "-", "NAN", "nan", "na", "N/A", "n/a", "<NA>", "", "-9", 9999), verbose = TRUE )
simer.Data.Pheno( filePhe = NULL, filePed = NULL, out = NULL, planPhe = NULL, pheCols = NULL, header = TRUE, sep = "\t", missing = c(NA, "NA", "Na", ".", "-", "NAN", "nan", "na", "N/A", "n/a", "<NA>", "", "-9", 9999), verbose = TRUE )
filePhe |
the phenotype files, it can be a vector. |
filePed |
the pedigree files, it can be a vector. |
out |
the prefix of output file. |
planPhe |
the plans for phenotype quality control. |
pheCols |
the column needing extracting. |
header |
the header of file. |
sep |
the separator of file. |
missing |
the missing value. |
verbose |
whether to print detail. |
Build date: June 13, 2021 Last update: Apr 28, 2022
the function returns files
the phenotype file after correction.
Haohao Zhang and Dong Yin
# Get the filename of phenotype data filePhe <- system.file("extdata", "05others", "phenotype.txt", package = "simer") # Run phenotype correction simer.Data.Pheno(filePhe = filePhe, out = tempfile("outfile"))
# Get the filename of phenotype data filePhe <- system.file("extdata", "05others", "phenotype.txt", package = "simer") # Run phenotype correction simer.Data.Pheno(filePhe = filePhe, out = tempfile("outfile"))
The function of General Selection Index.
simer.Data.SELIND(jsonList = NULL, hiblupPath = "", ncpus = 10, verbose = TRUE)
simer.Data.SELIND(jsonList = NULL, hiblupPath = "", ncpus = 10, verbose = TRUE)
jsonList |
the list of selection index construction parameters. |
hiblupPath |
the path of HIBLUP software. |
ncpus |
the number of threads used, if NULL, (logical core number - 1) is automatically used. |
verbose |
whether to print detail. |
Build date: Aug 26, 2021 Last update: Apr 28, 2022
the function returns a list containing
the path of genotype data.
the filename of pedigree data.
the selection index for all traits.
the breeding value index for all traits.
a list of parameters for data quality control.
a list of parameters for genetic evaluation.
Dong Yin
Y. S. Chen, Z. L. Sheng (1988) The Theory of General Selection Index. Genetic Report, 15(3): P185-P190
# Read JSON file jsonFile <- system.file("extdata", "04breeding_plan", "plan1.json", package = "simer") jsonList <- jsonlite::fromJSON(txt = jsonFile, simplifyVector = FALSE) ## Not run: # It needs 'hiblup' software jsonList <- simer.Data.SELIND(jsonList = jsonList) ## End(Not run)
# Read JSON file jsonFile <- system.file("extdata", "04breeding_plan", "plan1.json", package = "simer") jsonList <- jsonlite::fromJSON(txt = jsonFile, simplifyVector = FALSE) ## Not run: # It needs 'hiblup' software jsonList <- simer.Data.SELIND(jsonList = jsonList) ## End(Not run)
Print simer version.
simer.Version(width = 60, verbose = TRUE)
simer.Version(width = 60, verbose = TRUE)
width |
the width of the message. |
verbose |
whether to print detail. |
Build date: Aug 30, 2017 Last update: Apr 30, 2022
version number.
Dong Yin, Lilin Yin, Haohao Zhang, and Xiaolei Liu
simer.Version()
simer.Version()
Write files of Simer.
write.file(SP)
write.file(SP)
SP |
a list of all simulation parameters. |
Build date: Jan 7, 2019 Last update: Apr 30, 2022
none.
Dong Yin
outpath <- tempdir() SP <- param.simer(out = "simer") SP <- simer(SP) SP$global$outpath <- outpath write.file(SP) unlink(file.path(outpath, "180_Simer_Data_numeric"), recursive = TRUE)
outpath <- tempdir() SP <- param.simer(out = "simer") SP <- simer(SP) SP$global$outpath <- outpath write.file(SP) unlink(file.path(outpath, "180_Simer_Data_numeric"), recursive = TRUE)