bsInfo | R Documentation |
bsInfo object store specific information of one breeding scheme.
bsName
[character] name of this breeding scheme
simInfo
[simInfo class] Simulation information (see:simInfo)
specie
[specie class] Specie of the SNPs (see:specie)
lociInfo
[lociInfo object] information about the individuals haplotypes' SNPs (see:lociInfo)
traitInfo
[traitInfo class] Specific information of traits (see:traitInfo)
founderIsInitPop
[logical] Founder haplotype will be regarded as first population or not.
seedSimHaplo
[numeric] Random seed for selecting haplotype from founder haplotype
seedSimRM
[numeric] Random seed for mate pairs
seedSimMC
[numeric] Random seed for make crosses
popNameBase
[character] base of population's name.
populations
[list] A list of population objects
crossInfoList
[list] A list of crossInfo objects
generation
[list] current generation No. in the breeding scheme
herit
[numeric] Heritability for each trait (plot-based/line-based)
envSpecificEffects
[numeric] Effects specific to each environments / treatments. If 'multiTraitsAsEnvs = FALSE', envSpecificEffects will be 0 for all traits.
residCor
[matrix] Residual correlation between traits
lociEffects
[matrix] marker and QTL effects used for crossInfo object
new()
Create a new bsInfo object.
bsInfo$new( bsName = "Undefined", simInfo, specie, lociInfo, traitInfo, geno = NULL, haplo = NULL, founderIsInitPop = TRUE, seedSimHaplo = NA, seedSimRM = NA, seedSimMC = NA, popNameBase = "Population", initIndNames = NULL, herit = NULL, envSpecificEffects = NULL, residCor = NULL, verbose = TRUE )
bsName
[character] Name of this breeding scheme
simInfo
[simInfo class] Simulation information (see:simInfo)
specie
[specie class] Specie of the SNPs (see:specie)
lociInfo
[lociInfo object] information about the individuals haplotypes' SNPs (see:lociInfo)
traitInfo
[traitInfo class] Specific information of traits (see:traitInfo)
geno
[data.frame / matrix] genotype of the individuals encoded in allele dose. If you use real data, you must specify 'geno' or 'haplo' argument.
haplo
[array] haplotype of the individuals scored with 0 and 1 (3-dimensional array).
founderIsInitPop
[logical] Founder haplotype will be regarded as first population or not.
seedSimHaplo
[numeric] Random seed for selecting haplotype from founder haplotype
seedSimRM
[numeric] Random seed for mate pairs
seedSimMC
[numeric] Random seed for make crosses
popNameBase
[character] base of population's name.
initIndNames
[character] NULL or character string vector specifying the individuals
names for initial population. If NULL, rownames(geno)
will be used.
herit
[numeric] Heritability for each trait (plot-based/line-based)
envSpecificEffects
[numeric] Effects specific to each environments / treatments. If 'multiTraitsAsEnvs = FALSE', envSpecificEffects will be 0 for all traits.
residCor
[matrix] Residual correlation between traits
verbose
[logical] Display info (optional)
A new 'bsInfo' object.
### create simulation information mySimInfo <- simInfo$new(simName = "Simulation Example", simGeno = TRUE, simPheno = TRUE, #' nSimGeno = 1, #' nSimPheno = 3, #' nCoreMax = 4, #' nCorePerGeno = 1, #' nCorePerPheno = 3, saveDataFileName = NULL) ### create specie information mySpec <- specie$new(nChr = 3, lChr = c(100, 150, 200), specName = "Example 1", ploidy = 2, mutRate = 10^-8, recombRate = 10^-6, chrNames = c("C1", "C2", "C3"), nLoci = 100, recombRateOneVal = FALSE, effPopSize = 100, simInfo = mySimInfo, verbose = TRUE) ### create lociInfo object myLoci <- lociInfo$new(genoMap = NULL, specie = mySpec) plot(myLoci, alpha = 0.1) ### create traitInfo object myTrait <- traitInfo$new(lociInfo = myLoci, nMarkers = 80, nTraits = 3, nQTLs = c(4, 8, 3), actionTypeEpiSimple = TRUE, qtlOverlap = TRUE, nOverlap = c(2, 3, 0), effCor = 0.1, propDomi = 0.2, interactionMean = c(4, 1, 2)) myTrait$plot(alphaMarker = 0.1) ### create bsInfo object myBsInfo <- bsInfo$new(simInfo = mySimInfo, specie = mySpec, lociInfo = myLoci, traitInfo = myTrait, geno = NULL, haplo = NULL, founderIsInitPop = TRUE, popNameBase = "Population", initIndNames = NULL, verbose = TRUE) ### create cross information object for (i in 1:10) { myCrossInfo <- crossInfo$new(parentPopulation = myBsInfo$populations[[myBsInfo$generation]], method = "randomMate", nNextPop = 100) myBsInfo$nextGeneration(crossInfo = myCrossInfo) } geno <- myBsInfo$overGeneration()$genoMat myBsInfo$print() myBsInfo$plot(plotTarget = "trueAGV", targetTrait = 1:3, targetPopulation = 1:11, plotType = "jitter")
nextGeneration()
create next population
bsInfo$nextGeneration(crossInfo)
crossInfo
[crossInfo class] Information of crossing (including selection scheme) (see:crossInfo)
removeLatestPop()
remove latest population
bsInfo$removeLatestPop()
removeInitialPop()
remove initial population
bsInfo$removeInitialPop()
overGeneration()
assemble populations over generation
bsInfo$overGeneration(targetPop = NULL)
targetPop
[character / numeric] population names or No.s you want to assemble. If NULL, assemble all the populations
parentInd()
search parents of an individual of interest
bsInfo$parentInd(indName)
indName
[character] individual name of interest
print()
Display information about the object
bsInfo$print()
plot()
Draw figures for visualization of each data (GVs)
bsInfo$plot( plotTarget = "trueGV", targetTrait = 1:self$traitInfo$nTraits, targetPopulation = 1:self$generation, plotType = "box", facet_grid = FALSE, unitSd = 1, colorVecBase = c("black", "red", "green", "blue", "lightblue", "purple", "yellow", "gray", "pink", "orange"), widthVecBase = c(1.5, 0.8, 0.8), dashVecBase = c("solid", "dash", "dash") )
plotTarget
[character] Target of figure, select either one of "trueAGV", "trueDGV", "trueEGV", "trueGV", "trueAGVET", "trueDGVET", "trueEGVET", "trueGVET", "trueAGVCT", "trueDGVCT", "trueEGVCT", "trueGVCT".
targetTrait
[numeric] Target traits. character is OK, but numeric vector corresponding to target traits is preferred.
targetPopulation
[numeric] Target populations. character is OK, but numeric vector corresponding to target traits is preferred.
plotType
[character] We offer "box", "violin", "jitter", "lines" to draw figures for genotypic values.
facet_grid
[logical] When you choose "jitter" for plotType, you can select whether you display the plot for wach trait with grid.
unitSd
[numeric] When you choose "lines", we will show the mean, mean + unitSd * sd, mean - unitSd * sd.
colorVecBase
[character] vector representing color of the line for traits in "lines" option
widthVecBase
[numeric] vector representing width of the line in "lines" option
dashVecBase
[character]vector representing solid / dash in "lines" option
clone()
The objects of this class are cloneable with this method.
bsInfo$clone(deep = FALSE)
deep
Whether to make a deep clone.
## ------------------------------------------------
## Method `bsInfo$new`
## ------------------------------------------------
### create simulation information
mySimInfo <- simInfo$new(simName = "Simulation Example",
simGeno = TRUE,
simPheno = TRUE,
#' nSimGeno = 1,
#' nSimPheno = 3,
#' nCoreMax = 4,
#' nCorePerGeno = 1,
#' nCorePerPheno = 3,
saveDataFileName = NULL)
### create specie information
mySpec <- specie$new(nChr = 3,
lChr = c(100, 150, 200),
specName = "Example 1",
ploidy = 2,
mutRate = 10^-8,
recombRate = 10^-6,
chrNames = c("C1", "C2", "C3"),
nLoci = 100,
recombRateOneVal = FALSE,
effPopSize = 100,
simInfo = mySimInfo,
verbose = TRUE)
### create lociInfo object
myLoci <- lociInfo$new(genoMap = NULL, specie = mySpec)
plot(myLoci, alpha = 0.1)
### create traitInfo object
myTrait <- traitInfo$new(lociInfo = myLoci,
nMarkers = 80,
nTraits = 3,
nQTLs = c(4, 8, 3),
actionTypeEpiSimple = TRUE,
qtlOverlap = TRUE,
nOverlap = c(2, 3, 0),
effCor = 0.1,
propDomi = 0.2,
interactionMean = c(4, 1, 2))
myTrait$plot(alphaMarker = 0.1)
### create bsInfo object
myBsInfo <- bsInfo$new(simInfo = mySimInfo,
specie = mySpec,
lociInfo = myLoci,
traitInfo = myTrait,
geno = NULL,
haplo = NULL,
founderIsInitPop = TRUE,
popNameBase = "Population",
initIndNames = NULL,
verbose = TRUE)
### create cross information object
for (i in 1:10) {
myCrossInfo <- crossInfo$new(parentPopulation = myBsInfo$populations[[myBsInfo$generation]],
method = "randomMate",
nNextPop = 100)
myBsInfo$nextGeneration(crossInfo = myCrossInfo)
}
geno <- myBsInfo$overGeneration()$genoMat
myBsInfo$print()
myBsInfo$plot(plotTarget = "trueAGV",
targetTrait = 1:3,
targetPopulation = 1:11,
plotType = "jitter")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.