founderGenomes <- quickHaplo(nInd = 8, nChr = 1, segSites = 100)
SP <- SimParamBee$new(founderGenomes)
SP$nThreads = 1L
SP$addTraitA(nQtlPerChr = 10, var = 1)
SP$setVarE(varE = 1)
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
getPheno(x = getQueen(colony))
queens <- getQueen(apiary, collapse = TRUE)
getPheno(queens)
# Input is a colony
getPheno(colony, caste = "queen")
getQueenPheno(colony)
getPheno(colony, caste = "fathers")
getPheno(colony, caste = "fathers", nInd = 2)
getPheno(colony, caste = "fathers", nInd = 2) # random sample!
getFathersPheno(colony)
getFathersPheno(colony, nInd = 2)
getPheno(colony, caste = "workers")
getWorkersPheno(colony)
# Same aliases exist for all the castes!!!
# Get phenotypes for all individuals
getPheno(colony, caste = "all")
# Get all phenotypes in a single matrix
getPheno(colony, caste = "all", collapse = TRUE)
# Input is a MultiColony - same behaviour as for the Colony!
getPheno(apiary, caste = "queen")
getQueenPheno(apiary)
# Get the phenotypes of all individuals either by colony or in a single matrix
getPheno(apiary, caste = "all")
getPheno(apiary, caste = "all", collapse = TRUE)
Run the code above in your browser using DataLab