R/Functions_L0_auxilary.R
calcQueensPHomBrood.Rd
Level 0 functions that calculate or report the proportion of csd
homozygous brood of a queen or a colony. The csd locus determines viability
of fertilised eggs (brood) - homozygous brood is removed by workers. These
functions 1) calculate the expected proportion of homozygous brood from the
csd allele of the queen and fathers, 2) report the expected proportion of
homozygous brood, or 3) report a realised number of homozygous brood due to
inheritance process. See vignette(package = "SIMplyBee")
for more
details.
calcQueensPHomBrood(x)
pHomBrood(x)
nHomBrood(x)
Pop-class
, Colony-class
, or
MultiColony-class
pHomBrood()
: Expected percentage of csd homozygous brood
of a queen / colony
nHomBrood()
: Realised number of csd homozygous brood
produced by a queen
Demo in the introductory vignette
vignette("Honeybee_biology", package="SIMplyBee")
# This is a bit long example - the key is at the end!
founderGenomes <- quickHaplo(nInd = 8, nChr = 1, segSites = 100)
SP <- SimParamBee$new(founderGenomes)
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 <- buildUp(x = colony, nWorkers = 120, nDrones = 20)
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found
colony <- addVirginQueens(x = colony, nInd = 1)
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found
apiary <- createMultiColony(basePop[3:4], n = 2)
#> Error in createMultiColony(basePop[3:4], n = 2): object 'basePop' not found
apiary <- cross(apiary, drones = droneGroups[c(2, 3)])
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found
apiary <- buildUp(x = apiary, nWorkers = 100, nDrones = 10)
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found
# Virgin queen
try(calcQueensPHomBrood(basePop[5]))
#> Error in is(x, class2 = "Pop") : object 'basePop' not found
# Queens of colony
calcQueensPHomBrood(colony)
#> Error in is(x, class2 = "Pop"): object 'colony' not found
# Queens of apiary
calcQueensPHomBrood(apiary)
#> Error in is(x, class2 = "Pop"): object 'apiary' not found
# Inbreed virgin queen with her brothers to generate csd homozygous brood
colony2 <- createColony(x = getVirginQueens(colony))
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found
colony2 <- cross(x = colony2, drones = pullDrones(x = colony, nInd = nFathersPoisson())[[1]])
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found
# Calculate the expected csd homozygosity
calcQueensPHomBrood(getQueen(colony2))
#> Error in is(x, class2 = "Colony"): object 'colony2' not found
pHomBrood(colony2)
#> Error in is(x, class2 = "Pop"): object 'colony2' not found
# Evaluate a realised csd homozygosity
nHomBrood(addWorkers(colony2, nInd = 100))
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found
nHomBrood(addWorkers(colony2, nInd = 100))
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found
# nHomBrood will vary between function calls due to inheritance process