Loading Existing Data into a Simulation

knitr::opts_chunk$set(fig.dpi = 96)
knitr::opts_chunk$set(echo = TRUE)

Load the BreedingSchemeLanguage.

library(BreedingSchemeLanguage)

Avoid writing over a previously existing simulation environment

if (exists("simEnv")){
  rm(list=names(simEnv), envir=simEnv)
  rm(simEnv)
}

Find the path to the HapMap file in the package

filePathName <- system.file("extdata", "exampleHapMapFile.hmp", package = "BreedingSchemeLanguage")
hapmap <- readLines(con=filePathName)
hapmap[11] <- ""
for (i in 1:11)
  cat(paste(substr(hapmap[i], 1, 83), "..."), "\n")

Load the historical haplotypes into the simulation environment

simEnv <- defineSpecies(loadData=NULL, importFounderHap=filePathName, nChr=5, lengthChr=100, nMarkers=300)
initializePopulation()

Run selection on founders

phenotype()
genotype()
predictValue()
select(nSelect=50)
cross(equalContribution=T)

Intense selection on genomic predictions

genotype()
predictValue()
select(nSelect=5)
cross()
cycleMeans <- plotData()


Try the BreedingSchemeLanguage package in your browser

Any scripts or data that you put into this service are public.

BreedingSchemeLanguage documentation built on May 2, 2019, 10:17 a.m.