Skip to content

Commit

Permalink
Merge branch 'devel' of https://github.com/LStrachan/SIMplyBee_fork i…
Browse files Browse the repository at this point in the history
…nto devel
  • Loading branch information
LStrachan committed Dec 21, 2023
2 parents 47cca09 + 8ef1cf4 commit fb126a0
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 38 deletions.
34 changes: 17 additions & 17 deletions tests/testthat/test-L0_auxiliary_functions.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# ---- nColonies ----
test_that("nColonies", {
founderGenomes <- quickHaplo(nInd = 3, nChr = 1, segSites = 100)
SP <- SimParamBee$new(founderGenomes)
SP <- SimParamBee$new(founderGenomes, csdChr = NULL)
SP$nThreads = 1L
basePop <- createVirginQueens(founderGenomes, simParamBee = SP)
expect_equal(nColonies(createMultiColony(n = 2, simParamBee = SP)), 2)
Expand All @@ -13,7 +13,7 @@ test_that("nColonies", {
# ---- nCaste ----
test_that("nCaste", {
founderGenomes <- quickHaplo(nInd = 5, nChr = 1, segSites = 100)
SP <- SimParamBee$new(founderGenomes)
SP <- SimParamBee$new(founderGenomes, csdChr = NULL)

basePop <- createVirginQueens(founderGenomes, simParamBee = SP)
drones <- createDrones(x = basePop[1], nInd = 45, simParamBee = SP)
Expand All @@ -38,7 +38,7 @@ test_that("nCaste", {

test_that("nQueens", {
founderGenomes <- quickHaplo(nInd = 10, nChr = 1, segSites = 100)
SP <- SimParamBee$new(founderGenomes)
SP <- SimParamBee$new(founderGenomes, csdChr = NULL)
SP$nThreads = 1L
basePop <- createVirginQueens(founderGenomes, simParamBee = SP)
drones <- createDrones(basePop[1], n = 1000, simParamBee = SP)
Expand All @@ -58,7 +58,7 @@ test_that("nQueens", {
# ---- nDrones ----
test_that("nDrones", {
founderGenomes <- quickHaplo(nInd = 10, nChr = 1, segSites = 100)
SP <- SimParamBee$new(founderGenomes)
SP <- SimParamBee$new(founderGenomes, csdChr = NULL)
SP$nThreads = 1L
basePop <- createVirginQueens(founderGenomes, simParamBee = SP)
drones <- createDrones(basePop[1], n = 1000, simParamBee = SP)
Expand Down Expand Up @@ -101,7 +101,7 @@ test_that("isGenoHeterozygous", {

test_that("isCaste", {
founderGenomes <- quickHaplo(nInd = 8, nChr = 1, segSites = 100)
SP <- SimParamBee$new(founderGenomes)
SP <- SimParamBee$new(founderGenomes, csdChr = NULL)
SP$nThreads = 1L
basePop <- createVirginQueens(founderGenomes, simParamBee = SP)

Expand Down Expand Up @@ -229,7 +229,7 @@ test_that("nHomBrood", {

test_that("isQueenPresent", {
founderGenomes <- quickHaplo(nInd = 8, nChr = 1, segSites = 100)
SP <- SimParamBee$new(founderGenomes)
SP <- SimParamBee$new(founderGenomes, csdChr = NULL)
SP$nThreads = 1L
basePop <- createVirginQueens(founderGenomes, simParamBee = SP)

Expand Down Expand Up @@ -257,7 +257,7 @@ test_that("isQueenPresent", {

test_that("isVirginQueensPresent", {
founderGenomes <- quickHaplo(nInd = 8, nChr = 1, segSites = 100)
SP <- SimParamBee$new(founderGenomes)
SP <- SimParamBee$new(founderGenomes, csdChr = NULL)
SP$nThreads = 1L
basePop <- createVirginQueens(founderGenomes, simParamBee = SP)

Expand Down Expand Up @@ -287,7 +287,7 @@ test_that("isVirginQueensPresent", {

test_that("isProductive", {
founderGenomes <- quickHaplo(nInd = 8, nChr = 1, segSites = 100)
SP <- SimParamBee$new(founderGenomes)
SP <- SimParamBee$new(founderGenomes, csdChr = NULL)
SP$nThreads = 1L
basePop <- createVirginQueens(founderGenomes, simParamBee = SP)

Expand Down Expand Up @@ -321,7 +321,7 @@ test_that("isProductive", {

test_that("reduceDroneHaplo", {
founderGenomes <- quickHaplo(nInd = 3, nChr = 1, segSites = 100)
SP <- SimParamBee$new(founderGenomes)
SP <- SimParamBee$new(founderGenomes, csdChr = NULL)
SP$nThreads = 1L
basePop <- createVirginQueens(founderGenomes, simParamBee = SP)
drones <- createDrones(x = basePop[1], nInd = 2, simParamBee = SP)
Expand All @@ -345,7 +345,7 @@ test_that("reduceDroneHaplo", {

test_that("reduceDroneGeno", {
founderGenomes <- quickHaplo(nInd = 10, nChr = 1, segSites = 100)
SP <- SimParamBee$new(founderGenomes)
SP <- SimParamBee$new(founderGenomes, csdChr = NULL)
SP$nThreads = 1L
basePop <- createVirginQueens(founderGenomes, simParamBee = SP)
drones <- createDrones(x = basePop[1], nInd = 2, simParamBee = SP)
Expand Down Expand Up @@ -555,7 +555,7 @@ test_that("nCsdAlleles", {

test_that("calcBeeGRMIbs", {
founderGenomes <- quickHaplo(nInd = 3, nChr = 1, segSites = 100)
SP <- SimParamBee$new(founderGenomes)
SP <- SimParamBee$new(founderGenomes, csdChr = NULL)
SP$nThreads = 1L
SP$setTrackRec(TRUE)
SP$setTrackPed(isTrackPed = TRUE)
Expand Down Expand Up @@ -663,7 +663,7 @@ test_that("emptyNULL", {

test_that("isDronesPresent", {
founderGenomes <- quickHaplo(nInd = 8, nChr = 1, segSites = 100)
SP <- SimParamBee$new(founderGenomes)
SP <- SimParamBee$new(founderGenomes, csdChr = NULL)
SP$nThreads = 1L
basePop <- createVirginQueens(founderGenomes, simParamBee = SP)

Expand All @@ -688,7 +688,7 @@ test_that("isDronesPresent", {

test_that("isFathersPresent", {
founderGenomes <- quickHaplo(nInd = 8, nChr = 1, segSites = 100)
SP <- SimParamBee$new(founderGenomes)
SP <- SimParamBee$new(founderGenomes, csdChr = NULL)
SP$nThreads = 1L
basePop <- createVirginQueens(founderGenomes, simParamBee = SP)

Expand Down Expand Up @@ -716,7 +716,7 @@ test_that("isFathersPresent", {

test_that("isWorkersPresent", {
founderGenomes <- quickHaplo(nInd = 8, nChr = 1, segSites = 100)
SP <- SimParamBee$new(founderGenomes)
SP <- SimParamBee$new(founderGenomes, csdChr = NULL)
SP$nThreads = 1L
basePop <- createVirginQueens(founderGenomes, simParamBee = SP)

Expand Down Expand Up @@ -772,7 +772,7 @@ test_that("isGenoHeterozygous", {
# ---- getBV ----
test_that("getBV", {
founderGenomes <- quickHaplo(nInd = 8, nChr = 1, segSites = 100)
SP <- SimParamBee$new(founderGenomes)
SP <- SimParamBee$new(founderGenomes, csdChr = NULL)
SP$nThreads = 1L
SP$addTraitA(nQtlPerChr = 10, var = 1)
SP$addSnpChip(5)
Expand Down Expand Up @@ -802,7 +802,7 @@ test_that("getBV", {
# ---- getDd ----
test_that("getDd", {
founderGenomes <- quickHaplo(nInd = 8, nChr = 1, segSites = 100)
SP <- SimParamBee$new(founderGenomes)
SP <- SimParamBee$new(founderGenomes, csdChr = NULL)
SP$nThreads = 1L
SP$addTraitAD(nQtlPerChr = 10, meanDD = 0.2, varDD = 0.1)
basePop <- createVirginQueens(founderGenomes, simParamBee = SP)
Expand Down Expand Up @@ -831,7 +831,7 @@ test_that("getDd", {
# ---- getAa ----
test_that("getAa", {
founderGenomes <- quickHaplo(nInd = 8, nChr = 1, segSites = 100)
SP <- SimParamBee$new(founderGenomes)
SP <- SimParamBee$new(founderGenomes, csdChr = NULL)
SP$nThreads = 1L
SP$addTraitADE(nQtlPerChr = 10, meanDD = 0.2, varDD = 0.1, relAA = 0.5)
basePop <- createVirginQueens(founderGenomes, simParamBee = SP)
Expand Down
22 changes: 11 additions & 11 deletions tests/testthat/test-L1_pop_functions.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

test_that("getCastePop", {
founderGenomes <- quickHaplo(nInd = 4, nChr = 1, segSites = 100)
SP <- SimParamBee$new(founderGenomes)
SP <- SimParamBee$new(founderGenomes, csdChr = NULL)
SP$nThreads = 1L
basePop <- createVirginQueens(founderGenomes, simParamBee = SP)
drones <- createDrones(basePop[1], n = 15, simParamBee = SP)
Expand Down Expand Up @@ -37,7 +37,7 @@ test_that("getCastePop", {

test_that("createVirginQueens", {
founderGenomes <- quickHaplo(nInd = 5, nChr = 1, segSites = 100)
SP <- SimParamBee$new(founderGenomes)
SP <- SimParamBee$new(founderGenomes, csdChr = NULL)
SP$nThreads = 1L
#check that output is virginqueens ?
expect_true(all(isVirginQueen(createVirginQueens(founderGenomes, simParamBee = SP), simParamBee = SP)))
Expand Down Expand Up @@ -88,7 +88,7 @@ test_that("createVirginQueens", {

test_that("createDrones", {
founderGenomes <- quickHaplo(nInd = 6, nChr = 1, segSites = 100)
SP <- SimParamBee$new(founderGenomes)
SP <- SimParamBee$new(founderGenomes, csdChr = NULL)
SP$nThreads = 1L
# Error: x can't be a MapPop
expect_error(createDrones(founderGenomes, simParamBee = SP))
Expand Down Expand Up @@ -134,7 +134,7 @@ test_that("createDrones", {

test_that("combineBeeGametes", {
founderGenomes <- quickHaplo(nInd = 6, nChr = 1, segSites = 100)
SP <- SimParamBee$new(founderGenomes)
SP <- SimParamBee$new(founderGenomes, csdChr = NULL)
SP$nThreads = 1L
basePop <- createVirginQueens(founderGenomes, simParamBee = SP)
drones <- createDrones(basePop[1], n = 15, simParamBee = SP)
Expand Down Expand Up @@ -165,7 +165,7 @@ test_that("combineBeeGametes", {

test_that("pullCastePop", {
founderGenomes <- quickHaplo(nInd = 4, nChr = 1, segSites = 100)
SP <- SimParamBee$new(founderGenomes)
SP <- SimParamBee$new(founderGenomes, csdChr = NULL)
SP$nThreads = 1L
basePop <- createVirginQueens(founderGenomes, simParamBee = SP)
drones <- createDrones(basePop[1], n = 15, simParamBee = SP)
Expand Down Expand Up @@ -221,7 +221,7 @@ test_that("pullCastePop", {
# ---- cross ----
test_that("cross", {
founderGenomes <- quickHaplo(nInd = 8, nChr = 1, segSites = 100)
SP <- SimParamBee$new(founderGenomes)
SP <- SimParamBee$new(founderGenomes, csdChr = NULL)
SP$nThreads = 1L
basePop <- createVirginQueens(founderGenomes, nInd = 100, simParamBee = SP)
drones <- createDrones(basePop[1], n = 1000, simParamBee = SP)
Expand Down Expand Up @@ -285,7 +285,7 @@ test_that("cross", {
# ---- setQueensYearOfBirth ----
test_that("setQueensYearOfBirth", {
founderGenomes <- quickHaplo(nInd = 7, nChr = 1, segSites = 100)
SP <- SimParamBee$new(founderGenomes)
SP <- SimParamBee$new(founderGenomes, csdChr = NULL)
SP$nThreads = 1L
basePop <- createVirginQueens(founderGenomes, nInd = 100, simParamBee = SP)
drones <- createDrones(x = basePop[1], nInd = 1000, simParamBee = SP)
Expand Down Expand Up @@ -317,7 +317,7 @@ test_that("setQueensYearOfBirth", {
# ---- createDCA ----
test_that("createDCA", {
founderGenomes <- quickHaplo(nInd = 8, nChr = 1, segSites = 100)
SP <- SimParamBee$new(founderGenomes)
SP <- SimParamBee$new(founderGenomes, csdChr = NULL)
SP$nThreads = 1L
basePop <- createVirginQueens(founderGenomes, simParamBee = SP)

Expand Down Expand Up @@ -352,7 +352,7 @@ test_that("createDCA", {
# ---- pullDroneGroupsFromDCA ----
test_that("pullDroneGroupsFromDCA", {
founderGenomes <- quickHaplo(nInd = 8, nChr = 1, segSites = 100)
SP <- SimParamBee$new(founderGenomes)
SP <- SimParamBee$new(founderGenomes, csdChr = NULL)
SP$nThreads = 1L
basePop <- createVirginQueens(founderGenomes, simParamBee = SP)

Expand Down Expand Up @@ -382,7 +382,7 @@ test_that("pullDroneGroupsFromDCA", {

test_that("combineBeeGametes", {
founderGenomes <- quickHaplo(nInd = 3, nChr = 1, segSites = 100)
SP <- SimParamBee$new(founderGenomes)
SP <- SimParamBee$new(founderGenomes, csdChr = NULL)
SP$nThreads = 1L
basePop <- createVirginQueens(founderGenomes, simParamBee = SP)

Expand All @@ -398,7 +398,7 @@ test_that("combineBeeGametes", {

test_that("combineBeeGametesHaploidDiploid", {
founderGenomes <- quickHaplo(nInd = 3, nChr = 1, segSites = 100)
SP <- SimParamBee$new(founderGenomes)
SP <- SimParamBee$new(founderGenomes, csdChr = NULL)
SP$nThreads = 1L
basePop <- createVirginQueens(founderGenomes, simParamBee = SP)

Expand Down
12 changes: 6 additions & 6 deletions tests/testthat/test-L2_colony_functions.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

test_that("createColony", {
founderGenomes <- quickHaplo(nInd = 5, nChr = 1, segSites = 100)
SP <- SimParamBee$new(founderGenomes)
SP <- SimParamBee$new(founderGenomes, csdChr = NULL)
SP$nThreads = 1L
basePop <- createVirginQueens(founderGenomes, simParamBee = SP)
drones <- createDrones(x = basePop[1], nInd = 15, simParamBee = SP)
Expand All @@ -22,7 +22,7 @@ test_that("createColony", {

test_that("reQueen", {
founderGenomes <- quickHaplo(nInd = 5, nChr = 1, segSites = 100)
SP <- SimParamBee$new(founderGenomes)
SP <- SimParamBee$new(founderGenomes, csdChr = NULL)
SP$nThreads = 1L
basePop <- createVirginQueens(founderGenomes, simParamBee = SP)
drones <- createDrones(x = basePop[1], nInd = 30, simParamBee = SP)
Expand Down Expand Up @@ -279,7 +279,7 @@ test_that("removeFunctions", {
# ---- SetLocation ----
test_that("setLocation", {
founderGenomes <- quickHaplo(nInd = 5, nChr = 1, segSites = 50)
SP <- SimParamBee$new(founderGenomes)
SP <- SimParamBee$new(founderGenomes, csdChr = NULL)
SP$nThreads = 1L
basePop <- createVirginQueens(founderGenomes, simParamBee = SP)
drones <- createDrones(basePop[1], n = 1000, simParamBee = SP)
Expand Down Expand Up @@ -319,7 +319,7 @@ test_that("setLocation", {

test_that("supersede", {
founderGenomes <- quickHaplo(nInd = 10, nChr = 1, segSites = 100)
SP <- SimParamBee$new(founderGenomes)
SP <- SimParamBee$new(founderGenomes, csdChr = NULL)
SP$nThreads = 1L
basePop <- createVirginQueens(founderGenomes, simParamBee = SP)
drones <- createDrones(basePop[1], n = 1000, simParamBee = SP)
Expand Down Expand Up @@ -396,7 +396,7 @@ test_that("split", {

test_that("resetEvents", {
founderGenomes <- quickHaplo(nInd = 5, nChr = 1, segSites = 100)
SP <- SimParamBee$new(founderGenomes)
SP <- SimParamBee$new(founderGenomes, csdChr = NULL)
SP$nThreads = 1L
basePop <- createVirginQueens(founderGenomes, simParamBee = SP)

Expand Down Expand Up @@ -511,7 +511,7 @@ test_that("swarm", {

test_that("collapse", {
founderGenomes <- quickHaplo(nInd = 10, nChr = 1, segSites = 100)
SP <- SimParamBee$new(founderGenomes)
SP <- SimParamBee$new(founderGenomes, csdChr = NULL)
SP$nThreads = 1L
basePop <- createVirginQueens(founderGenomes, simParamBee = SP)
drones <- createDrones(basePop[1], n = 1000, simParamBee = SP)
Expand Down
8 changes: 4 additions & 4 deletions tests/testthat/test-L3_Colonies_functions.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

test_that("createMultiColony", {
founderGenomes <- quickHaplo(nInd = 6, nChr = 1, segSites = 100)
SP <- SimParamBee$new(founderGenomes)
SP <- SimParamBee$new(founderGenomes, csdChr = NULL)
SP$nThreads = 1L
basePop <- createVirginQueens(founderGenomes, simParamBee = SP)
drones <- createDrones(basePop[1], n = 100, simParamBee = SP)
Expand Down Expand Up @@ -41,7 +41,7 @@ test_that("createMultiColony", {

test_that("selectColonies", {
founderGenomes <- quickHaplo(nInd = 8, nChr = 1, segSites = 100)
SP <- SimParamBee$new(founderGenomes)
SP <- SimParamBee$new(founderGenomes, csdChr = NULL)
SP$nThreads = 1L
basePop <- createVirginQueens(founderGenomes, simParamBee = SP)

Expand Down Expand Up @@ -85,7 +85,7 @@ test_that("selectColonies", {

test_that("pullColonies", {
founderGenomes <- quickHaplo(nInd = 8, nChr = 1, segSites = 100)
SP <- SimParamBee$new(founderGenomes)
SP <- SimParamBee$new(founderGenomes, csdChr = NULL)
SP$nThreads = 1L
basePop <- createVirginQueens(founderGenomes, simParamBee = SP)
# Error if argument multicolony isn't a multicolony class
Expand Down Expand Up @@ -126,7 +126,7 @@ test_that("pullColonies", {

test_that("removeColonies", {
founderGenomes <- quickHaplo(nInd = 8, nChr = 1, segSites = 100)
SP <- SimParamBee$new(founderGenomes)
SP <- SimParamBee$new(founderGenomes, csdChr = NULL)
SP$nThreads = 1L
basePop <- createVirginQueens(founderGenomes, simParamBee = SP)
# Error if argument multicolony isn't a multicolony class
Expand Down

0 comments on commit fb126a0

Please sign in to comment.