diff --git a/DESCRIPTION b/DESCRIPTION index 9eaece6ab0677126799ae08c6acd70ecccd1682a..4741a42c495e947b8c0168472dc56e4c139024f2 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Package: splatter Type: Package Title: Simple Simulation of Single-cell RNA Sequencing Data -Version: 1.9.7.9015 -Date: 2019-09-26 +Version: 1.9.7.9016 +Date: 2019-10-01 Author: Luke Zappia Authors@R: c(person("Luke", "Zappia", role = c("aut", "cre"), @@ -42,7 +42,8 @@ Imports: SummarizedExperiment, utils, crayon, - S4Vectors + S4Vectors, + rlang Suggests: BiocStyle, covr, diff --git a/NEWS.md b/NEWS.md index 3cb698f85eb3fbbd1055be475dd1883d0bf08113..43dd6ea16a8847de26db27df6a2c739b12289f1a 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,9 @@ +### Version 1.9.7.9016 (2019-10-01) + +* Change the default SplotchParams cell design to place cells at end of path +* Add one time warning for Splotch simulation +* Avoid unnecessarily resetting cells.design in SplotchParams + ### Version 1.9.7.9015 (2019-09-26) * Add doublets to SplotchSimulate diff --git a/R/AllClasses.R b/R/AllClasses.R index 11c05ca8e188ca4b2c2ffa9310e61568a705120b..d53646c66cb67edd8651d9cfd52d459d9984fd66 100644 --- a/R/AllClasses.R +++ b/R/AllClasses.R @@ -410,8 +410,8 @@ setClass("SplotchParams", cells.design = data.frame( Path = 1, Probability = 1, - Alpha = 0, - Beta = 1 + Alpha = 1, + Beta = 0 ), doublet.prop = 0, ambient.scale = 0.05, diff --git a/R/SplotchParams-methods.R b/R/SplotchParams-methods.R index c3a51ccdc20400ac07262e42bcabc8821276e289..e8bc02604394e45470bbda31009ef16364f1dd00 100644 --- a/R/SplotchParams-methods.R +++ b/R/SplotchParams-methods.R @@ -11,6 +11,11 @@ newSplotchParams <- function(...) { stop("The Splotch simulation requires the 'DropletUtils' package.") } + msg <- paste("The Splotch simulation is still experimental and may produce", + "unreliable results. Please try it and report any issues to", + "https://github.com/Oshlack/splatter/issues.") + rlang:::warn_deprecated(msg, id = "warn.splotch") + params <- new("SplotchParams") params <- setParams(params, ...) @@ -260,11 +265,11 @@ setMethod("setParam", "SplotchParams", function(object, name, value) { } if (name == "paths.design" && - (nrow(value) != nrow(getParam(object, "paths.design")))) { + (nrow(value) != nrow(getParam(object, "cells.design")))) { warning("cells.design reset to match paths.design") cells.design <- data.frame(Path = value$Path, Probability = 1 / nrow(value), - Alpha = 0, Beta = 1) + Alpha = 1, Beta = 0) object <- setParamUnchecked(object, "cells.design", cells.design) } @@ -280,6 +285,15 @@ setMethod("setParams", "SplotchParams", function(object, update = NULL, ...) { update <- c(update, list(...)) + # If both cells.design and paths.design are given set cells.design first + # to avoid reset warning + if ("cells.design" %in% names(update) && + "paths.design" %in% names(update)) { + object <- setParamUnchecked(object, "cells.design", + update$cells.design) + update$cells.design <- NULL + } + update <- bringItemsForward(update, c("network.graph", "paths.design")) object <- callNextMethod(object, update)