Quantitative Trait Minimize Inbreeding.


  Similar to the previous example, a bash script is outlined below that illustrates the impact of different mating designs on the inbreeding levels in the progeny. A total of four mating design methods are simulated and include random, random125, minPedigree, minROH and minGenomic. A total of 5 replicates were generated. After a scenario is done the directory where the replicates are saved is renamed within the bash script.

##--------------------------------------------------------------------
## First generate parameter file. Put parameters to change at the very
## bottom of the file. That way you can use the 'head' linux command
## for the parameters that change and use the 'echo' linux command to
## add any new parameters.
##--------------------------------------------------------------------
## In case Example14.txt is still a file ##
rm -rf Example14.txt || TRUE
# Parameters that are the same #
echo '-| General |-' >> Example14.txt
echo 'SEED: 1500' >> Example14.txt
echo 'NREP: 5' >> Example14.txt
echo '−| Genome & Marker |−' >> Example14.txt
echo 'CHR: 3' >> Example14.txt
echo 'CHR_LENGTH: 150 150 150' >> Example14.txt
echo 'NUM_MARK: 3000 3000 3000' >> Example14.txt
echo 'QTL: 200 200 200' >> Example14.txt
echo '−| Population |−' >> Example14.txt
echo 'FOUNDER_Effective_Size: Ne70' >> Example14.txt
echo 'MALE_FEMALE_FOUNDER: 50 500 random 5' >> Example14.txt
echo 'VARIANCE_A: 0.45' >> Example14.txt
echo '−| Selection |−' >> Example14.txt
echo 'GENERATIONS: 20' >> Example14.txt
echo 'INDIVIDUALS: 50 0.2 500 0.2' >> Example14.txt
echo 'PROGENY: 1' >> Example14.txt
echo 'SELECTION: ebv high' >> Example14.txt
echo 'EBV_METHOD: pblup' >> Example14.txt
echo 'CULLING: ebv 8' >> Example14.txt
echo '-| Output Options |-' >> Example14.txt
echo 'GENOME_ROH: 5 10 15 20' >> Example14.txt

##--------------------------------------------------------------------
## First do random
##--------------------------------------------------------------------
echo 'START: sequence' >> Example14.txt
echo 'MATING: random' >> Example14.txt
## Run GenoDiver ##
./GenoDiver Example14.txt
## rename replicate output to rep_pblup ##
mv ./GenoDiverFiles/replicates ./GenoDiverFiles/reps_random

##--------------------------------------------------------------------
## Then do random125
##--------------------------------------------------------------------
## Remove paramters that are changing ##
head -n 21 Example14.txt > Example14a.txt
mv ./Example14a.txt ./Example14.txt
## echo in new paramters ##
echo 'START: founder' >> Example14.txt
echo 'MATING: random125 simu_anneal' >> Example14.txt
## Run GenoDiver ##
./GenoDiver Example14.txt
## rename replicate output to rep_pblup ##
mv ./GenoDiverFiles/replicates ./GenoDiverFiles/reps_random125

##--------------------------------------------------------------------
## Then do minPedigree
##--------------------------------------------------------------------
## Remove paramters that are changing ##
head -n 21 Example14.txt > Example14a.txt
mv ./Example14a.txt ./Example14.txt
## echo in new paramters ##
echo 'START: founder' >> Example14.txt
echo 'MATING: minPedigree simu_anneal' >> Example14.txt
## Run GenoDiver ##
./GenoDiver Example14.txt
## rename replicate output to rep_pblup ##
mv ./GenoDiverFiles/replicates ./GenoDiverFiles/reps_minPedigree

##--------------------------------------------------------------------
## Then do minGenomic
##--------------------------------------------------------------------
## Remove paramters that are changing ##
head -n 21 Example14.txt > Example14a.txt
mv ./Example14a.txt ./Example14.txt
## echo in new paramters ##
echo 'START: founder' >> Example14.txt
echo 'MATING: minGenomic simu_anneal' >> Example14.txt
## Run GenoDiver ##
./GenoDiver Example14.txt
## rename replicate output to rep_pblup ##
mv ./GenoDiverFiles/replicates ./GenoDiverFiles/reps_minGenomic

##--------------------------------------------------------------------
## Then do minROH
##--------------------------------------------------------------------
## Remove paramters that are changing ##
head -n 21 Example14.txt > Example14a.txt
mv ./Example14a.txt ./Example14.txt
## echo in new paramters ##
echo 'START: founder' >> Example14.txt
echo 'MATING: minROH simu_anneal' >> Example14.txt
## Run GenoDiver ##
./GenoDiver Example14.txt
## rename replicate output to rep_pblup ##
mv ./GenoDiverFiles/replicates ./GenoDiverFiles/reps_minROH

Parameter File Summary
  Sequence information is generated for three chromosomes with a length of 150 Megabases. The genome simulated has a high degree of short-range LD (Ne70). The SNP panel contains 9,000 markers (i.e. 3,000 markers per chromosome). For each chromosome, 200 randomly placed QTL and zero FTL mutations were generated. The quantitative trait simulated has a narrow sense heritability of 0.45 and only additive effects are generated (i.e. no dominance). The phenotypic variance is by default set at 1.0, and therefore the residual variance is 0.55. The founder population consisted of 50 males and 500 females. For each generation, a total of 50 males and 500 females are in the population. A total of 10 and 100 (0.2 replacement rate) male and female parents, respectively, are culled and replaced by new progeny each generation. Random selecton of progeny and culling of parents was conducted for 5 generations. After 5 generations, animals with a high EBV were selected or culled each generation. The EBV are estimated using a pedigree-based BLUP utilizing all the animals. Each mating pair produced one progeny. Parents were mated at random, avoided matings on parents with relationships greater than 0.125, minimized parental pedigree relationship, or minimized parental genomic relationships. Other than random, matings were optimized based on the simulated annealing method.

  Similar to Example 6, the important files are saved within the renamed replicate folder within each scenario. The replicate number is appended to the file name. The bash script above renames the replicate directories to "reps_random", "reps_random125", "reps_minPedigree", "minROH" and "reps_minGenomic " for the random, random125, minPedigree, minROH and minGenomic, respectively.

  Outlined below is a more detailed explanation of the major differences in the mating designs across the different scenarios:
  • random: Parents are mated at random.
  • random125: In order to avoid the mating of closely related animals, parents with a relationship greater than 0.125 were avoided. Any relationship that is below this value was changed to a value of zero and as a result mating was done at random. The log file provides information on how many matings were initially over the 0.125 threshold prior to the simulated annealing optimization method and after optimization was conducted.
  • minPedigree: The average pedigree-based relationship between parents was minimized across all parents using the simulated annealing optimization method. Similar to random125, the average parental pedigree-based relationship prior to and after optimization is outlined in the log file.
  • minROH: The average ROH-based relationship between parents was minimized across all parents using the simulated annealing optimization method. Similar to random125, the average parental ROH-based relationship prior to and after optimization is outlined in the log file.
  • minGenomic: The average genomic-based relationship between parents was minimized across all parents using the simulated annealing optimization method. Similar to random125, the average parental genomic-based relationship prior to and after optimization is outlined in the log file.
  Utilizing the R code outlined below the following plot was generated to illustrate how to loop through each scenario and generate plots that describe the impact of a mating design on the level of pedigree and genomic inbreeding. As outlined below genomic information allows for one to estimate the relationships between the founders that are assumed unrelated with pedigree information. As a result a large drop in genomic inbreeding is seen when minimizing with genomic information compared to pedigree-based information.

R-Code
rm(list=ls()); gc()
library(ggplot2); library(tidyverse)
## Change
wd <- "/Users/jeremyhoward/Documents/39_GenoDiver_C++Code/WebsiteExamples/Example14/"
scen <- c("reps_random","reps_random125","reps_minPedigree","reps_minROH","reps_minGenomic") ## the directory name for each scenario ##
reps <- c(1500:1514) ## Number of replicates simulated ##
###############################################################################
## Loop through and grab pedigree inbreeding across scenarios and replicates ##
###############################################################################
for(i in 1:length(scen))
{
for(j in 1:length(reps))
{
    filename <- paste(wd,scen[i],"/Summary_Statistics_DataFrame_Inbreeding_",reps[j],sep="")
    df <- read_table2(file=filename,col_names = TRUE,col_type = "dcccccccccccccc") %>%
        mutate(inbf = as.numeric(matrix(unlist(strsplit(ped_f, "[()]")), ncol = 2, byrow = TRUE)[, 1]),
                     inbroh = as.numeric(matrix(unlist(strsplit(PropROH, "[()]")), ncol = 2, byrow = TRUE)[, 1]),
                     Method = unlist(strsplit(scen[i],"_"))[2], Rep = reps[j]) %>%
        select(Generation,Method,inbf,inbroh)
    if(j == 1 & i == 1){summarytable <- df}
    if(j > 1 | i > 1){summarytable <- rbind(summarytable,df);}
}
}
#############################################################
## Plot Pedigree Inbreeding Trend across Different Methods ##
#############################################################
means <- aggregate(inbf ~ Generation + Method, data=summarytable,FUN=mean)
sds <- aggregate(inbf ~ Generation + Method, data=summarytable,FUN=sd)
plotdf <- cbind(means,sds[,3]); rm(means,sds)
names(plotdf) <- c("Generation","Method","Mean","SD")

pd <- position_dodge(0.5) ggplot(plotdf, aes(x=Generation, y=Mean, colour=Method)) +
geom_errorbar(aes(ymin=Mean-SD, ymax=Mean+SD), colour="black", width=.4, size = 0.5, position=pd) +
geom_point(size=2.0) + geom_line(size=0.50) + theme_bw() +
labs(title = "Pedigree Inbreeding Trend \n (+/- 1 SD)", x = "Generation", y = "Mean Pedigree Inbreeding") +
theme(plot.title = element_text(size = 16,hjust = 0.5),axis.title = element_text(size = 12),
legend.position="bottom",axis.text=element_text(size=10))
#############################################################
## Plot PropROH Inbreeding Trend across Different Methods ##
#############################################################
means <- aggregate(inbroh ~ Generation + Method, data=summarytable,FUN=mean)
sds <- aggregate(inbroh ~ Generation + Method, data=summarytable,FUN=sd)
plotdf <- cbind(means,sds[,3]); rm(means,sds)
names(plotdf) <- c("Generation","Method","Mean","SD")

pd <- position_dodge(0.5) ggplot(plotdf, aes(x=Generation, y=Mean, colour=Method)) +
geom_errorbar(aes(ymin=Mean-SD, ymax=Mean+SD), colour="black", width=.4, size = 0.5, position=pd) +
geom_point(size=2.0) + geom_line(size=0.50) + theme_bw() +
labs(title = "Proportion in ROH Trend \n (+/- 1 SD)", x = "Generation", y = "Mean ROH Inbreeding") +
theme(plot.title = element_text(size = 16,hjust = 0.5),axis.title = element_text(size = 12),
legend.position="bottom",axis.text=element_text(size=10))