Using PopVar

Introduction

To make progress in breeding, populations should have a favorable mean and high genetic variance (Bernardo 2010). These two parameters can be combined into a single measure called the usefulness criterion (Schnell and Utz 1975), visualized in Figure 1.

Figure 1. Visualization of the mean, genetic variance, and superior progeny mean of a single population.
Figure 1. Visualization of the mean, genetic variance, and superior progeny mean of a single population.

Ideally, breeders would identify the set of parent combinations that, when realized in a cross, would give rise to populations meeting these requirements. PopVar is a package that uses phenotypic and genomewide marker data on a set of candidate parents to predict the mean, genetic variance, and superior progeny mean in bi-parental or multi-parental populations. Thre package also contains functionality for performing cross-validation to determine the suitability of different statistical models. More details are available in Mohammadi, Tiede, and Smith (2015). A dataset think_barley is included for reference and examples.

Installation

You can install the released version of PopVar from CRAN with:

install.packages("PopVar")

And the development version from GitHub with:

# install.packages("devtools")
devtools::install_github("UMN-BarleyOatSilphium/PopVar")

Functions

Below is a description of the functions provided in PopVar:

Function Description
pop.predict Uses simulations to make predictions in recombinant inbred line populations; can internally perform cross-validation for model selections; can be quite slow.
pop.predict2 Uses deterministic equations to make predictions in populations of complete or partial selfing and with or without the induction of doubled haploids; is much faster than pop.predict; does not perform cross-validation or model selection internally.
pop_predict2 Has the same functionality as pop.predict2, but accepts genomewide marker data in a simpler matrix format.
x.val Performs cross-validation to estimate model performance.
mppop.predict Uses deterministic equations to make predictions in 2- or 4-way populations of complete or partial selfing and with or without the induction of doubled haploids; does not perform cross-validation or model selection internally.
mpop_predict2 Has the same functionality as mppop.predict, but accepts genomewide marker data in a simpler matrix format.

Examples

Below are some example uses of the functions in PopVar:

# Load the package
library(PopVar)

# Load the example data
data("think_barley", package = "PopVar")

Predictions using simulated populations

The code below simulates a single population of 1000 individuals for each of 150 crosses. For the sake of speed, the marker effects are predicted using RR-BLUP and no cross-validation is performed.

out <- pop.predict(G.in = G.in_ex, y.in = y.in_ex, map.in = map.in_ex,
                   crossing.table = cross.tab_ex,
                   nInd = 1000, nSim = 1, 
                   nCV.iter = 1, models = "rrBLUP")
#> Warning in read.cross.csv(dir, file, na.strings, genotypes, estimate.map, : There is no genotype data!
#> Warning in summary.cross(cross): Some markers at the same position on chr
#> 1,2,3,4,5,6,7; use jittermap().
#> Warning in summary.cross(cross): Strange genotype pattern on chr 7.

The function returns a list, one element of which is called predictions. This element is itself a list of matrices containing the predictions for each trait. They can be combined as such:

predictions1 <- lapply(X = out$predictions, FUN = function(x) {
  x1 <- as.data.frame(apply(X = x, MARGIN = 2, FUN = unlist), stringsAsFactors = FALSE)
  cbind(x1[,c("Par1", "Par2")], sapply(X = x1[,-1:-2], as.numeric)) 
})

# Display the first few lines of the predictions for grain yield
knitr::kable(head(predictions1$Yield_param.df))
Par1 Par2 midPar.Pheno midPar.GEBV pred.mu pred.mu_sd pred.varG pred.varG_sd mu.sp_low mu.sp_high low.resp_FHB low.resp_DON low.resp_Height high.resp_FHB high.resp_DON high.resp_Height cor_w/_FHB cor_w/_DON cor_w/_Height
FEG66-08 MN97-125 99.200 100.65607 100.64406 NA 7.464307 NA 95.92832 105.2548 23.35907 23.76460 78.40643 24.95530 25.12242 76.05686 0.2833316 0.2720259 -0.3067130
MN99-71 FEG90-31 NaN 99.17635 99.13643 NA 5.130700 NA 95.26095 103.0822 21.47456 23.58198 77.97437 24.56593 24.84469 75.89233 0.4391725 0.1364071 -0.1464046
MN96-141 FEG183-52 NaN 101.28761 101.19785 NA 5.632336 NA 97.16526 105.2662 23.64409 23.74402 79.75532 27.42616 28.46178 75.77254 0.7439962 0.7392543 -0.5528100
MN99-02 FEG183-52 NaN 100.78451 100.82723 NA 10.335880 NA 95.51624 106.5396 25.75718 24.09052 74.83935 26.43519 26.76683 73.36024 0.1222818 0.4106051 -0.1643662
FEG99-10 FEG148-56 NaN 98.68505 98.69348 NA 4.125649 NA 95.15070 102.2367 19.42478 20.06250 85.86674 23.01845 24.36730 80.15048 0.5795630 0.6286394 -0.5849756
MN99-62 MN01-46 105.775 102.29724 102.38355 NA 5.223807 NA 98.50802 106.0945 26.06657 28.46711 73.04252 26.36968 28.32779 74.23128 0.1267207 -0.1771168 0.4082424

Predictions using deterministic equations

Generating predictions via simulated populations can become computationally burdensome when many thousands or hundreds of thousands of crosses are possible. Fortunately, deterministic equations are available to generate equivalent predictions in a fraction of the time. These equations are provided in the pop.predict2 and pop_predict2 functions.

The pop.predict2 function takes arguments in the same format as pop.predict. We have eliminated the arguments for marker filtering and imputation and cross-validation, as the pop.predict2 function does not support these steps. (You may continue to conduct cross-validation using the x.val function.) Therefore, the genotype data input for pop.predict2 must not contain any missing data. Further, these predictions assume fully inbred parents, so marker genotypes must only be coded as -1 or 1. The data G.in_ex_imputed contains genotype data that is formatted properly.

Below is an example of using the pop.predict2 function:

out2 <- pop.predict2(G.in = G.in_ex_imputed, y.in = y.in_ex, map.in = map.in_ex,
                     crossing.table = cross.tab_ex, models = "rrBLUP")

knitr::kable(head(subset(out2, trait == "Yield")))
parent1 parent2 trait pred_mu pred_varG pred_musp_low pred_musp_high cor_w_FHB cor_w_DON cor_w_Yield cor_w_Height pred_cor_musp_low_FHB pred_cor_musp_low_DON pred_cor_musp_low_Yield pred_cor_musp_low_Height pred_cor_musp_high_FHB pred_cor_musp_high_DON pred_cor_musp_high_Yield pred_cor_musp_high_Height
3 FEG66-08 MN97-125 Yield 100.41166 7.768362 95.52021 105.3031 0.3412831 0.3303378 NA -0.4004154 22.27035 23.76433 NA 78.84012 24.96750 25.91641 NA 75.11838
7 MN99-71 FEG90-31 Yield 98.98546 5.298105 94.94591 103.0250 0.4959745 0.2776666 NA -0.1612311 21.86563 23.41697 NA 77.04669 24.85938 25.18159 NA 75.75153
11 MN96-141 FEG183-52 Yield 101.07137 5.571655 96.92884 105.2139 0.6132612 0.6961326 NA -0.4603399 24.36629 23.67733 NA 79.59345 27.88028 28.40806 NA 75.16009
15 MN99-02 FEG183-52 Yield 100.82967 9.499737 95.42053 106.2388 0.0249962 0.4211875 NA -0.1929275 26.15174 23.73807 NA 74.76672 26.29180 26.60344 NA 72.86270
19 FEG99-10 FEG148-56 Yield 98.01593 4.121803 94.45292 101.5789 0.5959335 0.6401323 NA -0.5080571 19.67552 19.58928 NA 85.81854 23.38585 24.23917 NA 80.69997
23 MN99-62 MN01-46 Yield 102.51094 4.673197 98.71709 106.3048 0.0755599 -0.0827658 NA 0.4010907 26.07342 28.37124 NA 72.67125 26.20580 28.16102 NA 74.51340

Note that the output of pop.predict2 is no longer a list, but a data frame containing the combined predictions for all traits.

The formatting requirements of G.in for pop.predict and pop.predict2 are admittedly confusing. Marker genotype data is commonly stored as a n x p matrix, where n is the number of entries and p the number of markers. The function pop_predict2 accommodates this general marker data storage. Here is an example:

out3 <- pop_predict2(M = G.in_ex_mat, y.in = y.in_ex, map.in = map.in_ex,
                     crossing.table = cross.tab_ex, models = "rrBLUP")

knitr::kable(head(subset(out2, trait == "Yield")))
parent1 parent2 trait pred_mu pred_varG pred_musp_low pred_musp_high cor_w_FHB cor_w_DON cor_w_Yield cor_w_Height pred_cor_musp_low_FHB pred_cor_musp_low_DON pred_cor_musp_low_Yield pred_cor_musp_low_Height pred_cor_musp_high_FHB pred_cor_musp_high_DON pred_cor_musp_high_Yield pred_cor_musp_high_Height
3 FEG66-08 MN97-125 Yield 100.41166 7.768362 95.52021 105.3031 0.3412831 0.3303378 NA -0.4004154 22.27035 23.76433 NA 78.84012 24.96750 25.91641 NA 75.11838
7 MN99-71 FEG90-31 Yield 98.98546 5.298105 94.94591 103.0250 0.4959745 0.2776666 NA -0.1612311 21.86563 23.41697 NA 77.04669 24.85938 25.18159 NA 75.75153
11 MN96-141 FEG183-52 Yield 101.07137 5.571655 96.92884 105.2139 0.6132612 0.6961326 NA -0.4603399 24.36629 23.67733 NA 79.59345 27.88028 28.40806 NA 75.16009
15 MN99-02 FEG183-52 Yield 100.82967 9.499737 95.42053 106.2388 0.0249962 0.4211875 NA -0.1929275 26.15174 23.73807 NA 74.76672 26.29180 26.60344 NA 72.86270
19 FEG99-10 FEG148-56 Yield 98.01593 4.121803 94.45292 101.5789 0.5959335 0.6401323 NA -0.5080571 19.67552 19.58928 NA 85.81854 23.38585 24.23917 NA 80.69997
23 MN99-62 MN01-46 Yield 102.51094 4.673197 98.71709 106.3048 0.0755599 -0.0827658 NA 0.4010907 26.07342 28.37124 NA 72.67125 26.20580 28.16102 NA 74.51340

Benchmarking and comparisons

The code below compares the functions pop.predict and pop.predict2 with respect to computation time and results:

time1 <- system.time({
  capture.output(pop.predict.out <- pop.predict(
    G.in = G.in_ex_imputed, y.in = y.in_ex, map.in = map.in_ex, crossing.table = cross.tab_ex,
    nInd = 1000, nSim = 1, nCV.iter = 1, models = "rrBLUP"))
})
#> Warning in read.cross.csv(dir, file, na.strings, genotypes, estimate.map, : There is no genotype data!
#> Warning in summary.cross(cross): Some markers at the same position on chr
#> 1,2,3,4,5,6,7; use jittermap().
#> Warning in summary.cross(cross): Strange genotype pattern on chr 7.

time2 <- system.time({pop.predict2.out <- pop.predict2(
  G.in = G.in_ex_imputed, y.in = y.in_ex, map.in = map.in_ex,
  crossing.table = cross.tab_ex,model = "rrBLUP")})

# Print the time (seconds) required for each function.
c(pop.predict = time1[[3]], pop.predict2 = time2[[3]])
#>  pop.predict pop.predict2 
#>       24.630        0.413

Plot results

predictions1 <- lapply(X = pop.predict.out$predictions, FUN = function(x) {
  x1 <- as.data.frame(apply(X = x, MARGIN = 2, FUN = unlist), stringsAsFactors = FALSE)
  cbind(x1[,c("Par1", "Par2")], sapply(X = x1[,-1:-2], as.numeric))
})

pop.predict.out1 <- predictions1$Yield_param.df[,c("Par1", "Par2", "pred.varG")]
pop.predict2.out1 <- subset(pop.predict2.out, trait == "Yield", c(parent1, parent2, pred_varG))

toplot <- merge(pop.predict.out1, pop.predict2.out1, by.x = c("Par1", "Par2"),
                by.y = c("parent1", "parent2"))

plot(pred.varG ~ pred_varG, toplot,
     xlab = "pop.predict2", ylab = "pop.predict",
     main = "Comparsion of predicted genetic variance")

Multi-parent populations

PopVar also includes functions for predicting the mean, genetic variance, and superior progeny mean of multi-parent populations. The mppop.predict function takes the same inputs as pop.predict or pop.predict2, and the mppop_predict2 function takes the same inputs as pop_predict2. Both require the additional argument n.parents, which will determine whether the populations are formed by 2- or 4-way matings (support for 8-way populations is forthcoming.)

Below is an example of using the mppop.predict function:

# Generate predictions for all possible 4-way crosses of 10 sample parents
sample_parents <- sample(unique(unlist(cross.tab_ex)), 10)

mp_out <- mppop.predict(G.in = G.in_ex_imputed, y.in = y.in_ex, map.in = map.in_ex,
                        parents = sample_parents, n.parents = 4, models = "rrBLUP")

knitr::kable(head(subset(mp_out, trait == "Yield")))
parent1 parent2 parent3 parent4 trait pred_mu pred_varG pred_musp_low pred_musp_high FHB DON Yield Height pred_cor_musp_low_FHB pred_cor_musp_low_DON pred_cor_musp_low_Yield pred_cor_musp_low_Height pred_cor_musp_high_FHB pred_cor_musp_high_DON pred_cor_musp_high_Yield pred_cor_musp_high_Height
3 6B98-9170 FEG104-63 FEG116-48 FEG160-03 Yield 101.11758 10.036594 95.55769 106.6775 0.0263049 0.2007533 NA 0.0907604 22.44131 23.34070 NA 76.43715 22.64575 24.69479 NA 77.48905
7 6B98-9170 FEG104-63 FEG116-48 FEG184-24 Yield 100.28887 11.178338 94.42126 106.1565 0.1385535 0.3496856 NA -0.0965668 22.42102 21.64912 NA 78.67004 23.48441 24.20691 NA 77.66453
11 6B98-9170 FEG104-63 FEG116-48 FEG43-82 Yield 99.75673 11.406303 93.82959 105.6839 -0.0416446 0.2578051 NA -0.1090806 24.62402 23.50294 NA 79.23294 24.32436 25.07689 NA 77.98659
15 6B98-9170 FEG104-63 FEG116-48 FEG80-06 Yield 101.43360 8.848342 96.21320 106.6540 0.0589678 0.2089737 NA 0.0748475 23.27901 24.09849 NA 76.29393 23.68752 25.37725 NA 77.02011
19 6B98-9170 FEG104-63 FEG116-48 M114 Yield 100.31859 9.770907 94.83278 105.8044 0.0887282 0.2866948 NA 0.0512935 23.45004 23.06305 NA 75.74411 24.07910 24.89309 NA 76.22599
23 6B98-9170 FEG104-63 FEG116-48 MN01-54 Yield 101.93227 9.481198 96.52841 107.3361 0.1371884 0.2539557 NA 0.0457819 23.88473 24.77605 NA 75.28369 24.85756 26.43553 NA 75.71613

Below is an example of using the mppop_predict2 function:

# Generate predictions for all possible 4-way crosses of 10 sample parents
mp_out2 <- mppop_predict2(M = G.in_ex_mat, y.in = y.in_ex, map.in = map.in_ex,
                          parents = sample_parents, n.parents = 4, models = "rrBLUP")

knitr::kable(head(subset(mp_out2, trait == "Yield")))
parent1 parent2 parent3 parent4 trait pred_mu pred_varG pred_musp_low pred_musp_high FHB DON Yield Height pred_cor_musp_low_FHB pred_cor_musp_low_DON pred_cor_musp_low_Yield pred_cor_musp_low_Height pred_cor_musp_high_FHB pred_cor_musp_high_DON pred_cor_musp_high_Yield pred_cor_musp_high_Height
3 6B98-9170 FEG104-63 FEG116-48 FEG160-03 Yield 101.11758 10.036594 95.55769 106.6775 0.0263049 0.2007533 NA 0.0907604 22.44131 23.34070 NA 76.43715 22.64575 24.69479 NA 77.48905
7 6B98-9170 FEG104-63 FEG116-48 FEG184-24 Yield 100.28887 11.178338 94.42126 106.1565 0.1385535 0.3496856 NA -0.0965668 22.42102 21.64912 NA 78.67004 23.48441 24.20691 NA 77.66453
11 6B98-9170 FEG104-63 FEG116-48 FEG43-82 Yield 99.75673 11.406303 93.82959 105.6839 -0.0416446 0.2578051 NA -0.1090806 24.62402 23.50294 NA 79.23294 24.32436 25.07689 NA 77.98659
15 6B98-9170 FEG104-63 FEG116-48 FEG80-06 Yield 101.43360 8.848342 96.21320 106.6540 0.0589678 0.2089737 NA 0.0748475 23.27901 24.09849 NA 76.29393 23.68752 25.37725 NA 77.02011
19 6B98-9170 FEG104-63 FEG116-48 M114 Yield 100.31859 9.770907 94.83278 105.8044 0.0887282 0.2866948 NA 0.0512935 23.45004 23.06305 NA 75.74411 24.07910 24.89309 NA 76.22599
23 6B98-9170 FEG104-63 FEG116-48 MN01-54 Yield 101.93227 9.481198 96.52841 107.3361 0.1371884 0.2539557 NA 0.0457819 23.88473 24.77605 NA 75.28369 24.85756 26.43553 NA 75.71613

References

Bernardo, Rex. 2010. Breeding for Quantitative Traits in Plants. 2nd ed. Woodbury, Minnesota: Stemma Press.

Mohammadi, Mohsen, Tyler Tiede, and Kevin P. Smith. 2015. “PopVar: A Genome-Wide Procedure for Predicting Genetic Variance and Correlated Response in Biparental Breeding Populations.” Crop Science 55 (5): 2068–77. https://doi.org/10.2135/cropsci2015.01.0030.

Schnell, F. W., and H. F. Utz. 1975. “F1-leistung und elternwahl euphyder züchtung von selbstbefruchtern.” In Bericht über Die Arbeitstagung Der Vereinigung Österreichischer Pflanzenzüchter, 243–48. Gumpenstein, Austria: BAL Gumpenstein.