Level 0 function that returns phenotype values of individuals in a caste.

getPheno(x, caste = NULL, nInd = NULL, collapse = FALSE)

getQueenPheno(x, collapse = FALSE)

getFathersPheno(x, nInd = NULL, collapse = FALSE)

getVirginQueensPheno(x, nInd = NULL, collapse = FALSE)

getWorkersPheno(x, nInd = NULL, collapse = FALSE)

getDronesPheno(x, nInd = NULL, collapse = FALSE)

Arguments

x

Pop-class, Colony-class, or MultiColony-class

caste

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"

nInd

numeric, number of individuals to access, if NULL all individuals are accessed, otherwise a random sample

collapse

logical, if the return value should be a single matrix with phenotypes of all the individuals

Value

vector of genetic 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

MultiColony-class

Functions

  • getQueenPheno(): Access phenotype value of the queen

  • getFathersPheno(): Access phenotype values of fathers

  • getVirginQueensPheno(): Access phenotype values of virgin queens

  • getWorkersPheno(): Access phenotype values of workers

  • getDronesPheno(): Access phenotype values of drones

See also

pheno and vignette(topic = "QuantitativeGenetics", package = "SIMplyBee")

Examples

founderGenomes <- quickHaplo(nInd = 8, nChr = 1, segSites = 100)
SP <- SimParamBee$new(founderGenomes)
SP$addTraitA(nQtlPerChr = 10, var = 1)
SP$setVarE(varE = 1)

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
getPheno(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
getPheno(queens)
#> Error in getPheno(queens): object 'queens' not found

# Input is a colony
getPheno(colony, caste = "queen")
#> Error in getPheno(colony, caste = "queen"): object 'colony' not found
getQueenPheno(colony)
#> Error in getPheno(x, caste = "queen", collapse = collapse): object 'colony' not found

getPheno(colony, caste = "fathers")
#> Error in getPheno(colony, caste = "fathers"): object 'colony' not found
getPheno(colony, caste = "fathers", nInd = 2)
#> Error in getPheno(colony, caste = "fathers", nInd = 2): object 'colony' not found
getPheno(colony, caste = "fathers", nInd = 2) # random sample!
#> Error in getPheno(colony, caste = "fathers", nInd = 2): object 'colony' not found
getFathersPheno(colony)
#> Error in getPheno(x, caste = "fathers", nInd = nInd, collapse = collapse): object 'colony' not found
getFathersPheno(colony, nInd = 2)
#> Error in getPheno(x, caste = "fathers", nInd = nInd, collapse = collapse): object 'colony' not found

getPheno(colony, caste = "workers")
#> Error in getPheno(colony, caste = "workers"): object 'colony' not found
getWorkersPheno(colony)
#> Error in getPheno(x, caste = "workers", nInd = nInd, collapse = collapse): object 'colony' not found
# Same aliases exist for all the castes!!!

# Get phenotypes for all individuals
getPheno(colony, caste = "all")
#> Error in getPheno(colony, caste = "all"): object 'colony' not found
# Get all phenotypes in a single matrix
getPheno(colony, caste = "all", collapse = TRUE)
#> Error in getPheno(colony, caste = "all", collapse = TRUE): object 'colony' not found

# Input is a MultiColony - same behaviour as for the Colony!
getPheno(apiary, caste = "queen")
#> Error in getPheno(apiary, caste = "queen"): object 'apiary' not found
getQueenPheno(apiary)
#> Error in getPheno(x, caste = "queen", collapse = collapse): object 'apiary' not found

# Get the phenotypes of all individuals either by colony or in a single matrix
getPheno(apiary, caste = "all")
#> Error in getPheno(apiary, caste = "all"): object 'apiary' not found
getPheno(apiary, caste = "all", collapse = TRUE)
#> Error in getPheno(apiary, caste = "all", collapse = TRUE): object 'apiary' not found