From e1de64de624f60da95a8542abbd58151ac73374a Mon Sep 17 00:00:00 2001 From: Luke Zappia <lazappi@users.noreply.github.com> Date: Thu, 7 Sep 2017 15:14:52 +1000 Subject: [PATCH] Update simulation documentation --- NAMESPACE | 24 ++++----- R/lun-estimate.R | 10 ++-- R/lun-simulate.R | 11 ++-- R/lun2-estimate.R | 13 ++--- R/lun2-simulate.R | 8 +-- R/scDD-estimate.R | 12 +++-- R/scDD-simulate.R | 11 ++-- R/simple-estimate.R | 11 ++-- R/simple-simulate.R | 6 +-- R/splat-estimate.R | 9 ++-- R/splat-simulate.R | 97 +++++++++++++++++------------------ man/lun2Estimate.Rd | 11 ++-- man/lun2Simulate.Rd | 2 +- man/lunEstimate.Rd | 8 +-- man/lunSimulate.Rd | 4 +- man/scDDEstimate.Rd | 10 ++-- man/scDDSimulate.Rd | 7 +-- man/simpleEstimate.Rd | 9 ++-- man/simpleSimulate.Rd | 2 +- man/splatEstimate.Rd | 9 ++-- man/splatSimBCVMeans.Rd | 4 +- man/splatSimBatchCellMeans.Rd | 4 +- man/splatSimBatchEffects.Rd | 4 +- man/splatSimCellMeans.Rd | 4 +- man/splatSimDE.Rd | 4 +- man/splatSimDropout.Rd | 4 +- man/splatSimGeneMeans.Rd | 4 +- man/splatSimLibSizes.Rd | 4 +- man/splatSimTrueCounts.Rd | 4 +- man/splatSimulate.Rd | 25 ++++----- 30 files changed, 170 insertions(+), 165 deletions(-) diff --git a/NAMESPACE b/NAMESPACE index bf36ba0..53c0acc 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -1,14 +1,14 @@ # Generated by roxygen2: do not edit by hand -S3method(lun2Estimate,SCESet) +S3method(lun2Estimate,SingleCellExperiment) S3method(lun2Estimate,matrix) -S3method(lunEstimate,SCESet) +S3method(lunEstimate,SingleCellExperiment) S3method(lunEstimate,matrix) -S3method(scDDEstimate,SCESet) +S3method(scDDEstimate,SingleCellExperiment) S3method(scDDEstimate,matrix) -S3method(simpleEstimate,SCESet) +S3method(simpleEstimate,SingleCellExperiment) S3method(simpleEstimate,matrix) -S3method(splatEstimate,SCESet) +S3method(splatEstimate,SingleCellExperiment) S3method(splatEstimate,matrix) export(addGeneLengths) export(compareSCESets) @@ -46,12 +46,16 @@ exportClasses(SCDDParams) exportClasses(SimpleParams) exportClasses(SplatParams) importFrom(Biobase,"fData<-") -importFrom(Biobase,"pData<-") -importFrom(Biobase,assayData) importFrom(Biobase,fData) -importFrom(Biobase,pData) importFrom(BiocParallel,SerialParam) importFrom(BiocParallel,bplapply) +importFrom(SingleCellExperiment,SingleCellExperiment) +importFrom(SummarizedExperiment,"assays<-") +importFrom(SummarizedExperiment,"colData<-") +importFrom(SummarizedExperiment,"rowData<-") +importFrom(SummarizedExperiment,assays) +importFrom(SummarizedExperiment,colData) +importFrom(SummarizedExperiment,rowData) importFrom(checkmate,checkCharacter) importFrom(checkmate,checkClass) importFrom(checkmate,checkDataFrame) @@ -88,10 +92,6 @@ importFrom(methods,slot) importFrom(methods,slotNames) importFrom(methods,validObject) importFrom(scater,"cpm<-") -importFrom(scater,"set_exprs<-") -importFrom(scater,counts) -importFrom(scater,get_exprs) -importFrom(scater,newSCESet) importFrom(stats,dnbinom) importFrom(stats,median) importFrom(stats,model.matrix) diff --git a/R/lun-estimate.R b/R/lun-estimate.R index 5cfc46b..8970079 100644 --- a/R/lun-estimate.R +++ b/R/lun-estimate.R @@ -2,8 +2,8 @@ #' #' Estimate simulation parameters for the Lun simulation from a real dataset. #' -#' @param counts either a counts matrix or an SCESet object containing count -#' data to estimate parameters from. +#' @param counts either a counts matrix or an SingleCellExperiment object +#' containing count data to estimate parameters from. #' @param params LunParams object to store estimated values in. #' #' @details @@ -24,8 +24,8 @@ lunEstimate <- function(counts, params = newLunParams()) { #' @rdname lunEstimate #' @export -lunEstimate.SCESet <- function(counts, params = newLunParams()) { - counts <- scater::counts(counts) +lunEstimate.SingleCellExperiment <- function(counts, params = newLunParams()) { + counts <- SingleCellExperiment::counts(counts) lunEstimate(counts, params) } @@ -39,4 +39,4 @@ lunEstimate.matrix <- function(counts, params = newLunParams()) { groupCells = ncol(counts)) return(params) -} \ No newline at end of file +} diff --git a/R/lun-simulate.R b/R/lun-simulate.R index 8ced43e..aa7337c 100644 --- a/R/lun-simulate.R +++ b/R/lun-simulate.R @@ -19,8 +19,8 @@ #' #' See \code{\link{LunParams}} for details of the parameters. #' -#' @return SCESet object containing the simulated counts and intermediate -#' values. +#' @return SingleCellExperiment object containing the simulated counts and +#' intermediate values. #' #' @references #' Lun ATL, Bach K, Marioni JC. Pooling across cells to normalize single-cell @@ -33,9 +33,8 @@ #' @examples #' sim <- lunSimulate() #' -#' @importFrom Biobase fData fData<- pData pData<- -#' @importFrom methods new -#' @importFrom scater newSCESet set_exprs<- +#' @importFrom SummarizedExperiment rowData rowData<- colData colData<- +#' @importFrom SingleCellExperiment SingleCellExperiment #' @importFrom stats rnorm rgamma rnbinom #' @export lunSimulate <- function(params = newLunParams(), verbose = TRUE, ...) { @@ -110,7 +109,7 @@ lunSimulate <- function(params = newLunParams(), verbose = TRUE, ...) { size = 1 / count.disp), nrow = nGenes, ncol = nCells) - if (verbose) {message("Creating final SCESet...")} + if (verbose) {message("Creating final dataset...")} rownames(counts) <- gene.names colnames(counts) <- cell.names diff --git a/R/lun2-estimate.R b/R/lun2-estimate.R index cca9f6e..b4786b4 100644 --- a/R/lun2-estimate.R +++ b/R/lun2-estimate.R @@ -2,8 +2,8 @@ #' #' Estimate simulation parameters for the Lun2 simulation from a real dataset. #' -#' @param counts either a counts matrix or an SCESet object containing count -#' data to estimate parameters from. +#' @param counts either a counts matrix or a SingleCellExperiment object +#' containing count data to estimate parameters from. #' @param plates integer vector giving the plate that each cell originated from. #' @param params Lun2Params object to store estimated values in. #' @param min.size minimum size of clusters when identifying group of cells in @@ -36,10 +36,11 @@ lun2Estimate <- function(counts, plates, params = newLun2Params(), #' @rdname lun2Estimate #' @export -lun2Estimate.SCESet <- function(counts, plates, params = newLun2Params(), - min.size = 200, verbose = TRUE, - BPPARAM = SerialParam()) { - counts <- scater::counts(counts) +lun2Estimate.SingleCellExperiment <- function(counts, plates, + params = newLun2Params(), + min.size = 200, verbose = TRUE, + BPPARAM = SerialParam()) { + counts <- SingleCellExperiment::counts(counts) lun2Estimate(counts, plates, params, min.size = min.size, verbose = verbose) } diff --git a/R/lun2-simulate.R b/R/lun2-simulate.R index 439e3c6..21e3cdb 100644 --- a/R/lun2-simulate.R +++ b/R/lun2-simulate.R @@ -26,7 +26,7 @@ #' number in the dataset used in the estimation step but has the downside that #' some genes or cells may be simulated multiple times. #' -#' @return SCESet containing simulated counts. +#' @return SingleCellExperiment containing simulated counts. #' #' @references #' Lun ATL, Marioni JC. Overcoming confounding plate effects in differential @@ -39,8 +39,8 @@ #' @examples #' sim <- lun2Simulate() #' @export -#' @importFrom methods new -#' @importFrom scater newSCESet set_exprs<- +#' @importFrom SummarizedExperiment assays<- +#' @importFrom SingleCellExperiment SingleCellExperiment lun2Simulate <- function(params = newLun2Params(), zinb = FALSE, verbose = TRUE, ...) { @@ -167,7 +167,7 @@ lun2Simulate <- function(params = newLun2Params(), zinb = FALSE, counts[is.zero] <- 0 } - if (verbose) {message("Creating final SCESet...")} + if (verbose) {message("Creating final dataset...")} rownames(cells) <- cell.names rownames(features) <- gene.names diff --git a/R/scDD-estimate.R b/R/scDD-estimate.R index f1aba9c..5f52157 100644 --- a/R/scDD-estimate.R +++ b/R/scDD-estimate.R @@ -2,8 +2,8 @@ #' #' Estimate simulation parameters for the scDD simulation from a real dataset. #' -#' @param counts either a counts matrix or an SCESet object containing count -#' data to estimate parameters from. +#' @param counts either a counts matrix or a SingleCellExperiment object +#' containing count data to estimate parameters from. #' @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. @@ -36,9 +36,11 @@ scDDEstimate <- function(counts, conditions, params = newSCDDParams(), #' @rdname scDDEstimate #' @export -scDDEstimate.SCESet <- function(counts, conditions, params = newSCDDParams(), - verbose = TRUE, BPPARAM = SerialParam()) { - counts <- scater::counts(counts) +scDDEstimate.SingleCellExperiment <- function(counts, conditions, + params = newSCDDParams(), + verbose = TRUE, + BPPARAM = SerialParam()) { + counts <- SingleCellExperiment::counts(counts) scDDEstimate(counts, conditions, params, verbose, BPPARAM) } diff --git a/R/scDD-simulate.R b/R/scDD-simulate.R index b3d9498..704e14a 100644 --- a/R/scDD-simulate.R +++ b/R/scDD-simulate.R @@ -16,10 +16,11 @@ #' @details #' This function is just a wrapper around \code{\link[scDD]{simulateSet}} that #' takes a \code{\link{SCDDParams}}, runs the simulation then converts the -#' output to an \code{\link[scater]{SCESet}} object. See -#' \code{\link[scDD]{simulateSet}} for more details of how the simulation works. +#' output to a \code{\link[SingleCellExperiment]{SingleCellExperiment}} object. +#' See \code{\link[scDD]{simulateSet}} for more details about how the simulation +#' works. #' -#' @return SCESet containing simulated counts +#' @return SingleCellExperiment containing simulated counts #' #' @references #' Korthauer KD, Chu L-F, Newton MA, Li Y, Thomson J, Stewart R, et al. A @@ -35,8 +36,8 @@ #' sim <- scDDSimulate() #' } #' @export -#' @importFrom scater newSCESet #' @importFrom BiocParallel SerialParam +#' @importFrom SingleCellExperiment SingleCellExperiment scDDSimulate <- function(params = newSCDDParams(), plots = FALSE, plot.file = NULL, verbose = TRUE, BPPARAM = SerialParam(), ...) { @@ -94,7 +95,7 @@ scDDSimulate <- function(params = newSCDDParams(), plots = FALSE, foldchanges <- scDD.sim[[2]] de.status <- rownames(counts) - if (verbose) {message("Creating SCESet...")} + if (verbose) {message("Creating final dataset...")} cell.names <- paste0("Cell", seq_len(nCells * 2)) gene.names <- paste0("Gene", seq_len(getParam(params, "nGenes"))) diff --git a/R/simple-estimate.R b/R/simple-estimate.R index 1225bec..793be3c 100644 --- a/R/simple-estimate.R +++ b/R/simple-estimate.R @@ -2,8 +2,8 @@ #' #' Estimate simulation parameters for the simple simulation from a real dataset. #' -#' @param counts either a counts matrix or an SCESet object containing count -#' data to estimate parameters from. +#' @param counts either a counts matrix or a SingleCellExperiment object +#' containing count data to estimate parameters from. #' @param params SimpleParams object to store estimated values in. #' #' @details @@ -26,8 +26,9 @@ simpleEstimate <- function(counts, params = newSimpleParams()) { #' @rdname simpleEstimate #' @export -simpleEstimate.SCESet <- function(counts, params = newSimpleParams()) { - counts <- scater::counts(counts) +simpleEstimate.SingleCellExperiment <- function(counts, + params = newSimpleParams()) { + counts <- SingleCellExperiment::counts(counts) simpleEstimate(counts, params) } @@ -53,4 +54,4 @@ simpleEstimate.matrix <- function(counts, params = newSimpleParams()) { mean.rate = unname(means.fit$estimate["rate"])) return(params) -} \ No newline at end of file +} diff --git a/R/simple-simulate.R b/R/simple-simulate.R index add6825..3c074ce 100644 --- a/R/simple-simulate.R +++ b/R/simple-simulate.R @@ -15,14 +15,14 @@ #' \code{size = 1 / counts.disp}. See \code{\link{SimpleParams}} for more #' details of the parameters. #' -#' @return SCESet containing simulated counts +#' @return SingleCellExperiment containing simulated counts #' @examples #' sim <- simpleSimulate() #' # Override default parameters #' sim <- simpleSimulate(nGenes = 1000, nCells = 50) #' @export #' @importFrom stats rgamma rnbinom -#' @importFrom scater newSCESet +#' @importFrom SingleCellExperiment SingleCellExperiment simpleSimulate <- function(params = newSimpleParams(), verbose = TRUE, ...) { checkmate::assertClass(params, "SimpleParams") @@ -47,7 +47,7 @@ simpleSimulate <- function(params = newSimpleParams(), verbose = TRUE, ...) { size = 1 / count.disp), nrow = nGenes, ncol = nCells) - if (verbose) {message("Creating final SCESet...")} + if (verbose) {message("Creating final dataset...")} cell.names <- paste0("Cell", seq_len(nCells)) gene.names <- paste0("Gene", seq_len(nGenes)) diff --git a/R/splat-estimate.R b/R/splat-estimate.R index 0c2b036..b1523f2 100644 --- a/R/splat-estimate.R +++ b/R/splat-estimate.R @@ -4,8 +4,8 @@ #' dataset. See the individual estimation functions for more details on how this #' is done. #' -#' @param counts either a counts matrix or an SCESet object containing count -#' data to estimate parameters from. +#' @param counts either a counts matrix or a SingleCellExperiment object +#' containing count data to estimate parameters from. #' @param params SplatParams object to store estimated values in. #' #' @seealso @@ -26,8 +26,9 @@ splatEstimate <- function(counts, params = newSplatParams()) { #' @rdname splatEstimate #' @export -splatEstimate.SCESet <- function(counts, params = newSplatParams()) { - counts <- scater::counts(counts) +splatEstimate.SingleCellExperiment <- function(counts, + params = newSplatParams()) { + counts <- SingleCellExperiment::counts(counts) splatEstimate(counts, params) } diff --git a/R/splat-simulate.R b/R/splat-simulate.R index 7967e70..38bbf7d 100644 --- a/R/splat-simulate.R +++ b/R/splat-simulate.R @@ -31,15 +31,16 @@ #' \item Simulate BCV adjusted cell means #' \item Simulate true counts #' \item Simulate dropout -#' \item Create final SCESet object +#' \item Create final dataset #' } #' -#' The final output is an \code{\link[scater]{SCESet}} object that contains the -#' simulated counts but also the values for various intermediate steps. These -#' are stored in the \code{\link[Biobase]{phenoData}} (for cell specific -#' information), \code{\link[Biobase]{featureData}} (for gene specific -#' information) or \code{\link[Biobase]{assayData}} (for gene by cell matrices) -#' slots. This additional information includes: +#' The final output is a +#' \code{\link[SingleCellExperiment]{SingleCellExperiment}} object that +#' contains the simulated counts but also the values for various intermediate +#' steps. These are stored in the \code{\link[SummarizedExperiment]{colData}} +#' (for cell specific information), \code{\link[SummarizedExperiment]{rowData}} +#' (for gene specific information) or \code{\link[SummarizedExperiment]{assays}} +#' (for gene by cell matrices) slots. This additional information includes: #' \describe{ #' \item{\code{phenoData}}{ #' \describe{ @@ -83,12 +84,12 @@ #' } #' } #' -#' Values that have been added by Splatter are named using \code{CamelCase} in -#' order to differentiate them from the values added by Scater which uses -#' \code{underscore_naming}. +#' Values that have been added by Splatter are named using \code{UpperCamelCase} +#' in order to differentiate them from the values added by analysis packages +#' which typically use \code{underscore_naming}. #' -#' @return SCESet object containing the simulated counts and intermediate -#' values. +#' @return SingleCellExperiment object containing the simulated counts and +#' intermediate values. #' #' @seealso #' \code{\link{splatSimLibSizes}}, \code{\link{splatSimGeneMeans}}, @@ -113,9 +114,9 @@ #' # Simulate paths #' sim <- splatSimulate(method = "paths") #' } -#' @importFrom Biobase fData pData pData<- assayData +#' @importFrom SummarizedExperiment rowData colData colData<- assays +#' @importFrom SingleCellExperiment SingleCellExperiment #' @importFrom methods validObject -#' @importFrom scater newSCESet counts set_exprs<- get_exprs #' @export splatSimulate <- function(params = newSplatParams(), method = c("single", "groups", "paths"), @@ -158,7 +159,7 @@ splatSimulate <- function(params = newSplatParams(), group.names <- paste0("Path", seq_len(nGroups)) } - # Create SCESet with dummy counts to store simulation + # Create SingleCellExperiment to store simulation cells <- data.frame(Cell = cell.names) rownames(cells) <- cell.names features <- data.frame(Gene = gene.names) @@ -242,12 +243,12 @@ splatSimulatePaths <- function(params = newSplatParams(), verbose = TRUE, ...) { #' #' Simulate expected library sizes from a log-normal distribution #' -#' @param sim SCESet to add library size to. +#' @param sim SingleCellExperiment to add library size to. #' @param params SplatParams object with simulation parameters. #' -#' @return SCESet with simulated library sizes. +#' @return SingleCellExperiment with simulated library sizes. #' -#' @importFrom Biobase pData pData<- +#' @importFrom SummarizedExperiment colData colData<- #' @importFrom stats rlnorm splatSimLibSizes <- function(sim, params) { @@ -267,12 +268,12 @@ splatSimLibSizes <- function(sim, params) { #' expression factors. Genes with an outlier factor not equal to 1 are replaced #' with the median mean expression multiplied by the outlier factor. #' -#' @param sim SCESet to add gene means to. +#' @param sim SingleCellExperiment to add gene means to. #' @param params SplatParams object with simulation parameters. #' -#' @return SCESet with simulated gene means. +#' @return SingleCellExperiment with simulated gene means. #' -#' @importFrom Biobase fData fData<- +#' @importFrom SummarizedExperiment rowData rowData<- #' @importFrom stats rgamma median splatSimGeneMeans <- function(sim, params) { @@ -308,12 +309,12 @@ splatSimGeneMeans <- function(sim, params) { #' using \code{\link{getLNormFactors}} and these are added along with updated #' means for each batch. #' -#' @param sim SCESet to add batch effects to. +#' @param sim SingleCellExperiment to add batch effects to. #' @param params SplatParams object with simulation parameters. #' -#' @return SCESet with simulated batch effects. +#' @return SingleCellExperiment with simulated batch effects. #' -#' @importFrom Biobase fData fData<- +#' @importFrom SummarizedExperiment rowData rowData<- splatSimBatchEffects <- function(sim, params) { nGenes <- getParam(params, "nGenes") @@ -337,12 +338,12 @@ splatSimBatchEffects <- function(sim, params) { #' Simulate a mean for each gene in each cell incorporating batch effect #' factors. #' -#' @param sim SCESet to add batch means to. +#' @param sim SingleCellExperiment to add batch means to. #' @param params SplatParams object with simulation parameters. #' -#' @return SCESet with simulated batch means. +#' @return SingleCellExperiment with simulated batch means. #' -#' @importFrom Biobase fData fData<- +#' @importFrom SummarizedExperiment rowData rowData<- splatSimBatchCellMeans <- function(sim, params) { nBatches <- getParam(params, "nBatches") @@ -380,16 +381,16 @@ splatSimBatchCellMeans <- function(sim, params) { #' along with updated means for each group. For paths care is taked to make sure #' they are simulated in the correct order. #' -#' @param sim SCESet to add differential expression to. +#' @param sim SingleCellExperiment to add differential expression to. #' @param params splatParams object with simulation parameters. #' -#' @return SCESet with simulated differential expression. +#' @return SingleCellExperiment with simulated differential expression. #' #' @name splatSimDE NULL #' @rdname splatSimDE -#' @importFrom Biobase fData +#' @importFrom SummarizedExperiment rowData splatSimGroupDE <- function(sim, params) { nGenes <- getParam(params, "nGenes") @@ -411,7 +412,7 @@ splatSimGroupDE <- function(sim, params) { } #' @rdname splatSimDE -#' @importFrom Biobase fData +#' @importFrom SummarizedExperiment rowData splatSimPathDE <- function(sim, params) { nGenes <- getParam(params, "nGenes") @@ -446,17 +447,16 @@ splatSimPathDE <- function(sim, params) { #' random position on the appropriate path (when simulating paths). The selected #' means are adjusted for each cell's expected library size. #' -#' @param sim SCESet to add cell means to. +#' @param sim SingleCellExperiment to add cell means to. #' @param params SplatParams object with simulation parameters. #' -#' @return SCESet with added cell means. +#' @return SingleCellExperiment with added cell means. #' #' @name splatSimCellMeans NULL #' @rdname splatSimCellMeans -#' @importFrom Biobase fData pData -#' @importFrom scater set_exprs<- get_exprs +#' @importFrom SummarizedExperiment rowData colData assays assays<- splatSimSingleCellMeans <- function(sim, params) { nCells <- getParam(params, "nCells") @@ -477,8 +477,7 @@ splatSimSingleCellMeans <- function(sim, params) { } #' @rdname splatSimCellMeans -#' @importFrom Biobase fData pData -#' @importFrom scater get_exprs set_exprs<- +#' @importFrom SummarizedExperiment rowData colData assays assays<- splatSimGroupCellMeans <- function(sim, params) { nGroups <- getParam(params, "nGroups") @@ -503,8 +502,7 @@ splatSimGroupCellMeans <- function(sim, params) { } #' @rdname splatSimCellMeans -#' @importFrom Biobase fData pData -#' @importFrom scater set_exprs<- +#' @importFrom SummarizedExperiment rowData colData colData<- assays assays<- #' @importFrom stats rbinom splatSimPathCellMeans <- function(sim, params) { @@ -605,13 +603,12 @@ splatSimPathCellMeans <- function(sim, params) { #' mean-variance trend using Biological Coefficient of Variation taken from #' and inverse gamma distribution. #' -#' @param sim SCESet to add BCV means to. +#' @param sim SingleCellExperiment to add BCV means to. #' @param params SplatParams object with simulation parameters. #' -#' @return SCESet with simulated BCV means. +#' @return SingleCellExperiment with simulated BCV means. #' -#' @importFrom Biobase fData pData -#' @importFrom scater get_exprs set_exprs<- +#' @importFrom SummarizedExperiment rowData colData assays assays<- #' @importFrom stats rchisq rgamma splatSimBCVMeans <- function(sim, params) { @@ -650,13 +647,12 @@ splatSimBCVMeans <- function(sim, params) { #' distribution where Each gene in each cell has it's own mean based on the #' group (or path position), expected library size and BCV. #' -#' @param sim SCESet to add true counts to. +#' @param sim SingleCellExperiment to add true counts to. #' @param params SplatParams object with simulation parameters. #' -#' @return SCESet with simulated true counts. +#' @return SingleCellExperiment with simulated true counts. #' -#' @importFrom Biobase fData pData -#' @importFrom scater get_exprs set_exprs<- +#' @importFrom SummarizedExperiment rowData colData assays assays<- #' @importFrom stats rpois splatSimTrueCounts <- function(sim, params) { @@ -684,13 +680,12 @@ splatSimTrueCounts <- function(sim, params) { #' gene in each cell. These probabilities are used in a Bernoulli distribution #' to decide which counts should be dropped. #' -#' @param sim SCESet to add dropout to. +#' @param sim SingleCellExperiment to add dropout to. #' @param params SplatParams object with simulation parameters. #' -#' @return SCESet with simulated dropout and observed counts. +#' @return SingleCellExperiment with simulated dropout and observed counts. #' -#' @importFrom Biobase fData pData -#' @importFrom scater get_exprs set_exprs<- +#' @importFrom SummarizedExperiment rowData colData assays assays<- #' @importFrom stats rbinom splatSimDropout <- function(sim, params) { diff --git a/man/lun2Estimate.Rd b/man/lun2Estimate.Rd index 3696347..d0e240e 100644 --- a/man/lun2Estimate.Rd +++ b/man/lun2Estimate.Rd @@ -2,22 +2,23 @@ % Please edit documentation in R/lun2-estimate.R \name{lun2Estimate} \alias{lun2Estimate} -\alias{lun2Estimate.SCESet} +\alias{lun2Estimate.SingleCellExperiment} \alias{lun2Estimate.matrix} \title{Estimate Lun2 simulation parameters} \usage{ lun2Estimate(counts, plates, params = newLun2Params(), min.size = 200, verbose = TRUE, BPPARAM = SerialParam()) -\method{lun2Estimate}{SCESet}(counts, plates, params = newLun2Params(), - min.size = 200, verbose = TRUE, BPPARAM = SerialParam()) +\method{lun2Estimate}{SingleCellExperiment}(counts, plates, + params = newLun2Params(), min.size = 200, verbose = TRUE, + BPPARAM = SerialParam()) \method{lun2Estimate}{matrix}(counts, plates, params = newLun2Params(), min.size = 200, verbose = TRUE, BPPARAM = SerialParam()) } \arguments{ -\item{counts}{either a counts matrix or an SCESet object containing count -data to estimate parameters from.} +\item{counts}{either a counts matrix or a SingleCellExperiment object +containing count data to estimate parameters from.} \item{plates}{integer vector giving the plate that each cell originated from.} diff --git a/man/lun2Simulate.Rd b/man/lun2Simulate.Rd index 491ba67..e091ce9 100644 --- a/man/lun2Simulate.Rd +++ b/man/lun2Simulate.Rd @@ -17,7 +17,7 @@ lun2Simulate(params = newLun2Params(), zinb = FALSE, verbose = TRUE, ...) \code{params}.} } \value{ -SCESet containing simulated counts. +SingleCellExperiment containing simulated counts. } \description{ Simulate single-cell RNA-seq count data using the method described in Lun diff --git a/man/lunEstimate.Rd b/man/lunEstimate.Rd index 8ee55be..82f5e67 100644 --- a/man/lunEstimate.Rd +++ b/man/lunEstimate.Rd @@ -2,19 +2,19 @@ % Please edit documentation in R/lun-estimate.R \name{lunEstimate} \alias{lunEstimate} -\alias{lunEstimate.SCESet} +\alias{lunEstimate.SingleCellExperiment} \alias{lunEstimate.matrix} \title{Estimate Lun simulation parameters} \usage{ lunEstimate(counts, params = newLunParams()) -\method{lunEstimate}{SCESet}(counts, params = newLunParams()) +\method{lunEstimate}{SingleCellExperiment}(counts, params = newLunParams()) \method{lunEstimate}{matrix}(counts, params = newLunParams()) } \arguments{ -\item{counts}{either a counts matrix or an SCESet object containing count -data to estimate parameters from.} +\item{counts}{either a counts matrix or an SingleCellExperiment object +containing count data to estimate parameters from.} \item{params}{LunParams object to store estimated values in.} } diff --git a/man/lunSimulate.Rd b/man/lunSimulate.Rd index 4ccd94a..0e48781 100644 --- a/man/lunSimulate.Rd +++ b/man/lunSimulate.Rd @@ -15,8 +15,8 @@ lunSimulate(params = newLunParams(), verbose = TRUE, ...) \code{params}.} } \value{ -SCESet object containing the simulated counts and intermediate -values. +SingleCellExperiment object containing the simulated counts and +intermediate values. } \description{ Simulate single-cell RNA-seq count data using the method described in Lun, diff --git a/man/scDDEstimate.Rd b/man/scDDEstimate.Rd index 44bd401..6eb052e 100644 --- a/man/scDDEstimate.Rd +++ b/man/scDDEstimate.Rd @@ -2,22 +2,22 @@ % Please edit documentation in R/scDD-estimate.R \name{scDDEstimate} \alias{scDDEstimate} -\alias{scDDEstimate.SCESet} +\alias{scDDEstimate.SingleCellExperiment} \alias{scDDEstimate.matrix} \title{Estimate scDD simulation parameters} \usage{ scDDEstimate(counts, conditions, params = newSCDDParams(), verbose = TRUE, BPPARAM = SerialParam()) -\method{scDDEstimate}{SCESet}(counts, conditions, params = newSCDDParams(), - verbose = TRUE, BPPARAM = SerialParam()) +\method{scDDEstimate}{SingleCellExperiment}(counts, conditions, + params = newSCDDParams(), verbose = TRUE, BPPARAM = SerialParam()) \method{scDDEstimate}{matrix}(counts, conditions, params = newSCDDParams(), verbose = TRUE, BPPARAM = SerialParam()) } \arguments{ -\item{counts}{either a counts matrix or an SCESet object containing count -data to estimate parameters from.} +\item{counts}{either a counts matrix or a SingleCellExperiment object +containing count data to estimate parameters from.} \item{conditions}{Vector giving the condition that each cell belongs to. Conditions can be 1 or 2.} diff --git a/man/scDDSimulate.Rd b/man/scDDSimulate.Rd index 387413b..24f4c5a 100644 --- a/man/scDDSimulate.Rd +++ b/man/scDDSimulate.Rd @@ -25,7 +25,7 @@ giving the parallel back-end to be used. Default is \code{params}.} } \value{ -SCESet containing simulated counts +SingleCellExperiment containing simulated counts } \description{ Simulate counts using the scDD method. @@ -33,8 +33,9 @@ Simulate counts using the scDD method. \details{ This function is just a wrapper around \code{\link[scDD]{simulateSet}} that takes a \code{\link{SCDDParams}}, runs the simulation then converts the -output to an \code{\link[scater]{SCESet}} object. See -\code{\link[scDD]{simulateSet}} for more details of how the simulation works. +output to a \code{\link[SingleCellExperiment]{SingleCellExperiment}} object. +See \code{\link[scDD]{simulateSet}} for more details about how the simulation +works. } \examples{ \dontrun{ diff --git a/man/simpleEstimate.Rd b/man/simpleEstimate.Rd index 3be8654..159c879 100644 --- a/man/simpleEstimate.Rd +++ b/man/simpleEstimate.Rd @@ -2,19 +2,20 @@ % Please edit documentation in R/simple-estimate.R \name{simpleEstimate} \alias{simpleEstimate} -\alias{simpleEstimate.SCESet} +\alias{simpleEstimate.SingleCellExperiment} \alias{simpleEstimate.matrix} \title{Estimate simple simulation parameters} \usage{ simpleEstimate(counts, params = newSimpleParams()) -\method{simpleEstimate}{SCESet}(counts, params = newSimpleParams()) +\method{simpleEstimate}{SingleCellExperiment}(counts, + params = newSimpleParams()) \method{simpleEstimate}{matrix}(counts, params = newSimpleParams()) } \arguments{ -\item{counts}{either a counts matrix or an SCESet object containing count -data to estimate parameters from.} +\item{counts}{either a counts matrix or a SingleCellExperiment object +containing count data to estimate parameters from.} \item{params}{SimpleParams object to store estimated values in.} } diff --git a/man/simpleSimulate.Rd b/man/simpleSimulate.Rd index b2f5fda..e52be18 100644 --- a/man/simpleSimulate.Rd +++ b/man/simpleSimulate.Rd @@ -15,7 +15,7 @@ simpleSimulate(params = newSimpleParams(), verbose = TRUE, ...) \code{params}.} } \value{ -SCESet containing simulated counts +SingleCellExperiment containing simulated counts } \description{ Simulate counts from a simple negative binomial distribution without diff --git a/man/splatEstimate.Rd b/man/splatEstimate.Rd index f698fd9..b14d519 100644 --- a/man/splatEstimate.Rd +++ b/man/splatEstimate.Rd @@ -2,19 +2,20 @@ % Please edit documentation in R/splat-estimate.R \name{splatEstimate} \alias{splatEstimate} -\alias{splatEstimate.SCESet} +\alias{splatEstimate.SingleCellExperiment} \alias{splatEstimate.matrix} \title{Estimate Splat simulation parameters} \usage{ splatEstimate(counts, params = newSplatParams()) -\method{splatEstimate}{SCESet}(counts, params = newSplatParams()) +\method{splatEstimate}{SingleCellExperiment}(counts, + params = newSplatParams()) \method{splatEstimate}{matrix}(counts, params = newSplatParams()) } \arguments{ -\item{counts}{either a counts matrix or an SCESet object containing count -data to estimate parameters from.} +\item{counts}{either a counts matrix or a SingleCellExperiment object +containing count data to estimate parameters from.} \item{params}{SplatParams object to store estimated values in.} } diff --git a/man/splatSimBCVMeans.Rd b/man/splatSimBCVMeans.Rd index 315b5ae..9ffc622 100644 --- a/man/splatSimBCVMeans.Rd +++ b/man/splatSimBCVMeans.Rd @@ -7,12 +7,12 @@ splatSimBCVMeans(sim, params) } \arguments{ -\item{sim}{SCESet to add BCV means to.} +\item{sim}{SingleCellExperiment to add BCV means to.} \item{params}{SplatParams object with simulation parameters.} } \value{ -SCESet with simulated BCV means. +SingleCellExperiment with simulated BCV means. } \description{ Simulate means for each gene in each cell that are adjusted to follow a diff --git a/man/splatSimBatchCellMeans.Rd b/man/splatSimBatchCellMeans.Rd index edd0736..e0d7869 100644 --- a/man/splatSimBatchCellMeans.Rd +++ b/man/splatSimBatchCellMeans.Rd @@ -7,12 +7,12 @@ splatSimBatchCellMeans(sim, params) } \arguments{ -\item{sim}{SCESet to add batch means to.} +\item{sim}{SingleCellExperiment to add batch means to.} \item{params}{SplatParams object with simulation parameters.} } \value{ -SCESet with simulated batch means. +SingleCellExperiment with simulated batch means. } \description{ Simulate a mean for each gene in each cell incorporating batch effect diff --git a/man/splatSimBatchEffects.Rd b/man/splatSimBatchEffects.Rd index 76c4304..c047ab4 100644 --- a/man/splatSimBatchEffects.Rd +++ b/man/splatSimBatchEffects.Rd @@ -7,12 +7,12 @@ splatSimBatchEffects(sim, params) } \arguments{ -\item{sim}{SCESet to add batch effects to.} +\item{sim}{SingleCellExperiment to add batch effects to.} \item{params}{SplatParams object with simulation parameters.} } \value{ -SCESet with simulated batch effects. +SingleCellExperiment with simulated batch effects. } \description{ Simulate batch effects. Batch effect factors for each batch are produced diff --git a/man/splatSimCellMeans.Rd b/man/splatSimCellMeans.Rd index 436fd6f..de5222b 100644 --- a/man/splatSimCellMeans.Rd +++ b/man/splatSimCellMeans.Rd @@ -14,12 +14,12 @@ splatSimGroupCellMeans(sim, params) splatSimPathCellMeans(sim, params) } \arguments{ -\item{sim}{SCESet to add cell means to.} +\item{sim}{SingleCellExperiment to add cell means to.} \item{params}{SplatParams object with simulation parameters.} } \value{ -SCESet with added cell means. +SingleCellExperiment with added cell means. } \description{ Simulate a gene by cell matrix giving the mean expression for each gene in diff --git a/man/splatSimDE.Rd b/man/splatSimDE.Rd index 85f7680..257fb1c 100644 --- a/man/splatSimDE.Rd +++ b/man/splatSimDE.Rd @@ -11,12 +11,12 @@ splatSimGroupDE(sim, params) splatSimPathDE(sim, params) } \arguments{ -\item{sim}{SCESet to add differential expression to.} +\item{sim}{SingleCellExperiment to add differential expression to.} \item{params}{splatParams object with simulation parameters.} } \value{ -SCESet with simulated differential expression. +SingleCellExperiment with simulated differential expression. } \description{ Simulate differential expression. Differential expression factors for each diff --git a/man/splatSimDropout.Rd b/man/splatSimDropout.Rd index 166336c..7f68ba3 100644 --- a/man/splatSimDropout.Rd +++ b/man/splatSimDropout.Rd @@ -7,12 +7,12 @@ splatSimDropout(sim, params) } \arguments{ -\item{sim}{SCESet to add dropout to.} +\item{sim}{SingleCellExperiment to add dropout to.} \item{params}{SplatParams object with simulation parameters.} } \value{ -SCESet with simulated dropout and observed counts. +SingleCellExperiment with simulated dropout and observed counts. } \description{ A logistic function is used to form a relationshop between the expression diff --git a/man/splatSimGeneMeans.Rd b/man/splatSimGeneMeans.Rd index 7d738db..4a13269 100644 --- a/man/splatSimGeneMeans.Rd +++ b/man/splatSimGeneMeans.Rd @@ -7,12 +7,12 @@ splatSimGeneMeans(sim, params) } \arguments{ -\item{sim}{SCESet to add gene means to.} +\item{sim}{SingleCellExperiment to add gene means to.} \item{params}{SplatParams object with simulation parameters.} } \value{ -SCESet with simulated gene means. +SingleCellExperiment with simulated gene means. } \description{ Simulate gene means from a gamma distribution. Also simulates outlier diff --git a/man/splatSimLibSizes.Rd b/man/splatSimLibSizes.Rd index 4785021..3c5c380 100644 --- a/man/splatSimLibSizes.Rd +++ b/man/splatSimLibSizes.Rd @@ -7,12 +7,12 @@ splatSimLibSizes(sim, params) } \arguments{ -\item{sim}{SCESet to add library size to.} +\item{sim}{SingleCellExperiment to add library size to.} \item{params}{SplatParams object with simulation parameters.} } \value{ -SCESet with simulated library sizes. +SingleCellExperiment with simulated library sizes. } \description{ Simulate expected library sizes from a log-normal distribution diff --git a/man/splatSimTrueCounts.Rd b/man/splatSimTrueCounts.Rd index 4fc2464..cb2ba30 100644 --- a/man/splatSimTrueCounts.Rd +++ b/man/splatSimTrueCounts.Rd @@ -7,12 +7,12 @@ splatSimTrueCounts(sim, params) } \arguments{ -\item{sim}{SCESet to add true counts to.} +\item{sim}{SingleCellExperiment to add true counts to.} \item{params}{SplatParams object with simulation parameters.} } \value{ -SCESet with simulated true counts. +SingleCellExperiment with simulated true counts. } \description{ Simulate a true counts matrix. Counts are simulated from a poisson diff --git a/man/splatSimulate.Rd b/man/splatSimulate.Rd index d827f16..0db1f72 100644 --- a/man/splatSimulate.Rd +++ b/man/splatSimulate.Rd @@ -31,8 +31,8 @@ trajectories (eg. differentiation processes).} \code{params}.} } \value{ -SCESet object containing the simulated counts and intermediate -values. +SingleCellExperiment object containing the simulated counts and +intermediate values. } \description{ Simulate count data from a fictional single-cell RNA-seq experiment using @@ -56,15 +56,16 @@ The simulation involves the following steps: \item Simulate BCV adjusted cell means \item Simulate true counts \item Simulate dropout - \item Create final SCESet object + \item Create final dataset } -The final output is an \code{\link[scater]{SCESet}} object that contains the -simulated counts but also the values for various intermediate steps. These -are stored in the \code{\link[Biobase]{phenoData}} (for cell specific -information), \code{\link[Biobase]{featureData}} (for gene specific -information) or \code{\link[Biobase]{assayData}} (for gene by cell matrices) -slots. This additional information includes: +The final output is a +\code{\link[SingleCellExperiment]{SingleCellExperiment}} object that +contains the simulated counts but also the values for various intermediate +steps. These are stored in the \code{\link[SummarizedExperiment]{colData}} +(for cell specific information), \code{\link[SummarizedExperiment]{rowData}} +(for gene specific information) or \code{\link[SummarizedExperiment]{assays}} +(for gene by cell matrices) slots. This additional information includes: \describe{ \item{\code{phenoData}}{ \describe{ @@ -108,9 +109,9 @@ slots. This additional information includes: } } -Values that have been added by Splatter are named using \code{CamelCase} in -order to differentiate them from the values added by Scater which uses -\code{underscore_naming}. +Values that have been added by Splatter are named using \code{UpperCamelCase} +in order to differentiate them from the values added by analysis packages +which typically use \code{underscore_naming}. } \examples{ # Simulation with default parameters -- GitLab