R/Functions_L0_auxilary.R
getSegSiteGeno.Rd
Level 0 function that returns genotypes for all segregating sites of individuals in a caste.
getSegSiteGeno(
x,
caste = NULL,
nInd = NULL,
chr = NULL,
dronesHaploid = TRUE,
collapse = FALSE,
simParamBee = NULL
)
getQueenSegSiteGeno(x, chr = NULL, collapse = FALSE, simParamBee = NULL)
getFathersSegSiteGeno(
x,
nInd = NULL,
chr = NULL,
dronesHaploid = TRUE,
collapse = FALSE,
simParamBee = NULL
)
getVirginQueensSegSiteGeno(
x,
nInd = NULL,
chr = NULL,
collapse = FALSE,
simParamBee = NULL
)
getWorkersSegSiteGeno(
x,
nInd = NULL,
chr = NULL,
collapse = FALSE,
simParamBee = NULL
)
getDronesSegSiteGeno(
x,
nInd = NULL,
chr = NULL,
dronesHaploid = TRUE,
collapse = FALSE,
simParamBee = NULL
)
Pop-class
, Colony-class
, or
MultiColony-class
NULL or character, NULL when x
is a Pop-class
,
and character when x
is a Colony-class
or
MultiColony-class
with the possible values of "queen", "fathers",
"workers", "drones", "virginQueens", or "all"
numeric, number of individuals to access, if NULL
all
individuals are accessed, otherwise a random sample
numeric, chromosomes to retrieve, if NULL
, all chromosome
are retrieved
logical, return haploid result for drones?
logical, if the return value should be a single matrix with genotypes of all the individuals
SimParamBee
, global simulation parameters
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
getQueenSegSiteGeno()
: Access genotype data for all segregating sites of the queen
getFathersSegSiteGeno()
: Access genotype data for all segregating sites of fathers
getVirginQueensSegSiteGeno()
: Access genotype data for all segregating sites of virgin queens
getWorkersSegSiteGeno()
: Access genotype data for all segregating sites of workers
getDronesSegSiteGeno()
: Access genotype data for all segregating sites of drones
getSegSiteGeno
and pullSegSiteGeno
founderGenomes <- quickHaplo(nInd = 4, nChr = 1, segSites = 50)
SP <- SimParamBee$new(founderGenomes)
SP$nThreads = 1L
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 = 6, nDrones = 3)
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found
colony <- addVirginQueens(x = colony, nInd = 5)
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found
apiary <- createMultiColony(basePop[3:4], n = 2)
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' 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 = 6, nDrones = 3)
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found
apiary <- addVirginQueens(x = apiary, nInd = 5)
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found
# Input is a population
getSegSiteGeno(x = getQueen(colony))
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found
queens <- getQueen(apiary, collapse = TRUE)
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found
getSegSiteGeno(queens)
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found
# Input is a colony
getSegSiteGeno(colony, caste = "queen")
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found
getQueenSegSiteGeno(colony)
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found
getSegSiteGeno(colony, caste = "workers", nInd = 3)
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found
getWorkersSegSiteGeno(colony)
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found
# same aliases exist for all the castes!
# Get genotypes for all individuals
getSegSiteGeno(colony, caste = "all")
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found
# Get all genotypes in a single matrix
getSegSiteGeno(colony, caste = "all", collapse = TRUE)
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found
# Input is a MultiColony - same behaviour as for the Colony
getSegSiteGeno(apiary, caste = "queen")
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found
getQueenSegSiteGeno(apiary)
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found
# Get the genotypes of all individuals either by colony or in a single matrix
getSegSiteGeno(apiary, caste = "all")
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found
getSegSiteGeno(apiary, caste = "all", collapse = TRUE)
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found