Level 0 function that returns one haplotype of drones, because we internally simulate them as diploid (doubled haploid). This is an internal utility function that you likely don't need to use.

reduceDroneHaplo(haplo, pop)

Arguments

haplo

matrix-class

pop

Pop-class

Value

matrix with one haplotype per drone instead of two - the order of individuals stays the same, but there will be less rows!

Details

While this function is meant to work on male (drone) haplotypes, we handle cases where the haplo matrix contains male and female haplotypes, which is why you need to provide pop. We only reduce haplotypes for males though.

Examples

founderGenomes <- quickHaplo(nInd = 3, nChr = 1, segSites = 5)
SP <- SimParamBee$new(founderGenomes, csdChr = NULL)
basePop <- createVirginQueens(founderGenomes)
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found
drones <- createDrones(x = basePop[1], nInd = 2)
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found

(tmp <- getSegSiteHaplo(drones, dronesHaploid = FALSE))
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found
reduceDroneHaplo(haplo = tmp, pop = drones)
#> Error in reduceDroneHaplo(haplo = tmp, pop = drones): object 'tmp' not found

(tmp <- getSegSiteHaplo(c(basePop, drones), dronesHaploid = FALSE))
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found
reduceDroneHaplo(haplo = tmp, pop = c(basePop, drones))
#> Error in reduceDroneHaplo(haplo = tmp, pop = c(basePop, drones)): object 'tmp' not found