Level 0 function that returns genotypes from the csd locus. See SimParamBee for more information about the csd locus and how we have implemented it.

getCsdGeno(
  x,
  caste = NULL,
  nInd = NULL,
  dronesHaploid = TRUE,
  collapse = FALSE,
  simParamBee = NULL
)

getQueenCsdGeno(x, collapse = FALSE, simParamBee = NULL)

getFathersCsdGeno(
  x,
  nInd = NULL,
  dronesHaploid = TRUE,
  collapse = FALSE,
  simParamBee = NULL
)

getVirginQueensCsdGeno(x, nInd = NULL, collapse = FALSE, simParamBee = NULL)

getWorkersCsdGeno(x, nInd = NULL, collapse = FALSE, simParamBee = NULL)

getDronesCsdGeno(
  x,
  nInd = 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, for how many individuals; if NULL all individuals are taken; this can be useful as a test of sampling individuals

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

SimParamBee, global simulation parameters

Value

matrix with genotypes when x is Pop-class, list of matrices with genotypes when x is Colony-class

(list nodes named by caste) and list of a list of matrices with genotypes when x is MultiColony-class, outer list is named by colony id when x is MultiColony-class; NULL when

x is NULL

Details

The returned genotypes are spanning multiple bi-allelic SNP of a non-recombining csd locus / haplotype. In most cases you will want to use getCsdAlleles.

Functions

  • getQueenCsdGeno(): Access csd genotypes of the queen

  • getFathersCsdGeno(): Access csd genotypes of the fathers

  • getVirginQueensCsdGeno(): Access csd genotypes of the virgin queens

  • getWorkersCsdGeno(): Access csd genotypes of the virgin queens

  • getDronesCsdGeno(): Access csd genotypes of the virgin queens

Examples

founderGenomes <- quickHaplo(nInd = 8, nChr = 1, segSites = 100)
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 = 4)
#> 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

# Use getCsdGeno on a Population
getCsdGeno(getQueen(colony))
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found
getCsdGeno(getWorkers(colony))
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found

# Using dronesHaploid = TRUE returns drones as haploids instead of double haploids
getCsdGeno(getDrones(colony), nInd = 3, dronesHaploid = TRUE)
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found
# Using dronesHaploid = FALSE returns drones as double haploids
getCsdGeno(getDrones(colony), nInd = 3, dronesHaploid = FALSE)
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found

# Use getCsdGeno on a Colony
getCsdGeno(colony)
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found
getCsdGeno(colony, caste = "queen")
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found
getQueenCsdGeno(colony)
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found
getCsdGeno(colony, caste = "workers")
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found
getWorkersCsdGeno(colony)
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found
# Same aliases exist for all the castes!

# Use getCsdGeno on a MultiColony - same behaviour as for the Colony!
getCsdGeno(apiary)
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found
getCsdGeno(apiary, nInd = 2)
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found