Level 0 function that returns genetic values of individuals in a caste.
getGv(x, caste = NULL, nInd = NULL, collapse = FALSE, simParamBee = NULL)
getQueenGv(x, collapse = FALSE, simParamBee = NULL)
getFathersGv(x, nInd = NULL, collapse = FALSE, simParamBee = NULL)
getVirginQueensGv(x, nInd = NULL, collapse = FALSE, simParamBee = NULL)
getWorkersGv(x, nInd = NULL, collapse = FALSE, simParamBee = NULL)
getDronesGv(x, nInd = NULL, collapse = FALSE, simParamBee = NULL)
Pop-class
, Colony-class
, or
MultiColony-class
NULL or character, NULL when x
is a Pop-class
,
and character when x
is a Colony-class
or
MultiColony-class
with the possible values of "queen", "fathers",
"workers", "drones", "virginQueens", or "all"
numeric, number of individuals to access, if NULL
all
individuals are accessed, otherwise a random sample
logical, if the return value should be a single matrix with genetic values of all the individuals
SimParamBee
, global simulation parameters
vector of phenotype values when x
is Colony-class
and list of vectors of genetic values when x
is
MultiColony-class
, named by colony id when x
is
getQueenGv()
: Access genetic value of the queen
getFathersGv()
: Access genetic values of fathers
getVirginQueensGv()
: Access genetic values of virgin queens
getWorkersGv()
: Access genetic values of workers
getDronesGv()
: Access genetic values of drones
gv
and
vignette(topic = "QuantitativeGenetics", package = "SIMplyBee")
founderGenomes <- quickHaplo(nInd = 4, nChr = 1, segSites = 50)
SP <- SimParamBee$new(founderGenomes)
SP$nThreads = 1L
SP$addTraitA(nQtlPerChr = 10, var = 1)
SP$addSnpChip(5)
basePop <- createVirginQueens(founderGenomes)
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found
drones <- createDrones(x = basePop[1], nInd = 1000)
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found
droneGroups <- pullDroneGroupsFromDCA(drones, n = 10, nDrones = nFathersPoisson)
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found
# Create a Colony and a MultiColony class
colony <- createColony(x = basePop[2])
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found
colony <- cross(colony, drones = droneGroups[[1]])
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found
colony <- buildUp(x = colony, nWorkers = 6, nDrones = 3)
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found
colony <- addVirginQueens(x = colony, nInd = 5)
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found
apiary <- createMultiColony(basePop[3:4], n = 2)
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found
apiary <- cross(apiary, drones = droneGroups[c(2, 3)])
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found
apiary <- buildUp(x = apiary, nWorkers = 6, nDrones = 3)
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found
apiary <- addVirginQueens(x = apiary, nInd = 5)
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found
# Input is a population
getGv(x = getQueen(colony))
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found
queens <- getQueen(apiary, collapse = TRUE)
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found
getGv(queens)
#> Error in eval(expr, envir, enclos): object 'queens' not found
# Input is a colony
getGv(colony, caste = "queen")
#> Error in eval(expr, envir, enclos): object 'colony' not found
getQueenGv(colony)
#> Error in eval(expr, envir, enclos): object 'colony' not found
getGv(colony, caste = "workers")
#> Error in eval(expr, envir, enclos): object 'colony' not found
getWorkersGv(colony)
#> Error in eval(expr, envir, enclos): object 'colony' not found
# Same aliases exist for all the castes!
# Get genetic values for all individuals
getGv(colony, caste = "all")
#> Error in eval(expr, envir, enclos): object 'colony' not found
# Get all genetic values in a single matrix
getGv(colony, caste = "all", collapse = TRUE)
#> Error in eval(expr, envir, enclos): object 'colony' not found
# Input is a MultiColony - same behaviour as for the Colony!
getGv(apiary, caste = "queen")
#> Error in eval(expr, envir, enclos): object 'apiary' not found
getQueenGv(apiary)
#> Error in eval(expr, envir, enclos): object 'apiary' not found
# Get the genetic values of all individuals either by colony or in a single matrix
getGv(apiary, caste = "all")
#> Error in eval(expr, envir, enclos): object 'apiary' not found
getGv(apiary, caste = "all", collapse = TRUE)
#> Error in eval(expr, envir, enclos): object 'apiary' not found