diff --git a/DESCRIPTION b/DESCRIPTION index 594612bf8d1c73be40f78b7251ba54ea41d865a5..c3b526bc1958c3ef1da8eeaf086721ec44d20121 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Package: splatter Type: Package Title: Simple Simulation of Single-cell RNA Sequencing Data -Version: 1.1.2 -Date: 2017-07-16 +Version: 1.1.3 +Date: 2017-07-20 Author: Luke Zappia Authors@R: c(person("Luke", "Zappia", role = c("aut", "cre"), diff --git a/NEWS.md b/NEWS.md index 3ced178b8e7c33d96a31b3472a22c0d11005d5ca..36c15796fbbc795b5219c97923a2e17c674e7dcb 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,8 @@ +# 1.1.3 + +* Add verbose option to scDDEstimate +* Change "mean-dropout" to "mean-zeros" in compareSCESets + # 1.1.2 * Update summariseDiff diff --git a/R/compare.R b/R/compare.R index ffee65d17804d86b5410894a47d55837211ca4ac..45af8032c2f8b585e14546faff21474a6187651b 100644 --- a/R/compare.R +++ b/R/compare.R @@ -29,7 +29,7 @@ #' \item{\code{ZerosCell}}{Boxplot of the percentage of each cell #' that is zero.} #' \item{\code{MeanZeros}}{Scatter plot with fitted lines showing -#' the mean-dropout relationship.} +#' the mean-zeros relationship.} #' } #' } #' } @@ -164,7 +164,7 @@ compareSCESets <- function(sces, point.size = 0.1, point.alpha = 0.1, scale_fill_manual(values = colours) + xlab("Mean count") + ylab("Percentage zeros") + - ggtitle("Mean-dropout relationship") + + ggtitle("Mean-zeros relationship") + theme_minimal() if (fits) { diff --git a/R/scDD-estimate.R b/R/scDD-estimate.R index 542d3af397549c7b7ed5f7ab76e2241b8c41ab99..f1aba9c83c3be7343c1ddf9f1dd19cb0aa9f3c4a 100644 --- a/R/scDD-estimate.R +++ b/R/scDD-estimate.R @@ -7,6 +7,7 @@ #' @param conditions Vector giving the condition that each cell belongs to. #' Conditions can be 1 or 2. #' @param params SCDDParams object to store estimated values in. +#' @param verbose logical. Whether to show progress messages. #' @param BPPARAM A \code{\link[BiocParallel]{BiocParallelParam}} instance #' giving the parallel back-end to be used. Default is #' \code{\link[BiocParallel]{SerialParam}} which uses a single core. @@ -29,23 +30,23 @@ #' @importFrom BiocParallel SerialParam #' @export scDDEstimate <- function(counts, conditions, params = newSCDDParams(), - BPPARAM = SerialParam()) { + verbose = TRUE, BPPARAM = SerialParam()) { UseMethod("scDDEstimate") } #' @rdname scDDEstimate #' @export scDDEstimate.SCESet <- function(counts, conditions, params = newSCDDParams(), - BPPARAM = SerialParam()) { + verbose = TRUE, BPPARAM = SerialParam()) { counts <- scater::counts(counts) - scDDEstimate(counts, conditions, params) + scDDEstimate(counts, conditions, params, verbose, BPPARAM) } #' @rdname scDDEstimate #' @importFrom methods as #' @export scDDEstimate.matrix <- function(counts, conditions, params = newSCDDParams(), - BPPARAM = SerialParam()) { + verbose = TRUE, BPPARAM = SerialParam()) { if (!requireNamespace("scDD", quietly = TRUE)) { stop("The scDD simulation requires the 'scDD' package.") @@ -61,8 +62,15 @@ scDDEstimate.matrix <- function(counts, conditions, params = newSCDDParams(), counts.list <- list(Cond1 = counts[, conditions == 1], Cond2 = counts[, conditions == 2]) - processed <- scDD::preprocess(counts.list, c("Cond1", "Cond2"), - median_norm = TRUE) + if (verbose) { + processed <- scDD::preprocess(counts.list, c("Cond1", "Cond2"), + median_norm = TRUE) + } else { + suppressMessages( + processed <- scDD::preprocess(counts.list, c("Cond1", "Cond2"), + median_norm = TRUE) + ) + } assays <- S4Vectors::SimpleList(NormCounts = processed) @@ -72,7 +80,13 @@ scDDEstimate.matrix <- function(counts, conditions, params = newSCDDParams(), SCdat <- SummarizedExperiment::SummarizedExperiment(assays = assays, colData = colData) - SCdat <- scDD::scDD(SCdat, testZeroes = FALSE, param = BPPARAM) + if (verbose) { + SCdat <- scDD::scDD(SCdat, testZeroes = FALSE, param = BPPARAM) + } else { + dummy <- utils::capture.output(suppressMessages( + SCdat <- scDD::scDD(SCdat, testZeroes = FALSE, param = BPPARAM) + )) + } res <- scDD::results(SCdat) res <- res[!is.na(res$DDcategory), ] diff --git a/man/compareSCESets.Rd b/man/compareSCESets.Rd index 126acbcb3c8db1c1110cd71afb58f65977cbbaee..4c4393c7aa304ee55f4d3c6aaf7acac0c16841ea 100644 --- a/man/compareSCESets.Rd +++ b/man/compareSCESets.Rd @@ -45,7 +45,7 @@ The returned list has three items: \item{\code{ZerosCell}}{Boxplot of the percentage of each cell that is zero.} \item{\code{MeanZeros}}{Scatter plot with fitted lines showing - the mean-dropout relationship.} + the mean-zeros relationship.} } } } diff --git a/man/scDDEstimate.Rd b/man/scDDEstimate.Rd index 259a6984df10cf61cf7b3d9387750c3c986ebafb..44bd40141ff5035b354433b7ac47ab958dc2e85b 100644 --- a/man/scDDEstimate.Rd +++ b/man/scDDEstimate.Rd @@ -6,14 +6,14 @@ \alias{scDDEstimate.matrix} \title{Estimate scDD simulation parameters} \usage{ -scDDEstimate(counts, conditions, params = newSCDDParams(), +scDDEstimate(counts, conditions, params = newSCDDParams(), verbose = TRUE, BPPARAM = SerialParam()) \method{scDDEstimate}{SCESet}(counts, conditions, params = newSCDDParams(), - BPPARAM = SerialParam()) + verbose = TRUE, BPPARAM = SerialParam()) \method{scDDEstimate}{matrix}(counts, conditions, params = newSCDDParams(), - BPPARAM = SerialParam()) + verbose = TRUE, BPPARAM = SerialParam()) } \arguments{ \item{counts}{either a counts matrix or an SCESet object containing count @@ -24,6 +24,8 @@ Conditions can be 1 or 2.} \item{params}{SCDDParams object to store estimated values in.} +\item{verbose}{logical. Whether to show progress messages.} + \item{BPPARAM}{A \code{\link[BiocParallel]{BiocParallelParam}} instance giving the parallel back-end to be used. Default is \code{\link[BiocParallel]{SerialParam}} which uses a single core.}