Function to simulate a step in a breeding scheme
breeding.diploid(
  population,
  selection.size = 0,
  selection.criteria = NULL,
  selection.m.gen = NULL,
  selection.f.gen = NULL,
  selection.m.database = NULL,
  selection.f.database = NULL,
  selection.m.cohorts = NULL,
  selection.f.cohorts = NULL,
  max.selection.fullsib = Inf,
  max.selection.halfsib = Inf,
  class.m = 0,
  class.f = 0,
  add.class.cohorts = TRUE,
  multiple.bve = "add",
  selection.index.weights.m = NULL,
  selection.index.weights.f = NULL,
  selection.index.scale.m = NULL,
  selection.index.scale.f = NULL,
  selection.index.kinship = 0,
  selection.index.gen = NULL,
  selection.index.database = NULL,
  selection.index.cohorts = NULL,
  selection.highest = TRUE,
  ignore.best = 0,
  best.selection.ratio.m = 1,
  best.selection.ratio.f = NULL,
  best.selection.criteria.m = "bv",
  best.selection.criteria.f = NULL,
  best.selection.manual.ratio.m = NULL,
  best.selection.manual.ratio.f = NULL,
  best.selection.manual.reorder = TRUE,
  selection.m.random.prob = NULL,
  selection.f.random.prob = NULL,
  reduced.selection.panel.m = NULL,
  reduced.selection.panel.f = NULL,
  threshold.selection.index = NULL,
  threshold.selection.value = NULL,
  threshold.selection.sign = ">",
  threshold.selection.criteria = NULL,
  threshold.selection = NULL,
  threshold.sign = ">",
  remove.duplicates = TRUE,
  selection.m.miesenberger = FALSE,
  selection.f.miesenberger = NULL,
  selection.miesenberger.reliability.est = "derived",
  miesenberger.trafo = 0,
  sort.selected.pos = FALSE,
  ogc = FALSE,
  relationship.matrix.ogc = "pedigree",
  depth.pedigree.ogc = 7,
  ogc.target = "min.sKin",
  ogc.uniform = NULL,
  ogc.ub = NULL,
  ogc.lb = NULL,
  ogc.ub.sKin = NULL,
  ogc.lb.BV = NULL,
  ogc.ub.BV = NULL,
  ogc.eq.BV = NULL,
  ogc.ub.sKin.increase = NULL,
  ogc.lb.BV.increase = NULL,
  ogc.c1 = NULL,
  ogc.isCandidate = NULL,
  ogc.plots = TRUE,
  ogc.weight = NULL,
  ogc.freq = NULL,
  selection.skip = FALSE,
  breeding.size = 0,
  breeding.size.litter = NULL,
  name.cohort = NULL,
  breeding.sex = NULL,
  breeding.sex.random = FALSE,
  sex.s = NULL,
  add.gen = 0,
  share.genotyped = 0,
  phenotyping.child = NULL,
  fixed.effects.p = NULL,
  fixed.effects.freq = NULL,
  new.class = 0L,
  max.offspring = Inf,
  max.offspring.individual.m = NULL,
  max.offspring.individual.f = NULL,
  max.offspring.individual.gen = NULL,
  max.offspring.individual.database = NULL,
  max.offspring.individual.cohorts = NULL,
  max.litter = Inf,
  max.mating.pair = Inf,
  avoid.mating.fullsib = FALSE,
  avoid.mating.halfsib = FALSE,
  avoid.mating.parent = FALSE,
  avoid.mating.inb = NULL,
  avoid.mating.inb.quantile = NULL,
  avoid.mating.inb.min = 0,
  avoid.mating.kinship = NULL,
  avoid.mating.kinship.quantile = NULL,
  avoid.mating.kinship.gen = NULL,
  avoid.mating.kinship.database = NULL,
  avoid.mating.kinship.cohorts = NULL,
  avoid.mating.kinship.min = 0,
  avoid.mating.kinship.median = FALSE,
  avoid.mating.depth.pedigree = 7,
  avoid.mating.remove = FALSE,
  avoid.mating.ignore = 0,
  avoid.mating.resampling = 1000,
  fixed.breeding = NULL,
  fixed.breeding.best = NULL,
  fixed.breeding.id = NULL,
  fixed.assignment = FALSE,
  breeding.all.combination = FALSE,
  repeat.mating = NULL,
  repeat.mating.copy = NULL,
  repeat.mating.fixed = NULL,
  repeat.mating.overwrite = TRUE,
  repeat.mating.trait = 1,
  repeat.mating.max = NULL,
  repeat.mating.s = NULL,
  same.sex.activ = FALSE,
  same.sex.sex = 0.5,
  same.sex.selfing = FALSE,
  selfing.mating = FALSE,
  selfing.sex = 0.5,
  dh.mating = FALSE,
  dh.sex = 0.5,
  combine = FALSE,
  copy.individual = FALSE,
  copy.individual.m = FALSE,
  copy.individual.f = FALSE,
  copy.individual.keep.bve = TRUE,
  copy.individual.keep.pheno = TRUE,
  added.genotyped = NULL,
  bv.ignore.traits = NULL,
  generation.cores = NULL,
  generation.core.make.small = FALSE,
  pedigree.error = 0,
  pedigree.unknown = 0,
  genotyped.database = NULL,
  genotyped.gen = NULL,
  genotyped.cohorts = NULL,
  genotyped.share = 1,
  genotyped.array = 1,
  genotyped.remove.gen = NULL,
  genotyped.remove.database = NULL,
  genotyped.remove.cohorts = NULL,
  genotyped.remove.all.copy = TRUE,
  genotyped.selected = FALSE,
  phenotyping = NULL,
  phenotyping.gen = NULL,
  phenotyping.cohorts = NULL,
  phenotyping.database = NULL,
  n.observation = NULL,
  phenotyping.class = NULL,
  heritability = NULL,
  repeatability = NULL,
  multiple.observation = FALSE,
  phenotyping.selected = FALSE,
  share.phenotyped = 1,
  offpheno.parents.gen = NULL,
  offpheno.parents.database = NULL,
  offpheno.parents.cohorts = NULL,
  offpheno.offspring.gen = NULL,
  offpheno.offspring.database = NULL,
  offpheno.offspring.cohorts = NULL,
  sigma.e = NULL,
  sigma.e.gen = NULL,
  sigma.e.cohorts = NULL,
  sigma.e.database = NULL,
  new.residual.correlation = NULL,
  new.breeding.correlation = NULL,
  phenotyping.trafo.parameter = NULL,
  bve = FALSE,
  bve.gen = NULL,
  bve.cohorts = NULL,
  bve.database = NULL,
  relationship.matrix = "GBLUP",
  depth.pedigree = 7,
  singlestep.active = TRUE,
  bve.ignore.traits = NULL,
  bve.array = NULL,
  bve.imputation = TRUE,
  bve.imputation.errorrate = 0,
  bve.all.genotyped = FALSE,
  bve.insert.gen = NULL,
  bve.insert.cohorts = NULL,
  bve.insert.database = NULL,
  variance.correction = "none",
  bve.class = NULL,
  sigma.g = NULL,
  sigma.g.gen = NULL,
  sigma.g.cohorts = NULL,
  sigma.g.database = NULL,
  forecast.sigma.g = NULL,
  remove.effect.position = FALSE,
  estimate.add.gen.var = FALSE,
  estimate.pheno.var = FALSE,
  bve.avoid.duplicates = TRUE,
  calculate.reliability = FALSE,
  estimate.reliability = FALSE,
  bve.input.phenotype = "own",
  mas.bve = FALSE,
  mas.markers = NULL,
  mas.number = 5,
  mas.effects = NULL,
  mas.geno = NULL,
  bve.parent.mean = FALSE,
  bve.grandparent.mean = FALSE,
  bve.mean.between = "bvepheno",
  bve.exclude.fixed.effects = NULL,
  bve.beta.hat.approx = TRUE,
  bve.per.sample.sigma.e = TRUE,
  bve.p_i.list = NULL,
  bve.p_i.gen = NULL,
  bve.p_i.database = NULL,
  bve.p_i.cohorts = NULL,
  bve.p_i.exclude.nongenotyped = FALSE,
  bve.use.all.copy = FALSE,
  bve.pedigree.error = TRUE,
  mobps.bve = TRUE,
  mixblup.bve = FALSE,
  blupf90.bve = FALSE,
  mixblup.reliability = FALSE,
  emmreml.bve = FALSE,
  rrblup.bve = FALSE,
  sommer.bve = FALSE,
  sommer.multi.bve = FALSE,
  BGLR.bve = FALSE,
  pseudo.bve = FALSE,
  pseudo.bve.accuracy = 1,
  bve.solve = "exact",
  mixblup.jeremie = FALSE,
  mixblup.hpblup = FALSE,
  mixblup.pedfile = TRUE,
  mixblup.parfile = TRUE,
  mixblup.datafile = TRUE,
  mixblup.inputfile = TRUE,
  mixblup.genofile = TRUE,
  mixblup.path = NULL,
  mixblup.path.pedfile = NULL,
  mixblup.path.parfile = NULL,
  mixblup.path.datafile = NULL,
  mixblup.path.inputfile = NULL,
  mixblup.path.genofile = NULL,
  mixblup.full.path.genofile = NULL,
  mixblup.files = "MiXBLUP_files",
  mixblup.verbose = TRUE,
  blupf90.verbose = TRUE,
  mixblup.genetic.cov = NULL,
  mixblup.residual.cov = NULL,
  mixblup.lambda = 1,
  mixblup.alpha = NULL,
  mixblup.beta = NULL,
  mixblup.omega = NULL,
  mixblup.maxit = 5000,
  mixblup.stopcrit = NULL,
  mixblup.maf = 0.005,
  mixblup.numproc = NULL,
  mixblup.apy = FALSE,
  mixblup.apy.core = NULL,
  mixblup.ta = FALSE,
  mixblup.tac = FALSE,
  mixblup.skip = FALSE,
  blupf90.skip = FALSE,
  mixblup.restart = FALSE,
  mixblup.nopeek = FALSE,
  mixblup.calcinbr.s = FALSE,
  mixblup.multiple.records = FALSE,
  mixblup.attach = FALSE,
  mixblup.debug = FALSE,
  mixblup.plink = FALSE,
  mixblup.cleanup = Inf,
  blupf90.pedfile = TRUE,
  blupf90.parfile = TRUE,
  blupf90.datafile = TRUE,
  blupf90.inputfile = TRUE,
  blupf90.genofile = TRUE,
  mixblup.dgv = FALSE,
  mixblup.dgv.freq = NULL,
  mixblup.dgv.effect = NULL,
  blupf90.path = NULL,
  renumf90.path = NULL,
  blupf90.path.pedfile = NULL,
  blupf90.path.parfile = NULL,
  blupf90.path.datafile = NULL,
  blupf90.path.inputfile = NULL,
  blupf90.path.genofile = NULL,
  blupf90.files = "blupf90_files",
  blupf90.blksize = NULL,
  blupf90.no.quality = FALSE,
  blupf90.conv_crit = NULL,
  BGLR.model = "RKHS",
  BGLR.burnin = 500,
  BGLR.iteration = 5000,
  BGLR.print = TRUE,
  BGLR.save = "RKHS",
  BGLR.save.random = FALSE,
  miraculix = NULL,
  miraculix.cores = 1,
  miraculix.mult = NULL,
  miraculix.chol = TRUE,
  miraculix.destroyA = TRUE,
  estimate.u = FALSE,
  fast.uhat = TRUE,
  gwas.u = FALSE,
  approx.residuals = TRUE,
  gwas.gen = NULL,
  gwas.cohorts = NULL,
  gwas.database = NULL,
  gwas.group.standard = FALSE,
  y.gwas.used = "pheno",
  gene.editing.offspring = FALSE,
  gene.editing.best = FALSE,
  gene.editing.offspring.sex = TRUE,
  gene.editing.best.sex = TRUE,
  nr.edits = 0,
  culling.non.selected = FALSE,
  culling.gen = NULL,
  culling.database = NULL,
  culling.cohorts = NULL,
  culling.type = 0,
  culling.time = Inf,
  culling.name = "Not_named",
  culling.bv1 = 0,
  culling.share1 = NULL,
  culling.bv2 = NULL,
  culling.share2 = NULL,
  culling.index = 0,
  culling.single = TRUE,
  culling.all.copy = TRUE,
  mutation.rate = 10^-8,
  remutation.rate = 10^-8,
  recombination.rate = 1,
  recombination.rate.trait = 0,
  recombination.function = NULL,
  recombination.minimum.distance = NULL,
  recombination.distance.penalty = NULL,
  recombination.distance.penalty.2 = NULL,
  recom.f.indicator = NULL,
  import.position.calculation = NULL,
  duplication.rate = 0,
  duplication.length = 0.01,
  duplication.recombination = 1,
  gen.architecture.m = 0,
  gen.architecture.f = NULL,
  add.architecture = NULL,
  intern.func = 0,
  delete.haplotypes = NULL,
  delete.recombi = NULL,
  delete.recombi.only.non.genotyped = FALSE,
  delete.recombi.class = NULL,
  delete.individuals = NULL,
  delete.gen = NULL,
  delete.sex = 1:2,
  delete.same.origin = FALSE,
  save.recombination.history = FALSE,
  store.sparse = FALSE,
  storage.save = 1.05,
  verbose = TRUE,
  report.accuracy = TRUE,
  store.breeding.totals = FALSE,
  store.bve.data = FALSE,
  store.comp.times = TRUE,
  store.comp.times.bve = TRUE,
  store.comp.times.generation = TRUE,
  store.effect.freq = FALSE,
  Rprof = FALSE,
  randomSeed = NULL,
  display.progress = NULL,
  time.point = 0,
  age.point = NULL,
  creating.type = 0,
  import.relationship.matrix = NULL,
  export.selected = FALSE,
  export.selected.database = FALSE,
  export.relationship.matrix = FALSE,
  pen.assignments = NULL,
  pen.size = NULL,
  pen.by.sex = TRUE,
  pen.by.litter = FALSE,
  pen.size.overwrite = TRUE,
  selection.m = NULL,
  selection.f = NULL,
  new.bv.observation.gen = NULL,
  new.bv.observation.cohorts = NULL,
  new.bv.observation.database = NULL,
  best1.from.group = NULL,
  best2.from.group = NULL,
  best1.from.cohort = NULL,
  best2.from.cohort = NULL,
  new.bv.observation = NULL,
  reduce.group = NULL,
  reduce.group.selection = "random",
  new.bv.child = NULL,
  computation.A = NULL,
  computation.A.ogc = NULL,
  new.phenotype.correlation = NULL,
  offspring.bve.parents.gen = NULL,
  offspring.bve.parents.database = NULL,
  offspring.bve.parents.cohorts = NULL,
  offspring.bve.offspring.gen = NULL,
  offspring.bve.offspring.database = NULL,
  offspring.bve.offspring.cohorts = NULL,
  input.phenotype = NULL,
  multiple.bve.weights.m = 1,
  multiple.bve.weights.f = NULL,
  multiple.bve.scale.m = "bv_sd",
  multiple.bve.scale.f = NULL,
  use.recalculate.manual = NULL,
  recalculate.manual.subset = 5000,
  compute.grandparent.contribution = FALSE,
  size.scaling = NULL,
  parallel.internal = FALSE,
  varg = FALSE,
  gain.stats = FALSE,
  next.id = NULL,
  copy.individual.use = NULL,
  copy.individual.use2 = NULL
)Population-list
Population list
Number of selected individuals as parents (default: all individuals in selection.m/f.gen/database/gen - alt: positive numbers)
What to use in the selection process (default: "bve", alt: "bv", "pheno", "random", "offpheno")
Generations/cohorts/groups available for selection of first/paternal parent
Generations available for selection of maternal parent
Maximum number of individual to select from the same family (same sire & dam)
Maximum number of individual to select from the same family (same sire or same dam)
For selection only individuals from this class (included in selection.m/f.gen/database/cohorts) will be considered for selection (default: 0 - which is all individuals if never used class elsewhere)
Initial classes of cohorts used in selection.m/f.cohorts are automatically added to class.m/f (default: TRUE)
Way to handle multiple traits in selection (default: "add" - use values directly in an index, alt: "ranking" - ignore values but only use ranking per trait)
Weighting between traits (default: 1)
Default: "bv_sd"; Set to "pheno_sd" when using gains per phenotypic SD, "unit" when using gains per unit, "bve" when using estimated breeding values
Include avg. kinship to a reference population (selection.index.gen/database/cohorts) as part of the selection index (Default: 0)
Generation/cohorts/groups to use as a reference of the kinship value in the selection index
If FALSE to select individuals with lowest value for the selection criterium (default c(TRUE,TRUE) - (m,w))
Not consider the top individuals of the selected individuals (e.g. to use 2-10 best individuals)
Ratio of the frequency of the selection of the best best individual and the worst best individual (default=1)
Criteria to calculate this ratio (default: "bv", alt: "bve", "pheno")
vector containing probability to draw from for every individual (e.g. c(0.1,0.2,0.7))
Set to FALSE to not use the order from best to worst selected individual but plain order based on database-order
Use this parameter to control the probability of each individual to be selected when doing random selection
Use only a subset of individuals of the potential selected ones ("Split in user-interface")
Selection index on which to access (matrix which one index per row)
Minimum value in the selection index selected individuals have to have
Pick all individuals above (">") the threshold. Alt: ("<", "=", "<=", ">=")
Criterium on which to evaluate the index (default: "bve", alt: "bv", "pheno")
Minimum value in the selection index selected individuals have to have
Pick all individuals above (">") the threshold. Alt: ("<", "=", "<=", ">=")
Set to FALSE to select the same individual multiple times when the gen/database/cohorts for selection contains it multiple times
Use Weighted selection index according to Miesenberger 1997 for paternal/maternal selection
If available reliability estimated are used. If not use default: "derived" (cor(BVE,BV)^2) , alt: "heritability", "estimated" (SD BVE / SD Pheno) as replacement
Ignore all eigenvalues below this threshold and apply dimension reduction (default: 0 - use all)
Set to TRUE to arrange selected individuals according to position in the database (not by breeding value)
If TRUE use optimal genetic contribution theory to perform selection ( This requires the use of the R-package optiSel)
Method to calculate relationship matrix for OGC (Default: "pedigree", alt: "vanRaden", "CE", "non_stand", "CE2", "CM")
Depth of the pedigree in generations (default: 7)
Target of OGC (default: "min.sKin" - minimize inbreeding; alt: "max.BV" / "min.BV" - maximize genetic gain; both under constrains selected below)
This corresponds to the uniform constrain in optiSel
This corresponds to the ub constrain in optiSel
This corresponds to the lb constrain in optiSel
This corresponds to the ub.sKin constrain in optiSel
This corresponds to the lb.BV constrain in optiSel
This corresponds to the ub.BV constrain in optiSel
This corresponds to the eq.BV constrain in optiSel
This corresponds to the upper bound (current sKin + ogc.ub.sKin.increase) as ub.sKin in optiSel
This corresponds to the lower bound (current BV + ogc.lb.BV.increase) as lb.BV in optiSel
Only applicable when TN-version of OGC is available
Only applicable when TN-version of OGC is available
Only applicable when TN-version of OGC is available
Only applicable when B4F-version of OGC is available
Only applicable when B4F-version of OGC is available
Set to FALSE in case no selection of individuals should be performed (just skips some unneccessary computations)
Number of individuals to generate (default: 0, use vector with two entries to control offspring per sex)
Number of litters to generate (default: NULL - use breeding.size; only single positive number input allowed)
Name of the newly added cohort
Share of female individuals (if single value is used for breeding size; default: 0.5)
If TRUE randomly chose sex of new individuals (default: FALSE - use expected values)
Specify which newly added individuals are male (1) or female (2)
Generation you want to add the new individuals to (default: New generation)
Share of individuals newly generated individuals that are genotyped (Default: 0). Also applies if individuals are copied with copy.individual
Starting phenotypes of newly generated individuals (default: "zero", alt: "mean" of both parents, "obs" - regular observation)
Parametrization for the fixed effects (default: c(0,0..,0), if multiple different parametrizations are possible use a matrix with one parametrization per row)
Frequency of each different parametrization of the fixed effects
Migration level of newly generated individuals (default: 0 / use vector for different classes for different sexes)
Maximum number of offspring per individual (default: c(Inf,Inf) - (m,w))
Vector with maximum number of offspring for first/second parent (default: NULL). Order in the vector by order of selection
matrix with first column generation with limited number offspring, second column number of allowed offspring
matrix with first four columns database with limited number offspring, fifth column number of allowed offspring
matrix with first column cohort with limited number offspring, second column number of allowed offspring
Maximum number of litters per individual (default: c(Inf,Inf) - (m,w))
Maximum number of matings between two specific individuals (default: Inf)
Set to TRUE to not generate offspring of full siblings
Set to TRUE to not generate offspring from half or full siblings
Set to TRUE to not generate offspring from parent / sibling matings
Maximum allowed expected inbreeding to allow a mating combination (based on kinships)
Use this to not perform mating between more related potential parents (quantile of all expected inbreeding levels)
Share of mating to at minimum perform for each individual (default: 0)
Maximum allowed expected kinship of an offspring to a reference group of individuals
Maximum allowed expected kinship of an offspring to a reference group of individuals
Gen/database/cohorts of individuals to consider as a reference pool in avoid.mating.kinship
Set to TRUE to use median kinship instead of mean kinship in avoid.mating.kinship (default: FALSE)
Depth of the pedigree to calculate expected inbreeding levels / kinships
Set to TRUE to automatically exclude any selected individuals from the sample of parents
Set to value higher 0 for avoid.mating.inb/kinship restrictions to not always be applied
Number of sampling attempts to avoid unwanted matings (( last couple of individuals otherwise can have unwanted relatedness, default = 1000))
Set of targeted matings to perform (matrix with 7 columns: database position first parent (gen, sex, nr), database position second parent (gen,sex,nr), likelihood to be female (optional))
Perform targeted matings in the group of selected individuals (matrix with 5 columns: position first parent (male/female pool of selected individuals, ranking in selected animals), position second parent (male/female pool of selected individuals, ranking in selected animals), likelihood to be female (optional))
Set of target matings to perform (matrix with 3 columns: id first parent, id second parent, likelihood to be female (optional))
Set to "bestbest" / TRUE for targeted mating of best-best individual till worst-worst (of selected). set to "bestworst" for best-worst mating
Set to TRUE to automatically perform each mating combination possible exactly ones.
Generate multiple mating from the same dam/sire combination (first column: number of offspring; second column: probability)
Generate multiple copies from a copy action (combine / copy.individual.m/f) (first column: number of offspring; second column: probability)
Vector containing number of times each mating is repeated. This will overwrite sampling from repeat.mating / repeat.mating.copy (default: NULL)
Set to FALSE to not use the current repeat.mating / repeat.mating.copy input as the new standard values (default: TRUE)
Trait that should be linked to the litter size
Maximum number of individuals in a litter
Use this parameter to manually provide the size of each litter generated
If TRUE allow matings of individuals of same sex (Sex here is a general term with the first sex referring to the first parent, second sex second parent)
Probability to use female individuals as parents (default: 0.5)
Set to TRUE to allow for selfing when using same.sex matings (default: FALSE)
If TRUE generate new individuals via selfing
Share of female individuals used for selfing (default: 0.5)
If TRUE generate a DH-line in mating process
Share of DH-lines generated from selected female individuals
Copy existing individuals (e.g. to merge individuals from different groups in a joined cohort). Individuals to use are used as the first parent
Set TRUE to generate a copy of an already existing individual. If only one of the sexes has individuals to select from it will automatically detect with sex to chose. Otherwise the first/male parent will be copied
If TRUE generate exactly one copy of all selected male/female in a new cohort (or more by setting breeding.size)
Set to FALSE to not keep estimated breeding value in case of use of copying individuals instead of regular meiosis
Set to FALSE to not keep phenotypes in case of use of copying individuals instead of regular meiosis
(OLD! use share.genotyped) Share of individuals that is additionally genotyped (only for copy.individual, default: 0)
Vector of traits to ignore in the calculation of the genomic value (default: NULL; Only recommended for high number of traits and experienced users!)
Number of cores used for the generation of new individuals (This will only be active when generating more than 500 individuals)
Set to TRUE to delete not necessary individuals during parallelization
Share of errors in the pedigree (default: 0; vector with two entries for errors on male/female side)
Share of individuals with unknown parents (default: 0; vector with two entries for differences in unknown-share between male/female side)
Generations/cohorts/groups to generate genotype data (that can be used in a BVE)
Share of individuals in genotyped.gen/database/cohort to generate genotype data from (default: 1)
Genotyping array used
Generations/cohorts/groups from which to remove genotyping information (this will affect all copies of an individual unless genotyped.remove.all.copy is set to FALSE)
Set to FALSE to only change the genotyping state of this particular copy of an individual (default: TRUE)
Set to TRUE to genotype all selected individuals
Quick access to phenotyping for (all: "all", non-phenotyped: "non_obs", non-phenotyped male: "non_obs_m", non-phenotyped female: "non_obs_f")
Generations/cohorts/groups from which to generate additional phenotypes
Number of phenotypic observations generated per trait and per individuals (use repeatability to control correlation between observations)
Classes of individuals for which to generate phenotypes (default: NULL --> all classes)
Use sigma.e to obtain a certain heritability (default: NULL)
Set this to control the share of the residual variance (sigma.e) that is permanent (there for each observation)
If an already phenotyped trait is phenotyped again this will on NOT lead to an additional phenotyped observation unless this is set to TRUE
Set to TRUE to phenotype all selected individuals
Share of the individuals to phenotype (use vector for different probabilities for different traits)
Generations/groups/cohorts to consider to derive phenotype from offspring phenotypes
Active generations/cohorts/groups for import of offspring phenotypes
Enviromental standard deviation (default: use sigma.e from last run / usually fit by use of heritability; if never provided: 10; used in BVE for variance components if manually set)
Generations/cohorts/groups to consider when estimating sigma.e when using heritability
Correlation of the simulated residual variance
Correlation of the simulated genetic variance (only impacts non-QTL based traits. Needs to be fit in creating.diploid/trait for QTL-based traits)
Additional input parameter for phenotypic transformation function
If TRUE perform a breeding value estimation (default: FALSE)
Generations/Groups/Cohorts of individuals to consider in breeding value estimation (default: NULL)
Method to calculate relationship matrix for the breeding value estimation. This will automatically chosen between GBLUP, ssGBLUP, pBLUP based on if genotyped individuals are available (Default: "GBLUP", alt: "pedigree", "CE", "non_stand", "CE2", "CM")
Depth of the pedigree in generations (default: 7)
Set FALSE remove all individuals without genomic data from the breeding value estimation
Vector of traits to ignore in the breeding value estimation (default: NULL, use: "zero" to not consider traits with 0 index weight in selection.index.weights.m/.w)
Array to use in the breeding value estimation (default: NULL; chose largest possible based on used individuals in BVE)
Set to FALSE to not perform imputation up to the highest marker density of genotyping data that is available
Share of errors in the imputation procedure (default: 0)
Set to TRUE to act as if every individual in the breeding value estimation has been genotyped
Generations/Groups/Cohorts of individuals to compute breeding values for (default: all groups in bve.database)
Correct for "parental.mean" or "generation.mean" in the estimation of sigma.g for BVE / sigma.e estimation (default: "none")
Consider only individuals of those class classes in breeding value estimation (default: NULL - use all)
Genetic standard deviation (default: calculated based on individuals in BVE ; used in BVE for variance components if manually set; mostly recommended to be used for non-QTL based traits)
Generations/cohorts/groups to consider when estimating sigma.g
Set FALSE to not estimate sigma.g (Default: TRUE // in case sigma.g is set this is automatically set to FALSE)
If TRUE remove real QTLs in breeding value estimation
If TRUE estimate additive genetic variance and heritability based on parent model
If TRUE estimate total variance in breeding value estimation
If set to FALSE multiple generations of the same individual can be used in the bve (only possible by using copy.individual to generate individuals)
Set TRUE to calculate a reliability when performing Direct-Mixed-Model BVE
Set TRUE to estimate the reliability in the BVE by calculating the correlation between estimated and real breeding values
Select what to use in BVE (default: own phenotype ("own"), offspring phenotype ("off"), their average ("mean") or a weighted average ("weighted"))
If TRUE use marker assisted selection in the breeding value estimation
Vector containing markers to be used in marker assisted selection
If no markers are provided this nr of markers is selected (if single marker QTL are present highest effect markers are prioritized)
Effects assigned to the MAS markers (Default: estimated via lm())
Genotype dataset used in MAS (default: NULL, automatic internal calculation)
Set to TRUE to use the average parental performance as the breeding value estimate
Set to TRUE to use the average grandparental performance as the breeding value estimate
Select if you want to use the "bve", "bv", "pheno" or "bvepheno" to form the mean (default: "bvepheno" - if available bve, else pheno)
Vector of fixed effects to ignore in the BVE (default: NULL)
Set to FALSE to use the true underlying value for beta_hat for the fixed effect in the direct BVE model. rrBLUP, BGLR, sommer will always estimate beta_hat.
Set to FALSE to deactivate the use of a heritability based on the number of observations generated per sample
Vector of allele frequencies to be used when calculating the genomic relationship matrix (default: calculate them based on Z)
Generations/cohorts/groups to use when manually calculating allele frequencies for genomic relationship matrix
Set to TRUE to exclude non-genotyped individuals when calculating allele frequencies for genomic relationship matrix standardization
Set to TRUE to use phenotypes and genotyped status from all copies of an individual instead of just the provided ones in the bve.gen/database/cohorts (default: FALSE)
Set to FALSE to ignore/correct for any pedigree errors
If TRUE predict BVEs in direct estimation with assumed known heritability (default: TRUE; activating use of any other BVE method to TRUE will overwrite this)
Set to TRUE to activate breeding value estimation via MiXBLUP (requires MiXBLUP license!)
Set to TRUE to activate breeding value estimation via BLUPF90 (requires blupf90 software!)
Set to TRUE to activate breeding value estimation via MiXBLUP (requires MiXBLUP license!)
If TRUE use REML estimator from R-package EMMREML in breeding value estimation
If TRUE use REML estimator from R-package rrBLUP in breeding value estimation
If TRUE use REML estimator from R-package sommer in breeding value estimation
Set TRUE to use a multi-trait model in the R-package sommer for BVE
If TRUE use BGLR to perform breeding value estimation
If set to TRUE the breeding value estimation will be simulated with resulting accuracy pseudo.bve.accuracy (default: 1)
The accuracy to be obtained in the "pseudo" - breeding value estimation
Provide solver to be used in BVE (default: "exact" solution via inversion, alt: "pcg", function with inputs A, b and output y_hat)
Set to TRUE to use Jeremies suggested MiXBLUP settings
Set to TRUE to use hpblup in MiXBLUP (default: FALSE)
Set to FALSE to manually generate your MiXBLUP pedfile
Set to FALSE to manually generate your MiXBLUP parfile
Set to FALSE to manually write your MiXBLUP datafile
Set to FALSE to manually write your MiXBLUP inputfile
Set to FALSE to manually write the MiXBLUP genotypefile
Provide path to MiXBLUP.exe (default is your working directory: Windows: MixBLUP; Linux ./MixBLUP.exe)
Path from where to import the MiXBLUP pedfile
Path from where to import the MiXBLUP parfile
Path from where to import the MiXBLUP datafile
Path from where to import the MiXBLUP inputfile
Path from where to import the MiXBLUP genofile
Path from where to import the MiXBLUP genofile
Directory to generate all files generated when using MiXBLUP (default: MiXBLUP_files/ )
Set to TRUE to display MiXBLUP prints
Set to TRUE to display blupf90 prints
Provide genetic covariance matrix to be used in MiXBLUP (lower-triangle is sufficent) (default: underlying true values)
Provide residual covariance matrix to be used in MiXBLUP (lower-triangle is sufficent) (default: underlying true values)
Lambda parameter in MiXBLUP (default: 1)
Alpha parameter in MiXBLUP (default: 0.95, with alpha + beta = 1 , warning: MiXBLUP software this is 1)
Beta parameter in MiXBLUP (default: 0.05, with alpha + beta = 1 , warning: MiXBLUP software this is 0)
Omega parameter in MiXBLUP (default: mixblup.lambda)
!Maxit qualifier in MiXBLUP (default: 5.000)
!STOPCRIT qualifier in MiXBLUP (default: not used, suggested value 1.E-4 for ssGBLUP) // will overwrite maxit
!MAF qualifier in MiXBLUP (default: 0.005)
Numproc parameter in MiXBLUP (default: not set // 1)
Set to TRUE to use APY inverse in MiXBLUP (default: FALSE)
Number of core individuals in the APY algorithm (default: 5000)
Set to TRUE to use the !Ta flag in MixBLUP
Set to TRUE to use the !TAC flag in MixBLUP
Set to TRUE to skip the actually system call to MiXBLUP and only write the MiXBLUP files
Set to TRUE to skip the actually system calls of blupf90 and only write the blupf90 input files
Set to TRUE to set the !RESTART flag in MiXBLUP (requires a "Solunf" file in the working directory)
Set to TRUE to set the !NOPEEK flag in MiXBLUP
Set to TRUE to set the !CalcInbr flag to S
Set to TRUE to write multiple phenotypic records for an individual
Set TRUE to just extent the existing genotype file instead of writting it completely new
Set TRUE to set debugging flags for mixblup call (-Dmst > mixblup_debug.log) (default: FALSE)
Set TRUE to write genotype files in PLINK format (requires R-package genio, default: FALSE)
Delete all mixblup output files above the indicated size after MiXBLUP run completes (default: Inf)
Set to FALSE to manually generate your MiXBLUP pedfile
Set to FALSE to manually generate your MiXBLUP parfile
Set to FALSE to manually generate your blupf90 datafile
Set to FALSE to manually write your MiXBLUP inputfile
Set to FALSE to manually write the blupf90 genotypefile
Set TRUE to use DGV-PBLUP (Only applicable with TAC-BLUP)
Path of allele frequency file for DGV-PBLUP
Path of SNP effect file for DGV-PBLUP
Provide path to blupf90 (default is your working directory: Windows: ./blupf90+.exe ; Linux ./blupf90+.exe)
Provide path to blupf90 (default is your working directory: Windows: ./renumf90.exe ; Linux ./renumf90.exe)
Path from where to import the blupf90 pedfile
Path from where to import the blupf90 parfile
Path from where to import the blupf90 data file
Path from where to import the blupf90 inputfile
Path from where to import the blupf90 genotype file
Directory to generate all files generated when using blupf90 (default: blupf90_files/ )
blupf90 parameter blksize (Default: number of traits)
blupf90 setting OPTION no_quality_control (Default: FALSE)
blupf90 parameter conv_crit (Default: blupf90 default)
Select which BGLR model to use (default: "RKHS", alt: "BRR", "BL", "BayesA", "BayesB", "BayesC")
Number of burn-in steps in BGLR (default: 1000)
Number of iterations in BGLR (default: 5000)
If TRUE set verbose to TRUE in BGLR
Method to use in BGLR (default: "RKHS" - alt: NON currently)
Add random number to store location of internal BGLR computations (only needed when simulating a lot in parallel!)
If TRUE use miraculix to perform computations (ideally already generate population in creating.diploid with this; default: automatic detection from population list)
Number of cores used in miraculix applications (default: 1)
If TRUE use miraculix for matrix multiplications even if miraculix is not used for storage
Set to FALSE to deactive miraculix based Cholesky-decomposition (default: TRUE)
If FALSE A will not be destroyed in the process of inversion (less computing / more memory)
If TRUE estimate u in breeding value estimation (Y = Xb + Zu + e)
Set to FALSE to derive inverse of A in rrBLUP (only required when this becomes numerical unstable otherwise)
If TRUE estimate u via GWAS (relevant for gene editing)
If FALSE calculate the variance for each marker separatly instead of using a set variance (does not change order - only p-values)
Generations/cohorts/groups to consider in GWAS analysis
If TRUE standardize phenotypes by group mean
What y value to use in GWAS study (Default: "pheno", alt: "bv", "bve")
If TRUE perform gene editing on newly generated individuals
If TRUE perform gene editing on selected individuals
Which sex to perform editing on (Default c(TRUE,TRUE), mw)
Which sex to perform editing on (Default c(TRUE,TRUE), mw)
Number of edits to perform per individual
Set TRUE to cull all non-selected individuals (default: FALSE)
Generations/cohorst/groups to consider to culling
Default: 0, can be set to code different type of culling reasons (e.g. 0 - aging, 1 - selection, 2 - health)
Age of the individuals at culling // use time.point if the age of individuals is variable and culling is executed on individuals of different ages culled at the same time
Name of the culling action (user-interface stuff)
Reference Breeding value
Probability of death for individuals with bv1
Alternative breeding value (linear extended for other bvs)
Probability of death for individuals with bv2
Genomic index (default:0 - no genomic impact, use: "lastindex" to use the last selection index applied in selection)
Set to FALSE to not apply the culling module on all individuals of the cohort
Set to FALSE to not kill copies of the same individual in the culling module
Mutation rate in each marker (default: 10^-8)
Remutation rate in each marker (default: 10^-8)
Average number of recombination per 1 length unit (default: 1M)
Select a trait which BV will be used as a scalar for the expected number of recombination (default: 0)
Function used to calculate position of recombination events (default: MoBPS::recombination.function.haldane())
Minimum distance between two points of recombination (default: 0)
Reduced probability for recombination events closer than this value - linear penalty (default: 0)
Reduced probability for recombination events closer than this value - quadratic penalty (default: 0)
Use step function for recombination map (transform snp.positions if possible instead)
Function to calculate recombination point into adjacent/following SNP
Share of recombination points with a duplication (default: 0 - DEACTIVATED)
Average length of a duplication (Exponentially distributed)
Average number of recombinations per 1 length uit of duplication (default: 1)
Genetic architecture for male/female individuals (default: 0 - no transformation)
List with two vectors containing (A: length of chromosomes, B: position in cM of SNPs)
Chose which function will be used for simulation of meiosis (default: 0, alt: 1,2) - can be faster for specific cases
Generations for with haplotypes of founders can be deleted from population list for memory reduction (default: NULL)
Generations for which recombination points can be deleted from the population list for memory reduction (default: NULL)
Set TRUE to only remove points of recombination for non-genotyped individuals
Set TRUE to only remove points of recombination for individuals from a specific class
Generations for with individuals are completely deleted from population list for memory reduction (default: NULL)
Generations to entirely deleted fro population list for memory reduction (default: NULL)
Remove all individuals from these sex from generation delete.individuals (default: 1:2 ; note:delete individuals=NULL)
If TRUE delete recombination points when genetic origin of adjacent segments is the same
If TRUE store the time point of each recombination event
Set to TRUE to store the pedigree relationship matrix as a sparse matrix
Lower numbers will lead to less memory but slightly higher computing time for calculation of the pedigree relationship matrix (default: 1.5, min: 1)
Set to FALSE to not display any prints
Report the accuracy of the breeding value estimation
If TRUE store information on selected individuals in $info$breeding.totals (default: FALSE)
If TRUE store information of bve in $info$bve.data
If TRUE store computation times in $info$comp.times.general (default: TRUE)
If TRUE store computation times of breeding value estimation in $info$comp.times.bve (default: TRUE)
If TRUE store computation times of mating simulations in $info$comp.times.generation (default: TRUE)
If TRUE store the allele frequency of effect markers per generation
Store computation times of each function
Set random seed of the process
Set FALSE to not display progress bars. Setting verbose to FALSE will automatically deactive progress bars
Time point at which the new individuals are generated
Time point at which the new individuals are born (default: time.point - mostly useful in the founder generation)
Technique to generate new individuals (use mostly intended for web-based application)
Input the wanted relationship matrix with this parameter (default: NULL - relationship matrix will be calculated from other sources)
Set to TRUE to export the list of selected individuals
Set to TRUE to export a database of the selected individuals
Export the relationship matrix used in the breeding value estimation
This is a placeholder to deactivate this module for now
Pen size. When different types of pen are used: use a matrix with two columns coding Number of individuals per pen, Probability for each pen size
Only individuals of the same sex are put in the same pen (default: TRUE)
Only individuals of the same litter are put in the same pen (default: FALSE)
Set to FALSE to not use the input for pen.size for down-stream use of breeding.diploid (default: TRUE)
(OLD! use selection criteria) Selection criteria for male/female individuals (Set to "random" to randomly select individuals - default: "function" based on selection.criteria ((usually breeding values)))
(OLD! use phenotyping.gen/cohorts/database) Vector of generation from which to generate additional phenotypes
(OLD!- use selection.m.database/cohorts) Groups of individuals to consider as First Parent / Father (also female individuals are possible)
(OLD!- use selection.f.database/cohorts) Groups of individuals to consider as Second Parent / Mother (also male individuals are possible)
(OLD! - use phenotyping) Quick access to phenotyping for (all: "all", non-phenotyped: "non_obs", non-phenotyped male: "non_obs_m", non-phenotyped female: "non_obs_f")
(OLD! - use culling modules) Groups of individuals for reduce to a new size (by changing class to -1)
(OLD! - use culling modules) Selection criteria for reduction of groups (cf. selection.m / selection.f - default: "random")
(OLD! - use phenotyping.child) Starting phenotypes of newly generated individuals (default: "zero", alt: "mean" of both parents, "obs" - regular observation)
(OLD! - use relationship.matrix) Method to calculate relationship matrix for the breeding value estimation (Default: "vanRaden", alt: "pedigree", "CE", "non_stand", "CE2", "CM")
(OLD! use relationship.matrix.ogc) Method to calculate pedigree matrix in OGC (Default: "pedigree", alt: "vanRaden", "CE", "non_stand", "CE2", "CM")
(OLD! - use new.residual.correlation!) Correlation of the simulated enviromental variance
(OLD! use offpheno.parents.gen/database/cohorts) Generations/cohorts/groups to consider to derive phenotype from offspring phenotypes
(OLD! use offpheno.offspring.gen/database/cohorts) Active generations/cohorts/groups for import of offspring phenotypes
(OLD! use bve.input.phenotype) Select what to use in BVE (default: own phenotype ("own"), offspring phenotype ("off"), their average ("mean") or a weighted average ("weighted"))
(OLD! use selection.index.weights.m/f) Weighting between traits (default: 1)
(OLD! use selection.index.scale.m/f) Default: "bv_sd"; Set to "pheno_sd" when using gains per phenotypic SD, "unit" when using gains per unit, "bve" when using estimated breeding values
Set to TRUE to use recalculate.manual to calculate genomic values (all individuals and traits jointly, default: FALSE)
Maximum number of individuals to process at the same time (( genotypes are in memory ))
compute share of genome inherited from each grandparent based on recombination points (default: FALSE)
Set to value to scale all input for breeding.size / selection.size (This will not work for all breeding programs / less general than json.simulation)
Internal parameter for the parallelization
Experimental parameter for Tobias Niehoff (do not touch!)
Set to FALSE to not compute genetic gains compared to previous generation (selection)
Id to assign to first next individual generated
Use this to skip copying some entries from the internal storage ((minor speed up))
population <- creating.diploid(nsnp=1000, nindi=100)
population <- breeding.diploid(population, breeding.size=100, selection.size=c(25,25))
Run the code above in your browser using DataLab