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

Rename splat sub functions to differentiate

The splat sub function names were in the same format as the simulation names.
Changed to make it obvious they are different.
parent 7a4b16af
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: 0.4.1 Version: 0.4.2
Date: 2016-10-12 Date: 2016-10-12
Author: Luke Zappia Author: Luke Zappia
Authors@R: as.person(c( Authors@R: as.person(c(
......
...@@ -92,6 +92,14 @@ ...@@ -92,6 +92,14 @@
#' \code{underscore_naming}. #' \code{underscore_naming}.
#' #'
#' @return SCESet object containing the simulated counts and intermediate values #' @return SCESet object containing the simulated counts and intermediate values
#'
#' @seealso
#' \code{\link{addLibSizes}}, \code{\link{addGeneMeans}},
#' \code{\link{addSingleCellMeans}}, \code{\link{addGroupDE}},
#' \code{\link{addGroupCellMeans}}, \code{\link{addPathDE}},
#' \code{\link{addPathCellMeans}}, \code{\link{addBCVMeans}},
#' \code{\link{addTrueCounts}}, \code{\link{addDropout}}
#'
#' @examples #' @examples
#' # Simulation with default parameters #' # Simulation with default parameters
#' sim <- splat() #' sim <- splat()
...@@ -164,28 +172,28 @@ splat <- function(params = defaultParams(), ...@@ -164,28 +172,28 @@ splat <- function(params = defaultParams(),
} }
if (verbose) {message("Simulating library sizes...")} if (verbose) {message("Simulating library sizes...")}
sim <- simLibSizes(sim, params) sim <- addLibSizes(sim, params)
if (verbose) {message("Simulating gene means...")} if (verbose) {message("Simulating gene means...")}
sim <- simGeneMeans(sim, params) sim <- addGeneMeans(sim, params)
if (method == "single") { if (method == "single") {
sim <- simSingleCellMeans(sim, params) sim <- addSingleCellMeans(sim, params)
} else if (method == "groups") { } else if (method == "groups") {
if (verbose) {message("Simulating group DE...")} if (verbose) {message("Simulating group DE...")}
sim <- simGroupDE(sim, params) sim <- addGroupDE(sim, params)
if (verbose) {message("Simulating cell means...")} if (verbose) {message("Simulating cell means...")}
sim <- simGroupCellMeans(sim, params) sim <- addGroupCellMeans(sim, params)
} else { } else {
if (verbose) {message("Simulating path endpoints...")} if (verbose) {message("Simulating path endpoints...")}
sim <- simPathDE(sim, params) sim <- addPathDE(sim, params)
if (verbose) {message("Simulating path steps...")} if (verbose) {message("Simulating path steps...")}
sim <- simPathCellMeans(sim, params) sim <- addPathCellMeans(sim, params)
} }
if (verbose) {message("Simulating BCV...")} if (verbose) {message("Simulating BCV...")}
sim <- simBCVMeans(sim, params) sim <- addBCVMeans(sim, params)
if (verbose) {message("Simulating counts..")} if (verbose) {message("Simulating counts..")}
sim <- simTrueCounts(sim, params) sim <- addTrueCounts(sim, params)
if (verbose) {message("Simulating dropout...")} if (verbose) {message("Simulating dropout...")}
sim <- simDropout(sim, params) sim <- addDropout(sim, params)
if (verbose) {message("Creating final SCESet...")} if (verbose) {message("Creating final SCESet...")}
# Create new SCESet to make sure values are calculated correctly # Create new SCESet to make sure values are calculated correctly
...@@ -236,7 +244,7 @@ splatPaths <- function(params = defaultParams(), verbose = TRUE, ...) { ...@@ -236,7 +244,7 @@ splatPaths <- function(params = defaultParams(), verbose = TRUE, ...) {
#' #'
#' @importFrom Biobase pData pData<- #' @importFrom Biobase pData pData<-
#' @importFrom stats rlnorm #' @importFrom stats rlnorm
simLibSizes <- function(sim, params) { addLibSizes <- function(sim, params) {
nCells <- getParams(params, "nCells") nCells <- getParams(params, "nCells")
lib.loc <- getParams(params, "lib.loc") lib.loc <- getParams(params, "lib.loc")
...@@ -261,7 +269,7 @@ simLibSizes <- function(sim, params) { ...@@ -261,7 +269,7 @@ simLibSizes <- function(sim, params) {
#' #'
#' @importFrom Biobase fData fData<- #' @importFrom Biobase fData fData<-
#' @importFrom stats rgamma median #' @importFrom stats rgamma median
simGeneMeans <- function(sim, params) { addGeneMeans <- function(sim, params) {
nGenes <- getParams(params, "nGenes") nGenes <- getParams(params, "nGenes")
mean.shape <- getParams(params, "mean.shape") mean.shape <- getParams(params, "mean.shape")
...@@ -302,7 +310,7 @@ simGeneMeans <- function(sim, params) { ...@@ -302,7 +310,7 @@ simGeneMeans <- function(sim, params) {
#' @return SCESet with added differential expression. #' @return SCESet with added differential expression.
#' #'
#' @importFrom Biobase fData #' @importFrom Biobase fData
simGroupDE <- function(sim, params) { addGroupDE <- function(sim, params) {
nGenes <- getParams(params, "nGenes") nGenes <- getParams(params, "nGenes")
nGroups <- getParams(params, "nGroups") nGroups <- getParams(params, "nGroups")
...@@ -326,7 +334,7 @@ simGroupDE <- function(sim, params) { ...@@ -326,7 +334,7 @@ simGroupDE <- function(sim, params) {
#' Simulate path differential expression #' Simulate path differential expression
#' #'
#' Simulate differential expression for path. Similar to #' Simulate differential expression for path. Similar to
#' \code{\link{simGroupDE}} but care has to be taken to make sure paths are #' \code{\link{addGroupDE}} but care has to be taken to make sure paths are
#' processed in the correct order. #' processed in the correct order.
#' #'
#' @param sim SCESet to add differential expression to. #' @param sim SCESet to add differential expression to.
...@@ -335,7 +343,7 @@ simGroupDE <- function(sim, params) { ...@@ -335,7 +343,7 @@ simGroupDE <- function(sim, params) {
#' @return SCESet with added differential expression. #' @return SCESet with added differential expression.
#' #'
#' @importFrom Biobase fData #' @importFrom Biobase fData
simPathDE <- function(sim, params) { addPathDE <- function(sim, params) {
nGenes <- getParams(params, "nGenes") nGenes <- getParams(params, "nGenes")
de.prob <- getParams(params, "de.prob") de.prob <- getParams(params, "de.prob")
...@@ -373,7 +381,7 @@ simPathDE <- function(sim, params) { ...@@ -373,7 +381,7 @@ simPathDE <- function(sim, params) {
#' @return SCESet with added cell means. #' @return SCESet with added cell means.
#' #'
#' @importFrom Biobase fData pData assayData assayData<- #' @importFrom Biobase fData pData assayData assayData<-
simSingleCellMeans <- function(sim, params) { addSingleCellMeans <- function(sim, params) {
nCells <- getParams(params, "nCells") nCells <- getParams(params, "nCells")
cell.names <- pData(sim)$Cell cell.names <- pData(sim)$Cell
...@@ -403,7 +411,7 @@ simSingleCellMeans <- function(sim, params) { ...@@ -403,7 +411,7 @@ simSingleCellMeans <- function(sim, params) {
#' @return SCESet with added cell means. #' @return SCESet with added cell means.
#' #'
#' @importFrom Biobase fData pData assayData assayData<- #' @importFrom Biobase fData pData assayData assayData<-
simGroupCellMeans <- function(sim, params) { addGroupCellMeans <- function(sim, params) {
nGroups <- getParams(params, "nGroups") nGroups <- getParams(params, "nGroups")
cell.names <- pData(sim)$Cell cell.names <- pData(sim)$Cell
...@@ -438,7 +446,7 @@ simGroupCellMeans <- function(sim, params) { ...@@ -438,7 +446,7 @@ simGroupCellMeans <- function(sim, params) {
#' #'
#' @importFrom Biobase fData pData assayData #' @importFrom Biobase fData pData assayData
#' @importFrom stats rbinom #' @importFrom stats rbinom
simPathCellMeans <- function(sim, params) { addPathCellMeans <- function(sim, params) {
nGenes <- getParams(params, "nGenes") nGenes <- getParams(params, "nGenes")
nGroups <- getParams(params, "nGroups") nGroups <- getParams(params, "nGroups")
...@@ -523,7 +531,7 @@ simPathCellMeans <- function(sim, params) { ...@@ -523,7 +531,7 @@ simPathCellMeans <- function(sim, params) {
#' #'
#' @importFrom Biobase fData pData assayData assayData<- #' @importFrom Biobase fData pData assayData assayData<-
#' @importFrom stats rchisq rgamma #' @importFrom stats rchisq rgamma
simBCVMeans <- function(sim, params) { addBCVMeans <- function(sim, params) {
nGenes <- getParams(params, "nGenes") nGenes <- getParams(params, "nGenes")
nCells <- getParams(params, "nCells") nCells <- getParams(params, "nCells")
...@@ -564,7 +572,7 @@ simBCVMeans <- function(sim, params) { ...@@ -564,7 +572,7 @@ simBCVMeans <- function(sim, params) {
#' #'
#' @importFrom Biobase fData pData assayData #' @importFrom Biobase fData pData assayData
#' @importFrom stats rpois #' @importFrom stats rpois
simTrueCounts <- function(sim, params) { addTrueCounts <- function(sim, params) {
nGenes <- getParams(params, "nGenes") nGenes <- getParams(params, "nGenes")
nCells <- getParams(params, "nCells") nCells <- getParams(params, "nCells")
...@@ -597,7 +605,7 @@ simTrueCounts <- function(sim, params) { ...@@ -597,7 +605,7 @@ simTrueCounts <- function(sim, params) {
#' #'
#' @importFrom Biobase fData pData assayData assayData<- #' @importFrom Biobase fData pData assayData assayData<-
#' @importFrom stats rbinom #' @importFrom stats rbinom
simDropout <- function(sim, params) { addDropout <- function(sim, params) {
dropout.present <- getParams(params, "dropout.present") dropout.present <- getParams(params, "dropout.present")
true.counts <- assayData(sim)$TrueCounts true.counts <- assayData(sim)$TrueCounts
......
% Generated by roxygen2: do not edit by hand % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/simulate-splat.R % Please edit documentation in R/simulate-splat.R
\name{simBCVMeans} \name{addBCVMeans}
\alias{simBCVMeans} \alias{addBCVMeans}
\title{Simulate BCV means} \title{Simulate BCV means}
\usage{ \usage{
simBCVMeans(sim, params) addBCVMeans(sim, params)
} }
\arguments{ \arguments{
\item{sim}{SCESet to add BCV means to.} \item{sim}{SCESet to add BCV means to.}
......
% Generated by roxygen2: do not edit by hand % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/simulate-splat.R % Please edit documentation in R/simulate-splat.R
\name{simDropout} \name{addDropout}
\alias{simDropout} \alias{addDropout}
\title{Simulate dropout} \title{Simulate dropout}
\usage{ \usage{
simDropout(sim, params) addDropout(sim, params)
} }
\arguments{ \arguments{
\item{sim}{SCESet to add dropout to.} \item{sim}{SCESet to add dropout to.}
......
% Generated by roxygen2: do not edit by hand % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/simulate-splat.R % Please edit documentation in R/simulate-splat.R
\name{simGeneMeans} \name{addGeneMeans}
\alias{simGeneMeans} \alias{addGeneMeans}
\title{Simulate gene means} \title{Simulate gene means}
\usage{ \usage{
simGeneMeans(sim, params) addGeneMeans(sim, params)
} }
\arguments{ \arguments{
\item{sim}{SCESet to add gene means to.} \item{sim}{SCESet to add gene means to.}
......
% Generated by roxygen2: do not edit by hand % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/simulate-splat.R % Please edit documentation in R/simulate-splat.R
\name{simGroupCellMeans} \name{addGroupCellMeans}
\alias{simGroupCellMeans} \alias{addGroupCellMeans}
\title{Simulate group cell means} \title{Simulate group cell means}
\usage{ \usage{
simGroupCellMeans(sim, params) addGroupCellMeans(sim, params)
} }
\arguments{ \arguments{
\item{sim}{SCESet to add cell means to.} \item{sim}{SCESet to add cell means to.}
......
% Generated by roxygen2: do not edit by hand % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/simulate-splat.R % Please edit documentation in R/simulate-splat.R
\name{simGroupDE} \name{addGroupDE}
\alias{simGroupDE} \alias{addGroupDE}
\title{Simulate group differential expression} \title{Simulate group differential expression}
\usage{ \usage{
simGroupDE(sim, params) addGroupDE(sim, params)
} }
\arguments{ \arguments{
\item{sim}{SCESet to add differential expression to.} \item{sim}{SCESet to add differential expression to.}
......
% Generated by roxygen2: do not edit by hand % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/simulate-splat.R % Please edit documentation in R/simulate-splat.R
\name{simLibSizes} \name{addLibSizes}
\alias{simLibSizes} \alias{addLibSizes}
\title{Simulate library sizes} \title{Simulate library sizes}
\usage{ \usage{
simLibSizes(sim, params) addLibSizes(sim, params)
} }
\arguments{ \arguments{
\item{sim}{SCESet to add library size to.} \item{sim}{SCESet to add library size to.}
......
% Generated by roxygen2: do not edit by hand % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/simulate-splat.R % Please edit documentation in R/simulate-splat.R
\name{simPathCellMeans} \name{addPathCellMeans}
\alias{simPathCellMeans} \alias{addPathCellMeans}
\title{Simulate path cell means} \title{Simulate path cell means}
\usage{ \usage{
simPathCellMeans(sim, params) addPathCellMeans(sim, params)
} }
\arguments{ \arguments{
\item{sim}{SCESet to add cell means to.} \item{sim}{SCESet to add cell means to.}
......
% Generated by roxygen2: do not edit by hand % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/simulate-splat.R % Please edit documentation in R/simulate-splat.R
\name{simPathDE} \name{addPathDE}
\alias{simPathDE} \alias{addPathDE}
\title{Simulate path differential expression} \title{Simulate path differential expression}
\usage{ \usage{
simPathDE(sim, params) addPathDE(sim, params)
} }
\arguments{ \arguments{
\item{sim}{SCESet to add differential expression to.} \item{sim}{SCESet to add differential expression to.}
...@@ -16,7 +16,7 @@ SCESet with added differential expression. ...@@ -16,7 +16,7 @@ SCESet with added differential expression.
} }
\description{ \description{
Simulate differential expression for path. Similar to Simulate differential expression for path. Similar to
\code{\link{simGroupDE}} but care has to be taken to make sure paths are \code{\link{addGroupDE}} but care has to be taken to make sure paths are
processed in the correct order. processed in the correct order.
} }
% Generated by roxygen2: do not edit by hand % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/simulate-splat.R % Please edit documentation in R/simulate-splat.R
\name{simSingleCellMeans} \name{addSingleCellMeans}
\alias{simSingleCellMeans} \alias{addSingleCellMeans}
\title{Simulate single population cell means} \title{Simulate single population cell means}
\usage{ \usage{
simSingleCellMeans(sim, params) addSingleCellMeans(sim, params)
} }
\arguments{ \arguments{
\item{sim}{SCESet to add cell means to.} \item{sim}{SCESet to add cell means to.}
......
% Generated by roxygen2: do not edit by hand % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/simulate-splat.R % Please edit documentation in R/simulate-splat.R
\name{simTrueCounts} \name{addTrueCounts}
\alias{simTrueCounts} \alias{addTrueCounts}
\title{Simulate true counts} \title{Simulate true counts}
\usage{ \usage{
simTrueCounts(sim, params) addTrueCounts(sim, params)
} }
\arguments{ \arguments{
\item{sim}{SCESet to add true counts to.} \item{sim}{SCESet to add true counts to.}
......
...@@ -117,4 +117,11 @@ sim <- splat(params, mean.rate = 0.6, out.prob = 0.2) ...@@ -117,4 +117,11 @@ sim <- splat(params, mean.rate = 0.6, out.prob = 0.2)
# Simulate paths instead of groups # Simulate paths instead of groups
sim <- splat(method = "paths") sim <- splat(method = "paths")
} }
\seealso{
\code{\link{addLibSizes}}, \code{\link{addGeneMeans}},
\code{\link{addSingleCellMeans}}, \code{\link{addGroupDE}},
\code{\link{addGroupCellMeans}}, \code{\link{addPathDE}},
\code{\link{addPathCellMeans}}, \code{\link{addBCVMeans}},
\code{\link{addTrueCounts}}, \code{\link{addDropout}}
}
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