pred_genvar: Predict the genetic variance in prospective crosses

View source: R/family_genetic_variance.R

pred_genvarR Documentation

Predict the genetic variance in prospective crosses

Description

Uses the expected genetic variance formula and marker effects to predict the genetic variance and correlation in potential crosses.

Usage

pred_genvar(
  genome,
  pedigree,
  training.pop,
  founder.pop,
  crossing.block,
  method = c("RRBLUP", "BRR", "BayesA", "BL", "BayesB", "BayesC"),
  n.iter = 1500,
  burn.in = 500,
  thin = 5,
  save.at = ""
)

Arguments

genome

An object of class genome.

pedigree

A pedigree detailing the scheme to develop the family. Use sim_pedigree to generate.

training.pop

An object of class pop with the elements geno and pheno_val. This is used as the training population.

founder.pop

An object of class pop with the geno information for the parents. Additional individuals can be present in parent_pop. They will be filtered according to the parents in the crossing.block.

crossing.block

A crossing block detailing the crosses to make. Must be a data.frame with 2 columns: the first gives the name of parent 1, and the second gives the name of parent 2. See sim_crossing_block.

method

The statistical method to predict marker effects. If "RRBLUP", the mixed.solve function is used. Otherwise, the BGLR function is used.

n.iter, burn.in, thin

Number of iterations, number of burn-ins, and thinning, respectively. See BGLR.

save.at

See BGLR.

Examples


# Simulate a genome
n.mar  <- c(505, 505, 505)
len <- c(120, 130, 140)

genome <- sim_genome(len, n.mar)

# Simulate a quantitative trait influenced by 50 QTL
qtl.model <- matrix(NA, 50, 4)
genome <- sim_gen_model(genome = genome, qtl.model = qtl.model, 
                        add.dist = "geometric", max.qtl = 50)

# Simulate the genotypes for 8 founders
founder.pop <- sim_founders(genome = genome, n.str = 8)
training.pop <- sim_phenoval(founder.pop, h2 = 0.8)

# Generate a crossing block with 5 crosses
cb <- sim_crossing_block(parents = indnames(founder.pop), n.crosses = 5)

# Create a pedigree with 100 individuals selfed to the F_3 generation
ped <- sim_pedigree(n.par = 2, n.ind = 100, n.selfgen = 2)

pred_genvar(genome = genome, pedigree = ped, training.pop = training.pop, 
            founder.pop = founder.pop, crossing.block = cb)
                

## If two traits are present, the genetic correlation is calculated
# Simulate two quantitative traits influenced by 50 pleiotropic QTL
qtl.model <- replicate(2, matrix(NA, 50, 4), simplify = FALSE)
genome <- sim_multi_gen_model(genome = genome, qtl.model = qtl.model, corr = 0.99, 
                              prob.corr = cbind(0, 1), add.dist = "normal")

# Simulate the genotypes for 8 founders
founder.pop <- sim_founders(genome = genome, n.str = 8)
training.pop <- sim_phenoval(founder.pop, h2 = 0.8)

pred_genvar(genome = genome, pedigree = ped, training.pop = training.pop, 
            founder.pop = founder.pop, crossing.block = cb)


neyhartj/pbsim documentation built on Nov. 11, 2023, 4:07 p.m.