getIbdHaplo {SIMplyBee} | R Documentation |
Access IBD haplotypes of individuals in a caste
Description
Level 0 function that returns IBD (identity by descent) haplotypes of individuals in a caste.
Usage
getIbdHaplo(
x,
caste = NULL,
nInd = NULL,
chr = NULL,
snpChip = NULL,
dronesHaploid = TRUE,
collapse = FALSE,
simParamBee = NULL
)
getQueenIbdHaplo(
x,
chr = NULL,
snpChip = NULL,
collapse = FALSE,
simParamBee = NULL
)
getFathersIbdHaplo(
x,
nInd = NULL,
chr = NULL,
snpChip = NULL,
dronesHaploid = TRUE,
collapse = FALSE,
simParamBee = NULL
)
getVirginQueensIbdHaplo(
x,
nInd = NULL,
chr = NULL,
snpChip = NULL,
collapse = FALSE,
simParamBee = NULL
)
getWorkersIbdHaplo(
x,
nInd = NULL,
chr = NULL,
snpChip = NULL,
collapse = FALSE,
simParamBee = NULL
)
getDronesIbdHaplo(
x,
nInd = NULL,
chr = NULL,
snpChip = NULL,
dronesHaploid = TRUE,
collapse = FALSE,
simParamBee = NULL
)
Arguments
x |
|
caste |
NULL or character, NULL when |
nInd |
numeric, number of individuals to access, if |
chr |
numeric, chromosomes to retrieve, if |
snpChip |
integer, indicating which SNP array loci are to be retrieved,
if |
dronesHaploid |
logical, return haploid result for drones? |
collapse |
logical, if the return value should be a single matrix with haplotypes of all the individuals |
simParamBee |
|
Value
matrix with haplotypes when x
is Colony-class
and list of matrices with haplotypes when x
is
MultiColony-class
, named by colony id when x
is
MultiColony-class
Functions
-
getQueenIbdHaplo()
: Access IBD haplotype data of the queen -
getFathersIbdHaplo()
: Access IBD haplotype data of fathers -
getVirginQueensIbdHaplo()
: Access IBD haplotype data of virgin queens -
getWorkersIbdHaplo()
: Access IBD haplotype data of workers -
getDronesIbdHaplo()
: Access IBD haplotype data of drones
See Also
Examples
founderGenomes <- quickHaplo(nInd = 4, nChr = 1, segSites = 50)
SP <- SimParamBee$new(founderGenomes)
SP$setTrackRec(TRUE)
SP$setTrackPed(isTrackPed = TRUE)
basePop <- createVirginQueens(founderGenomes)
drones <- createDrones(x = basePop[1], nInd = 200)
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 = 5)
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)
# Input is a population
getIbdHaplo(x = getQueen(colony))
queens <- getQueen(apiary, collapse = TRUE)
getIbdHaplo(queens)
# Input is a colony
getIbdHaplo(x = colony, caste = "queen")
getQueenIbdHaplo(colony)
getIbdHaplo(colony, caste = "workers", nInd = 3)
getWorkersIbdHaplo(colony)
# Same aliases exist for all castes!
# Get haplotypes for all individuals
getIbdHaplo(colony, caste = "all")
# Get all haplotypes in a single matrix
getIbdHaplo(colony, caste = "all", collapse = TRUE)
# Input is a MultiColony
getIbdHaplo(x = apiary, caste = "queen")
getQueenIbdHaplo(apiary)
# Or collapse all the haplotypes into a single matrix
getQueenIbdHaplo(apiary, collapse = TRUE)
# Get the haplotypes of all individuals either by colony or in a single matrix
getIbdHaplo(apiary, caste = "all")
getIbdHaplo(apiary, caste = "all", collapse = TRUE)