mppop.predict: Predict genetic variance and genetic correlations in...

View source: R/mppop_predict.R

mppop.predictR Documentation

Predict genetic variance and genetic correlations in multi-parent populations using a deterministic model

Description

This function returns predictions of the genotypic mean, genetic variance, usefulness criterion (superior progeny mean) in a set of multi-parent populations using marker effects and a genetic map. If more than two traits are specified, the function will also return predictions of the genetic correlation in the population and the correlated response to selection.

Usage

mppop.predict(
  G.in,
  y.in,
  map.in,
  crossing.table,
  parents,
  tail.p = 0.1,
  self.gen = Inf,
  DH = FALSE,
  model = c("rrBLUP", "BayesC"),
  n.core = 1
)

mppop_predict2(
  M,
  y.in,
  marker.effects,
  map.in,
  crossing.table,
  tail.p = 0.1,
  self.gen = Inf,
  DH = FALSE,
  model = c("rrBLUP", "BayesC"),
  n.core = 1
)

Arguments

G.in

See G.in in pop.predict.

y.in

A data frame of phenotypic means. The first column should include the entry name and subsequent columns should include phenotypic values. Ignored if marker.effects is passed.

map.in

See map.in in pop.predict.

crossing.table

See crossing.table in pop.predict.

parents

See parents in pop.predict.

tail.p

See tail.p in pop.predict.

self.gen

The number of selfing generations in the potential cross. Can be an integer or Inf for recombinant inbreds. Note: self.gen = 1 corresponds to an F2 population.

DH

Indicator if doubled-haploids are to be induced after the number of selfing generations indicated by self.gen. For example, if self.gen = 0 and DH = TRUE, then doubled-haploids are asssumed to be induced using gametes from F1 plants.

model

See models in pop.predict. Only 1 model is allowed.

n.core

Number of cores for parallelization; only works on a Linux or Mac OS operating system.

M

A Matrix of marker genotypes of dimensions nLine x nMarker, coded as -1, 0, and 1.

marker.effects

A data frame of marker effects. The first column should include the marker name and subsequent columns should include the marker effects.

Functions

  • mppop_predict2():

Examples


# Load data
data("phenos")
data("genos")
data("map")

# Create 10, 4-way parent combinations
  crosses <- as.data.frame(
    matrix(data = sample(row.names(genos), 40), nrow = 10, byrow = TRUE,
           dimnames = list(NULL, paste0("parent", 1:4))),
    stringsAsFactors = FALSE)

# Format the genotype data
G_in <- as.data.frame(cbind( c("", row.names(genos)), rbind(colnames(genos), genos)) )

# Run predictions
pred_out <- mppop.predict(G.in = G_in, y.in = phenos, map.in = map,
                          crossing.table = crosses, self.gen = 6)



# Load data
data("phenos")
data("genos")
data("map")

# Create 25, 4-way parent combinations
  crosses <- as.data.frame(
    matrix(data = sample(row.names(genos), 25 * 4), nrow = 25, byrow = TRUE,
           dimnames = list(NULL, paste0("parent", 1:4))),
    stringsAsFactors = FALSE)

# Run predictions
pred_out <- mppop_predict2(M = genos, y.in = phenos, map.in = map,
                           crossing.table = crosses, self.gen = 6)

# Many more possible crosses - this takes a while
## Not run: 

crosses <- as.data.frame(t(combn(x = sample(row.names(genos), 20), m = 4)), stringsAsFactors = FALSE)

pred_out <- mppop_predict2(M = genos, y.in = phenos, map.in = map,
                           crossing.table = crosses, self.gen = 6)


## End(Not run)


## Pass marker effects instead of phenotypes
# First calculate marker effects
phenos2 <- as.matrix(phenos[,-1]); row.names(phenos2) <- phenos[,1]
phenos2 <- phenos2[row.names(genos),]

mar_eff <- apply(X = phenos2, MARGIN = 2, FUN = function(y) mixed.solve(y = y, Z = genos)$u)
marker_effects <- data.frame(marker = row.names(mar_eff), mar_eff, stringsAsFactors = FALSE)

pred_out <- mppop_predict2(M = genos, marker.effects = marker_effects, map.in = map,
                           crossing.table = crosses, self.gen = 6)




neyhartj/gws documentation built on Feb. 5, 2024, 12:42 a.m.