nCsdAlleles {SIMplyBee} | R Documentation |
Report the number of distinct csd alleles
Description
Level 0 function that returns the number of distinct csd alleles
in input. See SimParamBee
for more information about the csd
locus.
Usage
nCsdAlleles(x, collapse = FALSE, simParamBee = NULL)
Arguments
x |
|
collapse |
logical, if |
simParamBee |
|
Details
Queen has 2 distinct csd alleles, since she has to be heterozygous
to be viable. The same holds for individual virgin queens and workers, but
note that looking at csd genotypes of virgin queens or workers we are
looking at a sample of 1 csd allele from the queen and 1 csd allele from
their fathers, noting that homozygous genotypes are excluded. Therefore,
nCsdAlleles()
from virgin queens and workers is a noisy realisation
of nCsdAlleles()
from queens and fathers. For this reason, we also
report nCsdAlleles()
from queens and fathers combined (see the
queenAndFathers
list node) when x
is
Colony-class
. This last measure is then the expected number
of csd alleles in a colony as opposed to realised number of csd alleles in
a sample of virgin queens and workers. Similarly as for virgin queens and
workers, nCsdAlleles()
from drones gives a noisy realisation of
nCsdAlleles()
from queens. The amount of noise will depend on the
number of individuals, so in most cases with reasonable number of
individuals there should be minimal amount of noise.
Value
integer representing the number of distinct csd alleles when x
is Pop-class
(or ), list of integer
when x
is Colony-class
(list nodes named by caste) and
list of a list of integer when x
is MultiColony-class
,
outer list is named by colony id when x
is
MultiColony-class
; the integer rep
Examples
founderGenomes <- quickHaplo(nInd = 8, nChr = 1, segSites = 100)
SP <- SimParamBee$new(founderGenomes)
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 <- buildUp(x = colony, nWorkers = 6, nDrones = 3)
colony <- addVirginQueens(x = colony, nInd = 4)
apiary <- createMultiColony(basePop[3:4], n = 2)
apiary <- cross(apiary, drones = droneGroups[c(2, 3)])
apiary <- buildUp(x = apiary, nWorkers = 6, nDrones = 3)
apiary <- addVirginQueens(x = apiary, nInd = 5)
nCsdAlleles(getQueen(colony))
nCsdAlleles(getWorkers(colony))
nCsdAlleles(colony)
nCsdAlleles(colony, collapse = TRUE)
nCsdAlleles(apiary)
nCsdAlleles(apiary, collapse = TRUE)