R/Functions_L0_auxilary.R
reduceDroneHaplo.Rd
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)
matrix-class
Pop-class
matrix with one haplotype per drone instead of two - the order of individuals stays the same, but there will be less rows!
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.
founderGenomes <- quickHaplo(nInd = 3, nChr = 1, segSites = 5)
SP <- SimParamBee$new(founderGenomes, csdChr = NULL)
SP$nThreads = 1L
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 eval(expr, envir, enclos): 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 eval(expr, envir, enclos): object 'tmp' not found