getCsdAlleles {SIMplyBee} | R Documentation |
Get csd alleles
Description
Level 0 function that returns alleles from the csd locus. See
SimParamBee
for more information about the csd locus.
Usage
getCsdAlleles(
x,
caste = NULL,
nInd = NULL,
allele = "all",
dronesHaploid = TRUE,
collapse = FALSE,
unique = FALSE,
simParamBee = NULL
)
getQueenCsdAlleles(
x,
allele = "all",
unique = FALSE,
collapse = FALSE,
simParamBee = NULL
)
getFathersCsdAlleles(
x,
nInd = NULL,
allele = "all",
dronesHaploid = TRUE,
unique = FALSE,
collapse = FALSE,
simParamBee = NULL
)
getVirginQueensCsdAlleles(
x,
nInd = NULL,
allele = "all",
unique = FALSE,
collapse = FALSE,
simParamBee = NULL
)
getWorkersCsdAlleles(
x,
nInd = NULL,
allele = "all",
unique = FALSE,
collapse = FALSE,
simParamBee = NULL
)
getDronesCsdAlleles(
x,
nInd = NULL,
allele = "all",
dronesHaploid = TRUE,
unique = FALSE,
collapse = FALSE,
simParamBee = NULL
)
Arguments
x |
|
caste |
NULL or character, NULL when |
nInd |
numeric, for how many individuals; if |
allele |
character, either "all" for both alleles or an integer for a single allele, use a value of 1 for female allele and a value of 2 for male allele |
dronesHaploid |
logical, return haploid result for drones? |
collapse |
logical, if |
unique |
logical, return only the unique set of csd alleles. This argument
interacts with |
simParamBee |
|
Details
If both collapse and unique are TRUE
, the function returns a
unique set of csd alleles in the entire population, colony, or multicolony
Value
matrix with haplotypes when x
is Pop-class
, list
of matrices with haplotypes when x
is Colony-class
(list nodes named by caste) and list of a list of matrices with haplotypes
when x
is MultiColony-class
, outer list is named by
colony id when x
is MultiColony-class
; NULL
when
x
is NULL
Functions
-
getQueenCsdAlleles()
: Access csd alleles of the queen -
getFathersCsdAlleles()
: Access csd alleles of the fathers -
getVirginQueensCsdAlleles()
: Access csd alleles of the virgin queens -
getWorkersCsdAlleles()
: Access csd alleles of the workers -
getDronesCsdAlleles()
: Access csd alleles of the drones
Examples
founderGenomes <- quickHaplo(nInd = 8, nChr = 1, segSites = 100)
SP <- SimParamBee$new(founderGenomes, nCsdAlleles = 5)
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)
apiary <- createMultiColony(basePop[3:4], n = 2)
apiary <- cross(apiary, drones = droneGroups[c(2, 3)])
apiary <- buildUp(x = apiary, nWorkers = 6, nDrones = 3)
# Use getCsdAlleles on a Population
getCsdAlleles(getQueen(colony))
getCsdAlleles(getWorkers(colony))
# Use getCsdAlleles on a Colony
getCsdAlleles(colony)
getCsdAlleles(colony, caste = "queen")
getQueenCsdAlleles(colony)
getCsdAlleles(colony, caste = "workers")
getWorkersCsdAlleles(colony)
# Same aliases exist for all the castes!
getCsdAlleles(colony, unique = TRUE)
getCsdAlleles(colony, collapse = TRUE)
getCsdAlleles(colony, collapse = TRUE, unique = TRUE)
# Use getCsdAlleles on a MultiColony
getCsdAlleles(apiary)
getCsdAlleles(apiary, unique = TRUE)
getCsdAlleles(apiary, collapse = TRUE, unique = TRUE)
getCsdAlleles(apiary, nInd = 2)