pop.predict2 | R Documentation |
Predict genetic variance and genetic correlations using a deterministic model
Predict genetic variance and genetic correlations using a deterministic model
pop.predict2(
G.in,
y.in,
map.in,
crossing.table,
parents,
tail.p = 0.1,
self.gen = Inf,
DH = FALSE,
model = c("rrBLUP", "BayesC")
)
pop_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
)
G.in |
See |
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 |
map.in |
See |
crossing.table |
See |
parents |
See |
tail.p |
See |
self.gen |
The number of selfing generations in the potential cross. Can be an integer or |
DH |
Indicator if doubled-haploids are to be induced after the number of selfing generations indicated by
|
model |
See |
M |
A Matrix of marker genotypes of dimensions |
marker.effects |
A data frame of marker effects. The first column should include the marker name and subsequent columns should include the marker effects. |
n.core |
Number of cores for parallelization; only works on a Linux or Mac OS operating system. |
pop_predict2()
:
# Load data
data("phenos")
data("genos")
data("map")
# Create 10, 2-way parent combinations
crosses <- as.data.frame(
matrix(data = sample(row.names(genos), 20), nrow = 10, byrow = TRUE,
dimnames = list(NULL, paste0("parent", 1:2))),
stringsAsFactors = FALSE)
# Format the genotype data
G_in <- as.data.frame(cbind( c("", row.names(genos)), rbind(colnames(genos), genos)) )
# Run predictions
pred_out <- pop.predict2(G.in = G_in, y.in = phenos, map.in = map,
crossing.table = crosses)
# Load data
data("phenos")
data("genos")
data("map")
# Create 10, 2-way parent combinations
crosses <- as.data.frame(
matrix(data = sample(row.names(genos), 20), nrow = 10, byrow = TRUE,
dimnames = list(NULL, paste0("parent", 1:2))),
stringsAsFactors = FALSE)
# Run predictions
pred_out <- pop_predict2(M = genos, y.in = phenos, map.in = map,
crossing.table = crosses)
## 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 <- pop_predict2(M = genos, marker.effects = marker_effects, map.in = map,
crossing.table = crosses, self.gen = 6)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.