reQueen {SIMplyBee} | R Documentation |
Re-queen
Description
Level 2 function that re-queens a Colony or MultiColony object by adding a mated or a virgin queen, removing the previous queen, and changing the colony id to the new mated queen.
Usage
reQueen(x, queen, removeVirginQueens = TRUE)
Arguments
x |
|
queen |
|
removeVirginQueens |
logical, remove existing virgin queens, default is
|
Details
If the provided queen is mated, then she is saved in the queen slot of the colony. If she is not mated, then she is saved in the virgin queen slot (replacing any existing virgin queens) and once she is mated will be promoted to the queen of the colony.
Value
Colony-class
or MultiColony-class
with new queen(s) (see details)
Examples
founderGenomes <- quickHaplo(nInd = 12, nChr = 1, segSites = 50)
SP <- SimParamBee$new(founderGenomes)
basePop <- createVirginQueens(founderGenomes)
drones <- createDrones(x = basePop[1], nInd = 200)
droneGroups <- pullDroneGroupsFromDCA(drones, n = 7, nDrones = nFathersPoisson)
# Create and cross Colony and MultiColony class
colony <- createColony(x = basePop[2])
colony <- cross(colony, drones = droneGroups[[1]])
apiary <- createMultiColony(basePop[3:4], n = 2)
apiary <- cross(apiary, drones = droneGroups[2:3])
# Check queen and virgin queens IDs
getCasteId(colony, caste = "queen")
getCasteId(colony, caste = "virginQueens")
getCasteId(apiary, caste = "queen")
getCasteId(apiary, caste = "virginQueens")
# Requeen with virgin queens
virginQueens <- basePop[5:8]
# Requeen a Colony class
colony <- reQueen(colony, queen = virginQueens[1])
# Check queen and virgin queens IDs
getCasteId(colony, caste = "queen")
getCasteId(colony, caste = "virginQueens")
#' # Requeen with mated queens
matedQueens <- cross(x = basePop[9:12], drones = droneGroups[4:7])
colony <- reQueen(colony, queen = matedQueens[1])
# Check queen and virgin queens IDs
getCasteId(colony, caste = "queen")
getCasteId(colony, caste = "virginQueens")
# Requeen a MultiColony class
apiary <- reQueen(apiary, queen = virginQueens[2:3])
# Check queen and virgin queens IDs
getCasteId(apiary, caste = "queen")
getCasteId(apiary, caste = "virginQueens")