Learn R Programming

SIMplyBee (version 0.4.1)

pullDroneGroupsFromDCA: Pulls drone groups from a Drone Congregation Area (DCA)

Description

Level 1 function that pulls drone groups from a Drone Congregation Area (DCA) to use them later in mating. Within the function drones are pulled (removed) from the DCA to reflect the fact that drones die after mating, so they can't be present in the DCA anymore. Be careful what you do with the DCA object outside function to avoid drone "copies".

Usage

pullDroneGroupsFromDCA(DCA, n, nDrones = NULL, simParamBee = NULL, ...)

Value

list of Pop-class

Arguments

DCA

Pop-class, population of drones

n

integer, number of drone groups to be created

nDrones

numeric of function, number of drones that a virgin queen mates with; if NULL then SimParamBee$nFathers is used

simParamBee

SimParamBee, global simulation parameters

...

additional arguments passed to nDrones when this argument is a function

Examples

Run this code
founderGenomes <- quickHaplo(nInd = 8, nChr = 1, segSites = 100)
SP <- SimParamBee$new(founderGenomes)
SP$nThreads = 1L
basePop <- createVirginQueens(founderGenomes)

drones <- createDrones(x = basePop[1], nInd = 1000)
droneGroups <- pullDroneGroupsFromDCA(drones, n = 10, nDrones = nFathersPoisson)

# Create a Colony and a MultiColony class
colony <- createColony(x = basePop[2])
colony <- cross(colony, drones = droneGroups[[1]])
colony <- addDrones(colony, nInd = 100)

# Create colony DCA
DCA <- createDCA(colony)
pullDroneGroupsFromDCA(DCA, n = 4, nDrones = 5)
pullDroneGroupsFromDCA(DCA, n = 5, nDrones = nFathersPoisson)

Run the code above in your browser using DataLab