Skip to content
Draft
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Depends: R (>= 4.0.0)
Imports: Rcpp (>= 0.12.7), Rdpack, methods, R6
RdMacros: Rdpack
LinkingTo: Rcpp, RcppArmadillo (>= 0.7.500.0.0), BH, dqrng (>= 0.4.1)
RoxygenNote: 7.3.3
Suggests: knitr, rmarkdown, testthat
VignetteBuilder: knitr
NeedsCompilation: true
Config/roxygen2/version: 8.0.0
2 changes: 2 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export(attrition)
export(bv)
export(cChr)
export(calcGCA)
export(calcPopValue)
export(dd)
export(doubleGenome)
export(ebv)
Expand Down Expand Up @@ -112,6 +113,7 @@ export(solveRRBLUP_EM)
export(solveRRBLUP_EM2)
export(solveRRBLUP_EM3)
export(solveUVM)
export(splitPop)
export(unnameMultiPop)
export(usefulness)
export(varA)
Expand Down
6 changes: 5 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,16 @@

* Added `flattenMultiPop()` function to reduce the depth of a nested MultiPop object up to a defined `level`.

* Added `selectPop()` function to select a subset of populations from a MultiPop. This function uses the new internal `calcPopValue()` function to calculate a summary value for each population, which is then used for selection.
* Added `calcPopValue()` function to calculate summary values for each Pop in a MultiPop.

* Added `selectPop()` function to select a subset of populations from a MultiPop. This function uses the new `calcPopValue()` function.

* Added `unnameMultiPop()` function to remove names from a MultiPop at specific `level`(s).

* Added `newEmptyMultiPop()` function to create an empty MultiPop. It has the same outcome as `newMultiPop()` with no arguments. To make this behavior consistent with `newEmptyPop()`, `newPop()` now also supports creating an empty population with defined ploidy.

* Added `splitPop()` function to divide a Pop or MultiPop object into multiple subpopulations at specified level(s).

* Update `mergePops()` to handle nested MultiPop objects.

* Added asLogNormal() function.
Expand Down
4 changes: 4 additions & 0 deletions R/Class-Pop.R
Original file line number Diff line number Diff line change
Expand Up @@ -1044,6 +1044,7 @@ setValidity("MultiPop",function(object){
errors = character()
# Check that all populations are valid
for(i in seq_len(length(object@pops))){
# TODO: Validate names before returning multiPops
Comment thread
darizasu marked this conversation as resolved.
Outdated
if(!validObject(object@pops[[i]]) &
(is(object@pops[[i]], "Pop") |
is(object@pops[[i]],"MultiPop"))){
Expand Down Expand Up @@ -1433,6 +1434,7 @@ newEmptyMultiPop = function(){
#'
#' # Set simulation parameters
#' SP = SimParam$new(founderPop)
#' \dontshow{SP$nThreads = 1L}
#'
#' # Create population
#' pop = newPop(founderPop, simParam = SP)
Expand All @@ -1458,6 +1460,8 @@ newEmptyMultiPop = function(){
#'
#' @export
unnameMultiPop = function(x, level = Inf) {
stopifnot(isMultiPop(x))

# Get max depth of nesting in MultiPop
md = .depthMultiPop(x)

Expand Down
Loading
Loading