R/Functions_L1_Pop.R
pullDroneGroupsFromDCA.Rd
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".
pullDroneGroupsFromDCA(DCA, n, nDrones = NULL, simParamBee = NULL, ...)
Pop-class
, population of drones
integer, number of drone groups to be created
numeric of function, number of drones that a virgin queen
mates with; if NULL
then SimParamBee$nFathers
is used
SimParamBee
, global simulation parameters
additional arguments passed to nDrones
when this argument is a function
list of Pop-class
founderGenomes <- quickHaplo(nInd = 8, nChr = 1, segSites = 100)
SP <- SimParamBee$new(founderGenomes)
SP$nThreads = 1L
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 <- addDrones(colony, nInd = 100)
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found
# Create colony DCA
DCA <- createDCA(colony)
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found
pullDroneGroupsFromDCA(DCA, n = 4, nDrones = 5)
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found
pullDroneGroupsFromDCA(DCA, n = 5, nDrones = nFathersPoisson)
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found