Learn R Programming

SIMplyBee (version 0.4.1)

createDCA: Create a drone congregation area (DCA)

Description

Level 1 function that creates a population of drones from a Colony or MultiColony. Such a population is often referred to as a drone congregation area (DCA).

Usage

createDCA(x, nInd = NULL, removeFathers = TRUE, simParamBee = NULL)

Value

Pop-class

Arguments

x

Colony-class or MultiColony-class

nInd

numeric, number of random drones to pull from each colony, if NULL all drones in a colony are pulled

removeFathers

logical, removes drones that have already mated; set to FALSE if you would like to get drones for mating with multiple virgin queens, say via insemination

simParamBee

SimParamBee, global simulation parameters

Details

In reality, drones leave the colony to mate. They die after that. In this function we only get a copy of drones from x, for computational efficiency and ease of use. However, any mating will change the caste of drones to fathers, and they won't be available for future matings (see cross). Not unless removeFathers = FALSE.

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]])
apiary <- createMultiColony(basePop[3:4], n = 2)
apiary <- cross(apiary, drones = droneGroups[c(2, 3)])

colony <- addDrones(colony, nInd = 10)
createDCA(colony)
createDCA(colony, nInd = 10)@id

apiary <- addDrones(apiary)
createDCA(apiary)
createDCA(apiary, nInd = 10)

Run the code above in your browser using DataLab