diff --git a/DESCRIPTION b/DESCRIPTION index 60ea856fc6ebae2b79300e144cb6918d69c2408b..5016ad39e517bdcf25ecd682291c3379133aa185 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Package: splatter Type: Package Title: Simple Simulation of Single-cell RNA Sequencing Data -Version: 1.0.1 -Date: 2017-04-28 +Version: 1.0.2 +Date: 2017-05-15 Author: Luke Zappia Authors@R: c(person("Luke", "Zappia", role = c("aut", "cre"), diff --git a/NEWS.md b/NEWS.md index 83e091a7bacd5c5b207e74dd37f2e08eb3a1502e..6b1c7dfc0aa69f833472096b12b6fe5d87e8aeab 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,7 @@ +# 1.0.2 + +* Fix error handling when fitting means + # 1.0.1 * Fix scales in some difference plots diff --git a/R/splat-estimate.R b/R/splat-estimate.R index 275b35f1432a6acf86c30f25c39a06ae36278083..d0a48377042afc001ef89f4a2a096056d4571468 100644 --- a/R/splat-estimate.R +++ b/R/splat-estimate.R @@ -81,9 +81,9 @@ splatEstMean <- function(norm.counts, params) { means <- winsorize(means, q = 0.1) - fit <- try(fitdistrplus::fitdist(means, "gamma", method = "mge", - gof = "CvM")) - if (class(fit) == "try-error") { + fit <- fitdistrplus::fitdist(means, "gamma", method = "mge", + gof = "CvM") + if (fit$convergence > 0) { warning("Goodness of fit failed, using Method of Moments") fit <- fitdistrplus::fitdist(means, "gamma", method = "mme") }