Skip to content
Snippets Groups Projects
Commit afcde830 authored by Luke Zappia's avatar Luke Zappia
Browse files

Merge branch 'scDD-est'

* scDD-est:
  Change mean-dropout to mean-zeros
  Add verbose to scDDEstimate
parents 01213c5a c9f34917
No related branches found
No related tags found
No related merge requests found
Package: splatter Package: splatter
Type: Package Type: Package
Title: Simple Simulation of Single-cell RNA Sequencing Data Title: Simple Simulation of Single-cell RNA Sequencing Data
Version: 1.1.2 Version: 1.1.3
Date: 2017-07-16 Date: 2017-07-20
Author: Luke Zappia Author: Luke Zappia
Authors@R: Authors@R:
c(person("Luke", "Zappia", role = c("aut", "cre"), c(person("Luke", "Zappia", role = c("aut", "cre"),
......
# 1.1.3
* Add verbose option to scDDEstimate
* Change "mean-dropout" to "mean-zeros" in compareSCESets
# 1.1.2 # 1.1.2
* Update summariseDiff * Update summariseDiff
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
#' \item{\code{ZerosCell}}{Boxplot of the percentage of each cell #' \item{\code{ZerosCell}}{Boxplot of the percentage of each cell
#' that is zero.} #' that is zero.}
#' \item{\code{MeanZeros}}{Scatter plot with fitted lines showing #' \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, ...@@ -164,7 +164,7 @@ compareSCESets <- function(sces, point.size = 0.1, point.alpha = 0.1,
scale_fill_manual(values = colours) + scale_fill_manual(values = colours) +
xlab("Mean count") + xlab("Mean count") +
ylab("Percentage zeros") + ylab("Percentage zeros") +
ggtitle("Mean-dropout relationship") + ggtitle("Mean-zeros relationship") +
theme_minimal() theme_minimal()
if (fits) { if (fits) {
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#' @param conditions Vector giving the condition that each cell belongs to. #' @param conditions Vector giving the condition that each cell belongs to.
#' Conditions can be 1 or 2. #' Conditions can be 1 or 2.
#' @param params SCDDParams object to store estimated values in. #' @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 #' @param BPPARAM A \code{\link[BiocParallel]{BiocParallelParam}} instance
#' giving the parallel back-end to be used. Default is #' giving the parallel back-end to be used. Default is
#' \code{\link[BiocParallel]{SerialParam}} which uses a single core. #' \code{\link[BiocParallel]{SerialParam}} which uses a single core.
...@@ -29,23 +30,23 @@ ...@@ -29,23 +30,23 @@
#' @importFrom BiocParallel SerialParam #' @importFrom BiocParallel SerialParam
#' @export #' @export
scDDEstimate <- function(counts, conditions, params = newSCDDParams(), scDDEstimate <- function(counts, conditions, params = newSCDDParams(),
BPPARAM = SerialParam()) { verbose = TRUE, BPPARAM = SerialParam()) {
UseMethod("scDDEstimate") UseMethod("scDDEstimate")
} }
#' @rdname scDDEstimate #' @rdname scDDEstimate
#' @export #' @export
scDDEstimate.SCESet <- function(counts, conditions, params = newSCDDParams(), scDDEstimate.SCESet <- function(counts, conditions, params = newSCDDParams(),
BPPARAM = SerialParam()) { verbose = TRUE, BPPARAM = SerialParam()) {
counts <- scater::counts(counts) counts <- scater::counts(counts)
scDDEstimate(counts, conditions, params) scDDEstimate(counts, conditions, params, verbose, BPPARAM)
} }
#' @rdname scDDEstimate #' @rdname scDDEstimate
#' @importFrom methods as #' @importFrom methods as
#' @export #' @export
scDDEstimate.matrix <- function(counts, conditions, params = newSCDDParams(), scDDEstimate.matrix <- function(counts, conditions, params = newSCDDParams(),
BPPARAM = SerialParam()) { verbose = TRUE, BPPARAM = SerialParam()) {
if (!requireNamespace("scDD", quietly = TRUE)) { if (!requireNamespace("scDD", quietly = TRUE)) {
stop("The scDD simulation requires the 'scDD' package.") stop("The scDD simulation requires the 'scDD' package.")
...@@ -61,8 +62,15 @@ scDDEstimate.matrix <- function(counts, conditions, params = newSCDDParams(), ...@@ -61,8 +62,15 @@ scDDEstimate.matrix <- function(counts, conditions, params = newSCDDParams(),
counts.list <- list(Cond1 = counts[, conditions == 1], counts.list <- list(Cond1 = counts[, conditions == 1],
Cond2 = counts[, conditions == 2]) Cond2 = counts[, conditions == 2])
processed <- scDD::preprocess(counts.list, c("Cond1", "Cond2"), if (verbose) {
median_norm = TRUE) 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) assays <- S4Vectors::SimpleList(NormCounts = processed)
...@@ -72,7 +80,13 @@ scDDEstimate.matrix <- function(counts, conditions, params = newSCDDParams(), ...@@ -72,7 +80,13 @@ scDDEstimate.matrix <- function(counts, conditions, params = newSCDDParams(),
SCdat <- SummarizedExperiment::SummarizedExperiment(assays = assays, SCdat <- SummarizedExperiment::SummarizedExperiment(assays = assays,
colData = colData) 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 <- scDD::results(SCdat)
res <- res[!is.na(res$DDcategory), ] res <- res[!is.na(res$DDcategory), ]
......
...@@ -45,7 +45,7 @@ The returned list has three items: ...@@ -45,7 +45,7 @@ The returned list has three items:
\item{\code{ZerosCell}}{Boxplot of the percentage of each cell \item{\code{ZerosCell}}{Boxplot of the percentage of each cell
that is zero.} that is zero.}
\item{\code{MeanZeros}}{Scatter plot with fitted lines showing \item{\code{MeanZeros}}{Scatter plot with fitted lines showing
the mean-dropout relationship.} the mean-zeros relationship.}
} }
} }
} }
......
...@@ -6,14 +6,14 @@ ...@@ -6,14 +6,14 @@
\alias{scDDEstimate.matrix} \alias{scDDEstimate.matrix}
\title{Estimate scDD simulation parameters} \title{Estimate scDD simulation parameters}
\usage{ \usage{
scDDEstimate(counts, conditions, params = newSCDDParams(), scDDEstimate(counts, conditions, params = newSCDDParams(), verbose = TRUE,
BPPARAM = SerialParam()) BPPARAM = SerialParam())
\method{scDDEstimate}{SCESet}(counts, conditions, params = newSCDDParams(), \method{scDDEstimate}{SCESet}(counts, conditions, params = newSCDDParams(),
BPPARAM = SerialParam()) verbose = TRUE, BPPARAM = SerialParam())
\method{scDDEstimate}{matrix}(counts, conditions, params = newSCDDParams(), \method{scDDEstimate}{matrix}(counts, conditions, params = newSCDDParams(),
BPPARAM = SerialParam()) verbose = TRUE, BPPARAM = SerialParam())
} }
\arguments{ \arguments{
\item{counts}{either a counts matrix or an SCESet object containing count \item{counts}{either a counts matrix or an SCESet object containing count
...@@ -24,6 +24,8 @@ Conditions can be 1 or 2.} ...@@ -24,6 +24,8 @@ Conditions can be 1 or 2.}
\item{params}{SCDDParams object to store estimated values in.} \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 \item{BPPARAM}{A \code{\link[BiocParallel]{BiocParallelParam}} instance
giving the parallel back-end to be used. Default is giving the parallel back-end to be used. Default is
\code{\link[BiocParallel]{SerialParam}} which uses a single core.} \code{\link[BiocParallel]{SerialParam}} which uses a single core.}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment