breederInfo: R6 Class Representing a Breeder

breederInfoR Documentation

R6 Class Representing a Breeder

Description

breederInfo object store specific information of one breeder.

Public fields

breederName

[character] name of this breeder

simInfo

[simInfo class] Simulation information (see:simInfo)

specie

[specie class] Specie of the SNPs (see:specie)

lociInfoFB

[list] information about the individuals haplotypes' SNPs available for breeder

traitInfoFB

[list] Specific information of traits available for breeder

popNameBase

[character] base of population's name.

populationsFB

[list] A list of populationFb objects available for breeders

crossInfoList

[list] A list of crossInfo objects

generation

[list] current generation No. in the breeder

calculateGRMBase

[logical] calculate genomic relationship matrix (GRM) for each population or not

methodsGRMBase

[character] default methods to calculate GRM

calcEpistasisBase

[logical] when additive / dominance GRM has already been calulated, whether or not calculate epistatic GRM

estimatedGVByGRMInfo

[list] A list of information on estimated GVs using GRM

estimatedMrkEffInfo

[list] A list of information on estimated marker effects

estimatedGVByMLRInfo

[list] A list of information on estimated GVs using MLR (multiple linear regression)

multiTraitsAsEnvs

[logical] Treat multiple traits as multiple environments or not

includeIntercept

[logical] Include intercept information when estimating genotypic values by replication

verbose

[boolean] display information

populationFB

[populationFB class] R6 class representing population for breeder

Methods

Public methods


Method new()

Create a new breederInfo object.

Usage
breederInfo$new(
  breederName = "Undefined",
  bsInfo,
  mrkNames = NULL,
  initGenotyping = TRUE,
  initGenotypedIndNames = NULL,
  mafThres = 0.05,
  heteroThres = 1,
  calculateGRMBase = TRUE,
  methodsGRMBase = "addNOIA",
  calcEpistasisBase = FALSE,
  multiTraitsAsEnvs = FALSE,
  includeIntercept = TRUE,
  verbose = TRUE
)
Arguments
breederName

[character] name of this breeder

bsInfo

[bsInfo class] breeding scheme info (whichever generation is OK, but it will use only 1st population) (see:bsInfo)

mrkNames

[character] marker names

initGenotyping

[logical] obtain marker genotype for initial population or not

initGenotypedIndNames

[character] individual names that you want to genotype in initial population

mafThres

[numeric] threshold for removing markers with maf < mafThres

heteroThres

[numeric] threshold for removing markers with heteroRate >= heteroThres

calculateGRMBase

[logical] calculate genomic relationship matrix (GRM) for each population or not

methodsGRMBase

[character] default methods to calculate GRM

calcEpistasisBase

[logical] when additive / dominance GRM has already been calulated, whether or not calculate epistatic GRM

multiTraitsAsEnvs

[logical] Treat multiple traits as multiple environments or not

includeIntercept

[logical] Include intercept information when estimating genotypic values by replication

verbose

[logical] Display info (optional)

Returns

A new 'breederInfo' object.

Examples
### 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^-7,
                     recombRateOneVal = FALSE,
                     chrNames = c("C1", "C2", "C3"),
                     nLoci = 100,
                     effPopSize = 100,
                     simInfo = mySimInfo,
                     verbose = TRUE)
print(mySpec)

Method getNewPopulation()

get information on new population

Usage
breederInfo$getNewPopulation(
  bsInfo,
  generationNew = NULL,
  genotyping = TRUE,
  genotypedIndNames = NULL
)
Arguments
bsInfo

[bsInfo class] a bsInfo class object

generationNew

[numeric] a generation of new population

genotyping

[logical] Whether or not you want to genotype

genotypedIndNames

[character] individual names that you want to genotype


Method phenotyper()

get phenotypic values on current population

Usage
breederInfo$phenotyper(
  bsInfo,
  generationOfInterest = NULL,
  nRep = 1,
  phenotypedIndNames = NULL,
  estimateGV = TRUE,
  estimatedGVMethod = "lme4"
)
Arguments
bsInfo

[bsInfo class] a bsInfo class object

generationOfInterest

a generation where you want to obtain phenotypic values from population

nRep

[numeric] Replication of the field trial (common to all traits)

phenotypedIndNames

[character] individual names that you want to phenotype

estimateGV

[logical] estimate genotypic values by replication or not

estimatedGVMethod

[character] We offer 'lme4' and 'mean'. 'lme4' is recommended.

multiTraitsAsEnvs

[logical] Treat multiple traits as multiple environments or not


Method estimateGVByGRM()

estimate genotypic values based on GBLUP

Usage
breederInfo$estimateGVByGRM(
  trainingPop = NULL,
  testingPop = NULL,
  testingIndNames = NULL,
  methodsGRMFP = "addNOIA",
  bayesian = FALSE,
  multiTrait = FALSE,
  nIter = 10000,
  burnIn = 2000,
  thin = 5
)
Arguments
trainingPop

[character / numeric] training population names or No.s (not generations!!)

testingPop

[character / numeric] testing population names or No.s (not generations!!)

testingIndNames

[character] names of testing individuals

methodsGRMFP

[character] methods for calculating GRM for prediction

bayesian

[logical] use bayesian model (BGLR) or not (RAINBOWR) for solving mixed-effects model

multiTrait

[logical] use multiple-trait model for estimation of genotypic values

nIter

[numeric] the number of iterations

burnIn

[numeric] the number of burn-in

thin

[numeric] the number of thinning


Method estimateMrkEff()

estimate marker effects based on multiple linear regression (machine learning)

Usage
breederInfo$estimateMrkEff(
  trainingPop = NULL,
  trainingIndNames = NULL,
  methodMLR = "Ridge",
  multiTrait = FALSE,
  alpha = 0.5,
  nIter = 10000,
  burnIn = 2000,
  thin = 5,
  bayesian = FALSE,
  alphaMarker = 0.5,
  sizeMrkMin = 2,
  sizeMrkMax = 12
)
Arguments
trainingPop

[character / numeric] training population names or No.s (not generations!!)

trainingIndNames

[character] names of training individuals

methodMLR

[character] methods for estimating marker effects. The following methods are offered:

"Ridge", "LASSO", "ElasticNet", "RR-BLUP", "GBLUP", "BayesA" (uni-trait), "BayesB" (uni-trait), "BayesC" (uni-trait), "BRR", "BL" (uni-trait), "SpikeSlab" (multi-trait)

multiTrait

[logical] use multiple-trait model for estimation of marker effects or not

alpha

[numeric] the elastic net mixing parameter, with 0 \leq \alpha \leq 1. The penalty is defined as

\frac {1 - \alpha} { 2 } || \beta || _ 2 ^ 2 + \alpha || \beta || _ 1

'alpha = 1' is the lasso penalty, and 'alpha = 0' the ridge penalty.

nIter

[numeric] the number of iterations

burnIn

[numeric] the number of burn-in

thin

[numeric] the number of thinning

bayesian

[logical] use bayesian model (BGLR) or not (RAINBOWR) for solving mixed-effects model (only when ‘methodMLR = ’GBLUP'', this argument is valid.)

alphaMarker

[numeric] for plot: transparency for markers, see plot_ly

sizeMrkMin

[numeric] for plot: size for marker with minimum estimated effect

sizeMrkMax

[numeric] for plot: size for marker with maximum estimated effect


Method estimateGVByMLR()

estimate genotypic values based on GBLUP

Usage
breederInfo$estimateGVByMLR(
  trainingPop = NULL,
  trainingIndNames = NULL,
  testingPop = NULL,
  testingIndNames = NULL,
  methodMLR = "Ridge",
  multiTrait = FALSE,
  alpha = 0.5,
  nIter = 10000,
  burnIn = 2000,
  thin = 5,
  bayesian = FALSE
)
Arguments
trainingPop

[character / numeric] training population names or No.s (not generations!!)

trainingIndNames

[character] names of training individuals

testingPop

[character / numeric] testing population names or No.s (not generations!!)

testingIndNames

[character] names of testing individuals

methodMLR

[character] methods for estimating marker effects. The following methods are offered:

"Ridge", "LASSO", "ElasticNet", "RR-BLUP", "GBLUP", "BayesA" (uni-trait), "BayesB" (uni-trait), "BayesC" (uni-trait), "BRR", "BL" (uni-trait), "SpikeSlab" (multi-trait)

multiTrait

[logical] use multiple-trait model for estimation of marker effects or not

alpha

[numeric] the elastic net mixing parameter, with 0 \leq \alpha \leq 1. The penalty is defined as

\frac {1 - \alpha} { 2 } || \beta || _ 2 ^ 2 + \alpha || \beta || _ 1

'alpha = 1' is the lasso penalty, and 'alpha = 0' the ridge penalty.

nIter

[numeric] the number of iterations

burnIn

[numeric] the number of burn-in

thin

[numeric] the number of thinning

bayesian

[logical] use bayesian model (BGLR) or not (RAINBOWR) for solving mixed-effects model (only when ‘methodMLR = ’GBLUP'', this argument is valid.)


Method overGeneration()

Display informations about the object

assemble populations over generation

Usage
breederInfo$overGeneration(targetPop = NULL)
Arguments
targetPop

[character / numeric] population names or No.s you want to assemble. If NULL, assemble all the populations


Method removeLatestPop()

remove latest population

Usage
breederInfo$removeLatestPop()

Method removeInitialPop()

remove initial population

Usage
breederInfo$removeInitialPop()

Method parentInd()

search parents of an individual of interest

Usage
breederInfo$parentInd(indName)
Arguments
indName

[character] individual name of interest


Method lociEffects()

search parents of an individual of interest

Usage
breederInfo$lociEffects(bsInfo, trainingPop = NULL, methodMLR = NULL)
Arguments
bsInfo

[bsInfo class] breeding scheme info (whichever generation is OK, but it will use only 1st population) (see:bsInfo)#'

trainingPop

[character / numeric] training population names or No.s (not generations!!)

methodMLR

[character] methods for estimating marker effects. The following methods are offered:

"Ridge", "LASSO", "ElasticNet", "RR-BLUP", "GBLUP", "BayesA" (uni-trait), "BayesB" (uni-trait), "BayesC" (uni-trait), "BRR", "BL" (uni-trait), "SpikeSlab" (multi-trait)


Method print()

Display information about the object

Usage
breederInfo$print()

Method clone()

The objects of this class are cloneable with this method.

Usage
breederInfo$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

Examples


## ------------------------------------------------
## Method `breederInfo$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^-7,
                     recombRateOneVal = FALSE,
                     chrNames = c("C1", "C2", "C3"),
                     nLoci = 100,
                     effPopSize = 100,
                     simInfo = mySimInfo,
                     verbose = TRUE)
print(mySpec)

KosukeHamazaki/myBreedSimulatR documentation built on Aug. 31, 2024, 3:55 p.m.