getSnpGeno {SIMplyBee} | R Documentation |
Access SNP array genotypes of individuals in a caste
Description
Level 0 function that returns SNP array genotypes of individuals in a caste.
Usage
getSnpGeno(
x,
caste = NULL,
nInd = NULL,
snpChip = 1,
chr = NULL,
dronesHaploid = TRUE,
collapse = FALSE,
simParamBee = NULL
)
getQueenSnpGeno(
x,
snpChip = 1,
chr = NULL,
collapse = FALSE,
simParamBee = NULL
)
getFathersSnpGeno(
x,
nInd = NULL,
snpChip = 1,
chr = NULL,
dronesHaploid = TRUE,
collapse = FALSE,
simParamBee = NULL
)
getVirginQueensSnpGeno(
x,
nInd = NULL,
snpChip = 1,
chr = NULL,
collapse = FALSE,
simParamBee = NULL
)
getWorkersSnpGeno(
x,
nInd = NULL,
snpChip = 1,
chr = NULL,
collapse = FALSE,
simParamBee = NULL
)
getDronesSnpGeno(
x,
nInd = NULL,
snpChip = 1,
chr = NULL,
dronesHaploid = TRUE,
collapse = FALSE,
simParamBee = NULL
)
Arguments
x |
|
caste |
NULL or character, NULL when |
nInd |
numeric, number of individuals to access, if |
snpChip |
numeric, indicates which SNP array genotypes to retrieve |
chr |
numeric, chromosomes to retrieve, if |
dronesHaploid |
logical, return haploid result for drones? |
collapse |
logical, if the return value should be a single matrix with genotypes of all the individuals |
simParamBee |
|
Value
matrix with genotypes when x
is Colony-class
and
list of matrices with genotypes when x
is
MultiColony-class
, named by colony id when x
is
MultiColony-class
Functions
-
getQueenSnpGeno()
: Access SNP array genotype data of the queen -
getFathersSnpGeno()
: Access SNP array genotype data of fathers -
getVirginQueensSnpGeno()
: Access SNP array genotype data of virgin queens -
getWorkersSnpGeno()
: Access SNP array genotype data of workers -
getDronesSnpGeno()
: Access SNP array genotype data of drones
See Also
Examples
founderGenomes <- quickHaplo(nInd = 4, nChr = 1, segSites = 50)
SP <- SimParamBee$new(founderGenomes)
SP$addSnpChip(nSnpPerChr = 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)
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
getSnpGeno(x = getQueen(colony))
queens <- getQueen(apiary, collapse = TRUE)
getSnpGeno(queens)
# Input is a colony
getSnpGeno(colony, caste = "queen")
getQueenSnpGeno(colony)
getSnpGeno(colony, caste = "workers", nInd = 3)
getWorkersSnpGeno(colony)
# Same aliases exist for all the castes!
# Get genotypes for all individuals
getSnpGeno(colony, caste = "all")
# Get all haplotypes in a single matrix
getSnpGeno(colony, caste = "all", collapse = TRUE)
# Input is a MultiColony - same behaviour as for the Colony!
getSnpGeno(apiary, caste = "queen")
getQueenSnpGeno(apiary)
# Get the haplotypes of all individuals either by colony or in a single matrix
getSnpGeno(apiary, caste = "all")
getSnpGeno(apiary, caste = "all", collapse = TRUE)