Level 0 function that returns QTL genotypes of individuals in a caste.

getQtlGeno(
  x,
  caste = NULL,
  nInd = NULL,
  trait = 1,
  chr = NULL,
  dronesHaploid = TRUE,
  collapse = FALSE,
  simParamBee = NULL
)

getQueenQtlGeno(x, trait = 1, chr = NULL, collapse = FALSE, simParamBee = NULL)

getFathersQtlGeno(
  x,
  nInd = NULL,
  trait = 1,
  chr = NULL,
  dronesHaploid = TRUE,
  collapse = FALSE,
  simParamBee = NULL
)

getVirginQueensQtlGeno(
  x,
  nInd = NULL,
  trait = 1,
  chr = NULL,
  collapse = FALSE,
  simParamBee = NULL
)

getWorkersQtlGeno(
  x,
  nInd = NULL,
  trait = 1,
  chr = NULL,
  collapse = FALSE,
  simParamBee = NULL
)

getDronesQtlGeno(
  x,
  nInd = NULL,
  trait = 1,
  chr = NULL,
  dronesHaploid = TRUE,
  collapse = FALSE,
  simParamBee = NULL
)

Arguments

x

Pop-class, Colony-class, or MultiColony-class

caste

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"

nInd

numeric, number of individuals to access, if NULL all individuals are accessed, otherwise a random sample

trait

numeric (trait position) or character (trait name), indicates which trait's QTL genotypes to retrieve

chr

numeric, chromosomes to retrieve, if NULL, all chromosome are retrieved

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

SimParamBee, global simulation parameters

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

  • getQueenQtlGeno(): Access QTL genotype data of the queen

  • getFathersQtlGeno(): Access QTL genotype data of fathers

  • getVirginQueensQtlGeno(): Access QTL genotype data of virgin queens

  • getWorkersQtlGeno(): Access QTL genotype data of workers

  • getDronesQtlGeno(): Access QTL genotype data of drones

See also

getQtlGeno and pullQtlGeno as well as vignette(topic = "QuantitativeGenetics", package = "SIMplyBee")

Examples

founderGenomes <- quickHaplo(nInd = 4, nChr = 1, segSites = 50)
SP <- SimParamBee$new(founderGenomes)
SP$addTraitA(nQtlPerChr = 10)
basePop <- createVirginQueens(founderGenomes)
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found

drones <- createDrones(x = basePop[1], nInd = 200)
#> 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 createMultiColony(basePop[3:4], n = 2): object 'basePop' 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
getQtlGeno(x = getQueen(colony))
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found
queens <- getQueen(apiary, collapse = TRUE)
#> Error in is(x, class2 = "Colony"): object 'apiary' not found
getQtlGeno(queens)
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found

# Input is a colony
getQtlGeno(colony, caste = "queen")
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found
getQueenQtlGeno(colony)
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found

getQtlGeno(colony, caste = "workers", nInd = 3)
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found
getWorkersQtlGeno(colony)
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found
# Same aliases exist for all the castes!

# Get genotypes for all individuals
getQtlGeno(colony, caste = "all")
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found
# Get all haplotypes in a single matrix
getQtlGeno(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!
getQtlGeno(apiary, caste = "queen")
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found
getQueenQtlGeno(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
getQtlGeno(apiary, caste = "all")
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found
getQtlGeno(apiary, caste = "all", collapse = TRUE)
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found