| SimParamBee {SIMplyBee} | R Documentation |
Honeybee simulation parameters
Description
Container for global honeybee simulation parameters. Saving this
object as SP will allow it to be accessed by SIMplyBee functions
without repeatedly (and annoyingly!) typing out
someFun(argument, simParamBee = SP). SimParamBee inherits
from AlphaSimR SimParam, so all SimParam slots
and functions are available in addition to SimParamBee-specific
slots and functions. Some SimParam functions could have
upgraded behaviour as documented in line with honeybee biology.
Details
This documentation shows details specific to SimParamBee. We
suggest you also read all the options provided by the AlphaSimR
SimParam. Below we show minimal usage cases for each
SimParamBee function.
See also vignette(package = "SIMplyBee") for descriptions of how
SIMplyBee implements the specific honeybee biology.
Super class
AlphaSimR::SimParam -> SimParamBee
Public fields
nWorkersnumeric or function, a number of workers generated in a colony - used in
createWorkers,addWorkers,buildUp.The default value is 100, that is, queen generates 100 workers - this is for a down-scaled simulation (for efficiency) assuming that this represents ~60,000 workers in a full/strong colony (Seeley, 2019). This value is set in
SimParamBee$new()to have a number to work with.You can change this setting to your needs!
When
nWorkersis a function, it should work with internals of other functions. Therefore, the function MUST be defined likefunction(colony, arg = default) someCode, that is, the first argument MUST becolonyand any following arguments MUST have a default value. For flexibility you can add ... argument to pass on any other argument. SeenWorkersPoisson,nWorkersTruncPoisson, ornWorkersColonyPhenotypefor examples.You can provide your own functions that satisfy your needs!
nDronesnumeric or function, a number of drones generated in a colony - used in
createDrones,addDrones,buildUp.The default value is 100, that is, queen generates 100 drones - this is for a down-scaled simulation (for efficiency) assuming that this represents ~1,000 drones in a full/strong colony (Seeley, 2019). This value is set in
SimParamBee$new()to have a number to work with.You can change this setting to your needs!
When
nDronesis a function, it should work with internals of other functions. Therefore, the function MUST be defined likefunction(x, arg = default) someCode, that is, the first argument MUST bexand any following arguments MUST have a default value. For flexibility you can add ... argument to pass on any other argument. SeenDronesPoisson,nDronesTruncPoisson, ornDronesColonyPhenotypefor examples.You can provide your own functions that satisfy your needs!
nVirginQueensnumeric or function, a number of virgin queens generated when a queen dies or other situations - used in
createVirginQueensandaddVirginQueens.The default value is 10, that is, when the queen dies, workers generate 10 new virgin queens (Seeley, 2019). This value is set in
SimParamBee$new()to have a number to work with.You can change this setting to your needs!
When
nVirginQueensis a function, it should work with internals of other functions. Therefore, the function MUST be defined likefunction(colony, arg = default) someCode, that is, the first argument MUST becolonyand any following arguments MUST have a default value. For flexibility you can add ... argument to pass on any other argument. SeenVirginQueensPoisson,nVirginQueensTruncPoisson, ornVirginQueensColonyPhenotypefor examples.You can provide your own functions that satisfy your needs!
nFathersnumeric or function, a number of drones a queen mates with - used in
pullDroneGroupsFromDCA,cross.The default value is 15, that is, a virgin queen mates on average with 15 drones (Seeley, 2019). This value is set in
SimParamBee$new()to have a number to work with.You can change this setting to your needs!
When
nFathersis a function, it should work with internals of other functions. Therefore, the function MUST be defined likefunction(arg = default) someCode, that is, any arguments MUST have a default value. We did not use thecolonyargument here, becausenFatherslikely does not depend on the colony. Let us know if we are wrong! For flexibility you can add ... argument to pass on any other argument. SeenFathersPoissonornFathersTruncPoissonfor examples.You can provide your own functions that satisfy your needs!
swarmPnumeric or a function, the swarm proportion - the proportion of workers that leave with the old queen when the colony swarms - used in
swarm.The default value is 0.50, that is, about a half of workers leave colony in a swarm (Seeley, 2019). This value is set in
SimParamBee$new()to have a proportion to work with.You can change this setting to your needs!
When
swarmPis a function, it should work with internals of other functions. Therefore, the function MUST be defined likefunction(colony, arg = default) someCode, that is, the first argument MUST becolonyand any following arguments MUST have a default value. For flexibility you can add ... argument to pass on any other argument. SeeswarmPUniffor examples.You can provide your own functions that satisfy your needs!
splitPnumeric or a function, the split proportion - the proportion of workers removed in a managed split - used in
split.The default value is 0.30, that is, about a third of workers is put into a split colony from a strong colony (Seeley, 2019). This value is set in
SimParamBee$new()to have a proportion to work with.You can change this setting to your needs!
When
splitPis a function, it should work with internals of other functions. Therefore, the function MUST be defined likefunction(colony, arg = default) someCode, that is, the first argument MUST becolonyand any following arguments MUST have a default value. For flexibility you can add ... argument to pass on any other argument. SeesplitPUniforsplitPColonyStrengthfor examples.You can provide your own functions that satisfy your needs!
downsizePnumeric or a function, the downsize proportion - the proportion of workers removed from the colony when downsizing, usually in autumn - used in
downsize.The default value is 0.85, that is, a majority of workers die before autumn or all die but some winter workers are created (Seeley, 2019). This value is set in
SimParamBee$new()to have a proportion to work with.You can change this setting to your needs!
When
downsizePis a function, it should work with internals of other functions. Therefore, the function MUST be defined likefunction(colony, arg = default) someCode, that is, the first argument MUST becolonyand any following arguments MUST have a default value. For flexibility you can add ... argument to pass on any other argument. SeedownsizePUniffor example.You can provide your own functions that satisfy your needs!
colonyValueFUNfunction, to calculate colony values - used in
calcColonyValue- see alsocalcColonyPhenoandcalcColonyGv.This function should work with internals of others functions - therefore the function MUST be defined like
function(colony, arg = default) someCode, that is, the first argument MUST becolonyand any following arguments MUST have a default value. For flexibility you can add ... argument to pass on any other argument. SeemapCasteToColonyValuefor an example.You can provide your own functions that satisfy your needs!
Active bindings
castecharacter, caste information for every individual ever created; active only when
SP$setTrackPed(isTrackPed = TRUE)lastColonyIdinteger, ID of the last Colony object created with
createColonycsdChrinteger, chromosome of the csd locus
csdPosnumeric, starting position of the csd locus on the
csdChrchromosome (relative at the moment, but could be in base pairs in the future)nCsdAllelesinteger, number of possible csd alleles
nCsdSitesinteger, number of segregating sites representing the csd locus
csdPosStartinteger, starting position of the csd locus
csdPosStopinteger, ending position of the csd locus
versionlist, versions of AlphaSimR and SIMplyBee packages used to generate this object
Methods
Public methods
Inherited methods
AlphaSimR::SimParam$addSnpChip()AlphaSimR::SimParam$addStructuredSnpChip()AlphaSimR::SimParam$addToPed()AlphaSimR::SimParam$addToRec()AlphaSimR::SimParam$addTraitA()AlphaSimR::SimParam$addTraitAD()AlphaSimR::SimParam$addTraitADE()AlphaSimR::SimParam$addTraitADEG()AlphaSimR::SimParam$addTraitADG()AlphaSimR::SimParam$addTraitAE()AlphaSimR::SimParam$addTraitAEG()AlphaSimR::SimParam$addTraitAG()AlphaSimR::SimParam$ibdHaplo()AlphaSimR::SimParam$importTrait()AlphaSimR::SimParam$manAddTrait()AlphaSimR::SimParam$removeTrait()AlphaSimR::SimParam$rescaleTraits()AlphaSimR::SimParam$resetPed()AlphaSimR::SimParam$restrSegSites()AlphaSimR::SimParam$setCorE()AlphaSimR::SimParam$setRecombRatio()AlphaSimR::SimParam$setSexes()AlphaSimR::SimParam$setTrackPed()AlphaSimR::SimParam$setTrackRec()AlphaSimR::SimParam$setVarE()AlphaSimR::SimParam$switchFemaleMap()AlphaSimR::SimParam$switchGenMap()AlphaSimR::SimParam$switchMaleMap()AlphaSimR::SimParam$switchTrait()AlphaSimR::SimParam$updateLastId()
Method new()
Starts the process of building a new simulation by creating a new SimParamBee object and assigning a founder population of genomes to the this object.
Usage
SimParamBee$new( founderPop, nWorkers = 100, nDrones = 100, nVirginQueens = 10, nFathers = 15, swarmP = 0.5, splitP = 0.3, downsizeP = 0.85, csdChr = 3, csdPos = 0.865, nCsdAlleles = 128, colonyValueFUN = NULL )
Arguments
founderPopMapPop-class, founder population of genomesnWorkerssee
SimParamBeefieldnWorkersnDronessee
SimParamBeefieldnDronesnVirginQueenssee
SimParamBeefieldnVirginQueensnFatherssee
SimParamBeefieldnFathersswarmPsee
SimParamBeefieldswarmPsplitPsee
SimParamBeefieldsplitPdownsizePsee
SimParamBeefielddownsizePcsdChrinteger, chromosome that will carry the csd locus, by default 3, but if there are less chromosomes (for a simplified simulation), the locus is put on the last available chromosome (1 or 2); if
NULLthen csd locus is ignored in the simulationcsdPosnumeric, starting position of the csd locus on the
csdChrchromosome (relative at the moment, but could be in base pairs in future)nCsdAllelesinteger, number of possible csd alleles (this determines how many segregating sites will be needed to represent the csd locus from the underlying bi-allelic SNP; the minimum number of bi-allelic SNP needed is
log2(nCsdAlleles)); if set to0thencsdChr=NULLis triggered. By default we setnCsdAllelesto 128, which is at the upper end of the reported number of csd alleles (Lechner et al., 2014; Zareba et al., 2017; Bovo et al., 2021).colonyValueFUNsee
SimParamBeefieldcolonyValueFUN
Examples
founderGenomes <- quickHaplo(nInd = 10, nChr = 3, segSites = 10) SP <- SimParamBee$new(founderGenomes, nCsdAlleles = 2) # We need enough segregating sites try(SP <- SimParamBee$new(founderGenomes, nCsdAlleles = 100)) founderGenomes <- quickHaplo(nInd = 10, nChr = 3, segSites = 100) SP <- SimParamBee$new(founderGenomes, nCsdAlleles = 100) # We can save the csd locus on chromosome 1 or 2, too, for quick simulations founderGenomes <- quickHaplo(nInd = 10, nChr = 1, segSites = 100) SP <- SimParamBee$new(founderGenomes, nCsdAlleles = 100)
Method addToCaste()
Store caste information (for internal use only!)
Usage
SimParamBee$addToCaste(id, caste)
Arguments
idcharacter, individuals whose caste will be stored
castecharacter, single "Q" for queens, "W" for workers, "D" for drones, "V" for virgin queens, and "F" for fathers
Examples
founderGenomes <- quickHaplo(nInd = 2, nChr = 1, segSites = 100) SP <- SimParamBee$new(founderGenomes) SP$setTrackPed(isTrackPed = TRUE) basePop <- createVirginQueens(founderGenomes) drones <- createDrones(x = basePop[1], nInd = 10) colony <- createColony(x = basePop[2]) colony <- cross(colony, drones = drones) colony <- addWorkers(colony, nInd = 5) colony <- addDrones(colony, nInd = 5) colony <- addVirginQueens(colony, nInd = 2) SP$pedigree SP$caste
Method changeCaste()
Change caste information (for internal use only!)
Usage
SimParamBee$changeCaste(id, caste)
Arguments
idcharacter, individuals whose caste will be changed
castecharacter, single "Q" for queens, "W" for workers, "D" for drones, "V" for virgin queens, and "F" for fathers
Examples
founderGenomes <- quickHaplo(nInd = 2, nChr = 1, segSites = 100) SP <- SimParamBee$new(founderGenomes) SP$setTrackPed(isTrackPed = TRUE) basePop <- createVirginQueens(founderGenomes) SP$pedigree SP$caste drones <- createDrones(x = basePop[1], nInd = 10) colony <- createColony(x = basePop[2]) colony <- cross(colony, drones = drones) SP$pedigree SP$caste
Method updateLastColonyId()
A function to update the colony last ID everytime we create a Colony-class with createColony. For internal use only.
Usage
SimParamBee$updateLastColonyId()
Arguments
lastColonyIdinteger, last colony ID assigned
Method clone()
The objects of this class are cloneable with this method.
Usage
SimParamBee$clone(deep = FALSE)
Arguments
deepWhether to make a deep clone.
References
Bovo et al. (2021) Application of Next Generation Semiconductor-Based Sequencing for the Identification of Apis mellifera Complementary Sex Determiner (csd) Alleles from Honey DNA. Insects, 12(10), 868. doi:/10.3390/insects12100868
Lechner et al. (2014) Nucleotide variability at its limit? Insights into the number and evolutionary dynamics of the sex-determining specificities of the honey bee Apis mellifera Molecular Biology and Evolution, 31, 272-287. doi:/10.1093/molbev/mst207
Seeley (2019) The Lives of Bees: The Untold Story of the Honey Bee in the Wild. Princeton: Princeton University Press. doi:/10.1515/9780691189383
Zareba et al. (2017) Uneven distribution of complementary sex determiner (csd) alleles in Apis mellifera population. Scientific Reports, 7, 2317. doi:/10.1038/s41598-017-02629-9
Examples
## ------------------------------------------------
## Method `SimParamBee$new`
## ------------------------------------------------
founderGenomes <- quickHaplo(nInd = 10, nChr = 3, segSites = 10)
SP <- SimParamBee$new(founderGenomes, nCsdAlleles = 2)
# We need enough segregating sites
try(SP <- SimParamBee$new(founderGenomes, nCsdAlleles = 100))
founderGenomes <- quickHaplo(nInd = 10, nChr = 3, segSites = 100)
SP <- SimParamBee$new(founderGenomes, nCsdAlleles = 100)
# We can save the csd locus on chromosome 1 or 2, too, for quick simulations
founderGenomes <- quickHaplo(nInd = 10, nChr = 1, segSites = 100)
SP <- SimParamBee$new(founderGenomes, nCsdAlleles = 100)
## ------------------------------------------------
## Method `SimParamBee$addToCaste`
## ------------------------------------------------
founderGenomes <- quickHaplo(nInd = 2, nChr = 1, segSites = 100)
SP <- SimParamBee$new(founderGenomes)
SP$setTrackPed(isTrackPed = TRUE)
basePop <- createVirginQueens(founderGenomes)
drones <- createDrones(x = basePop[1], nInd = 10)
colony <- createColony(x = basePop[2])
colony <- cross(colony, drones = drones)
colony <- addWorkers(colony, nInd = 5)
colony <- addDrones(colony, nInd = 5)
colony <- addVirginQueens(colony, nInd = 2)
SP$pedigree
SP$caste
## ------------------------------------------------
## Method `SimParamBee$changeCaste`
## ------------------------------------------------
founderGenomes <- quickHaplo(nInd = 2, nChr = 1, segSites = 100)
SP <- SimParamBee$new(founderGenomes)
SP$setTrackPed(isTrackPed = TRUE)
basePop <- createVirginQueens(founderGenomes)
SP$pedigree
SP$caste
drones <- createDrones(x = basePop[1], nInd = 10)
colony <- createColony(x = basePop[2])
colony <- cross(colony, drones = drones)
SP$pedigree
SP$caste