Level 0 function that returns genetic values of individuals in a caste.
getGv(x, caste = NULL, nInd = NULL, collapse = FALSE)
getQueenGv(x, collapse = FALSE)
getFathersGv(x, nInd = NULL, collapse = FALSE)
getVirginQueensGv(x, nInd = NULL, collapse = FALSE)
getWorkersGv(x, nInd = NULL, collapse = FALSE)
getDronesGv(x, nInd = NULL, collapse = FALSE)
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
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$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 createMultiColony(basePop[3:4], n = 2): object 'basePop' 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 is(x, class2 = "Colony"): object 'colony' not found
queens <- getQueen(apiary, collapse = TRUE)
#> Error in is(x, class2 = "Colony"): object 'apiary' not found
getGv(queens)
#> Error in getGv(queens): object 'queens' not found
# Input is a colony
getGv(colony, caste = "queen")
#> Error in getGv(colony, caste = "queen"): object 'colony' not found
getQueenGv(colony)
#> Error in getGv(x, caste = "queen", collapse = collapse): object 'colony' not found
getGv(colony, caste = "workers")
#> Error in getGv(colony, caste = "workers"): object 'colony' not found
getWorkersGv(colony)
#> Error in getGv(x, caste = "workers", nInd = nInd, collapse = collapse): object 'colony' not found
# Same aliases exist for all the castes!
# Get genetic values for all individuals
getGv(colony, caste = "all")
#> Error in getGv(colony, caste = "all"): object 'colony' not found
# Get all genetic values in a single matrix
getGv(colony, caste = "all", collapse = TRUE)
#> Error in getGv(colony, caste = "all", collapse = TRUE): object 'colony' not found
# Input is a MultiColony - same behaviour as for the Colony!
getGv(apiary, caste = "queen")
#> Error in getGv(apiary, caste = "queen"): object 'apiary' not found
getQueenGv(apiary)
#> Error in getGv(x, caste = "queen", collapse = collapse): 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 getGv(apiary, caste = "all"): object 'apiary' not found
getGv(apiary, caste = "all", collapse = TRUE)
#> Error in getGv(apiary, caste = "all", collapse = TRUE): object 'apiary' not found