Closed gregorgorjanc closed 2 years ago
This should now with version 1.1.2
@gaynorr I am still experiencing issues - below is our SIMplyBee code that breaks when I turn on tracking of recombinations - will try to assemble reproducible AlphaSimR code
> founderGenomes <- quickHaplo(nInd = 3, nChr = 1, segSites = 100)
> SP <- SimParam$new(founderGenomes)
> SP$setTrackRec(isTrackRec = TRUE)
> basePop <- newPop(founderGenomes)
> drones <- createFounderDrones(pop = basePop[1], nDronesPerQueen = 10)
> colony1 <- createColony(queen = basePop[2], fathers = drones[1:5])
> colony2 <- createColony(queen = basePop[3], fathers = drones[6:10])
> colony1 <- addWorkers(colony1, nInd = 10)
Error in lastId - private$.lastId :
non-numeric argument to binary operator
> traceback()
5: simParam$addToRec(newHist)
4: mergeGenome(females = gametesFromTheQueen, males = drones, crossPlan = pairs,
simParam = simParamBee) at Functions_L1_Pop.R#474
3: beeCross(queen = getQueen(x), drones = getFathers(x), nProgeny = nInd,
simParamBee = simParamBee) at Functions_L1_Pop.R#389
2: createWorkers(x, nInd, exact = exact, simParamBee = simParamBee) at Functions_L2_Colony.R#311
1: addWorkers(colony1, nInd = 10)
@gaynorr I can confirm that the reduceGenome()
works in 1.1.2! But mergeGenome()
does not :(
> library(AlphaSimR)
> founderGenomes <- quickHaplo(nInd = 3, nChr = 1, segSites = 100)
> SP <- SimParam$new(founderGenomes)
> basePop <- newPop(founderGenomes)
> x = reduceGenome(basePop[1], nProgeny = 10)
> mergeGenome(x, x, crossPlan = cbind(x@id, x@id))
An object of class "Pop"
Ploidy: 2
Individuals: 10
Chromosomes: 1
Loci: 100
Traits: 0
> library(AlphaSimR)
> founderGenomes <- quickHaplo(nInd = 3, nChr = 1, segSites = 100)
> SP <- SimParam$new(founderGenomes)
> SP$setTrackRec(isTrackRec = TRUE)
> basePop <- newPop(founderGenomes)
> x = reduceGenome(basePop[1], nProgeny = 10)
> mergeGenome(x, x, crossPlan = cbind(x@id, x@id))
Error in lastId - private$.lastId :
non-numeric argument to binary operator
I think that this pull requests solves this issue https://github.com/gaynorr/AlphaSimR/pull/47
I think I discovered a bug related to
reduceGenome()
andSP$setTrackRec()
. Below I show thatreduceGenome()
works fine on its own, but when combined withSP$setTrackRec()
I reproducibly get the same error: