createCastePop {SIMplyBee} | R Documentation |
Creates caste population individuals from the colony
Description
Level 1 function that creates the specified number of caste individuals from the colony with a mated queens. If csd locus is active, it takes it into account and any csd homozygotes are removed and counted towards homozygous brood.
Usage
createCastePop(
x,
caste = NULL,
nInd = NULL,
exact = TRUE,
year = NULL,
editCsd = TRUE,
csdAlleles = NULL,
simParamBee = NULL,
...
)
createWorkers(x, nInd = NULL, exact = FALSE, simParamBee = NULL, ...)
createDrones(x, nInd = NULL, simParamBee = NULL, ...)
createVirginQueens(
x,
nInd = NULL,
year = NULL,
editCsd = TRUE,
csdAlleles = NULL,
simParamBee = NULL,
...
)
Arguments
x |
|
caste |
character, "workers", "drones", or "virginQueens" |
nInd |
numeric or function, number of caste individuals; if |
exact |
logical, only relevant when creating workers,
if the csd locus is active and exact is |
year |
numeric, year of birth for virgin queens |
editCsd |
logical (only active when |
csdAlleles |
|
simParamBee |
|
... |
additional arguments passed to |
Value
when x
is link{MapPop-class}
returns
virginQueens
(a Pop-class
);
when x
is Colony-class
returns
virginQueens
(a Pop-class
);
when x
is MultiColony-class
return is a named list of virginQueens
(a Pop-class
);
named by colony ID
Functions
-
createWorkers()
: Create workers from a colony -
createDrones()
: Create drones from a colony -
createVirginQueens()
: Create virgin queens from a colony
Examples
founderGenomes <- quickHaplo(nInd = 4, nChr = 1, segSites = 50)
SP <- SimParamBee$new(founderGenomes)
SP$setTrackRec(TRUE)
SP$setTrackPed(isTrackPed = TRUE)
# Create virgin queens on a MapPop
basePop <- createCastePop(founderGenomes, caste = "virginQueens")
# Or alias
createVirginQueens(founderGenomes)
# Same aliases exist for all the castes!!!
# Create drones on a Pop
drones <- createDrones(x = basePop[1], nInd = 200)
# Or create unequal number of drones from multiple virgin queens
drones <- createDrones(basePop[1:2], nInd = c(100, 200))
droneGroups <- pullDroneGroupsFromDCA(drones, n = 3, nDrones = nFathersPoisson)
# Create a Colony and a 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[c(2, 3)])
# Using default nInd in SP
colony@virginQueens <- createVirginQueens(colony)
colony@workers <- createWorkers(colony)$workers
colony@drones <- createDrones(colony)
# Usually, you would use functions buildUp() or addCastePop()
# These populations hold individual information
# Example on the virgin queens (same holds for all castes!)
virginQueens <- colony@virginQueens
virginQueens@id
virginQueens@sex
virginQueens@mother
virginQueens@father
# Specify own number
SP$nVirginQueens <- 15
SP$nWorkers <- 100
SP$nDrones <- 10
createVirginQueens(colony)
createVirginQueens(apiary)
# Or creating unequal numbers
createVirginQueens(apiary, nInd = c(5, 10))
# nVirginQueens will NOT vary between function calls when a constant is used
# Specify a function that will give a number
createVirginQueens(colony, nInd = nVirginQueensPoisson)
createVirginQueens(apiary, nInd = nVirginQueensPoisson)
# No. of individuals will vary between function calls when a function is used
# Store a function or a value in the SP object
SP$nVirginQueens <- nVirginQueensPoisson
createVirginQueens(colony)
createVirginQueens(colony)
createVirginQueens(apiary)
createVirginQueens(apiary)
# No. of individuals will vary between function calls when a function is used
# csd homozygosity - relevant when creating virgin queens
SP <- SimParamBee$new(founderGenomes, csdChr = 1, nCsdAlleles = 8)
basePop <- createVirginQueens(founderGenomes, editCsd = FALSE)
all(isCsdHeterozygous(basePop))
basePop <- createVirginQueens(founderGenomes, editCsd = TRUE)
all(isCsdHeterozygous(basePop))