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

Document simLun

parent 8401d1e6
No related branches found
No related tags found
No related merge requests found
Package: splatter
Type: Package
Title: Simple Simulation of Single-cell RNA Sequencing Data
Version: 0.5.3
Version: 0.5.4
Date: 2016-10-12
Author: Luke Zappia
Authors@R: as.person(c(
......
......@@ -4,11 +4,13 @@ S3method(estimateParams,SCESet)
S3method(estimateParams,matrix)
S3method(print,splatParams)
export(checkParams)
export(defaultLunParams)
export(defaultParams)
export(estimateParams)
export(getParams)
export(mergeParams)
export(setParams)
export(simLun)
export(simSimple)
export(splat)
export(splatGroups)
......
......@@ -90,6 +90,9 @@
#' dataset by Splatter. This is also shown when a splatParams object is printed
#' with parameters labelled as either (estimatable) or [not estimatable].
#'
#' Some simulations (those reproduced from publications) require additional
#' parameters. These are described in the help for each simulation function.
#'
#' @return List based S3 splatParams object
#' @examples
#' params <- splatParams()
......
#' Lun simulation
#'
#' Simulate single-cell RNA-seq count data using the method described in Lun,
#' Bach and Marioni "Pooling across cells to normalize single-cell RNA
#' sequencing data with many zero counts".
#'
#' @param params splatParams object containing Lun simulation parameters.
#' @param verbose logical. Whether to print progress messages.
#' @param ... any additional parameter settings to override what is provided in
#' \code{params}.
#'
#' @details
#' The Lun simulation generates gene mean expression levels from a gamma
#' distribution with \code{shape = mean.shape} and \code{rate = mean.rate}.
#' Counts are then simulated from a negative binomial distribution with
#' \code{mu = means} and \code{size = 1 / bcv.common}. In addition each cell is
#' given a size factor (\code{2 ^ rnorm(nCells, mean = 0, sd = 0.5)}) and
#' differential expression can be simulated with fixed fold changes.
#'
#' \code{lunSim} requires the following parameters:
#' \itemize{
#' \item Common (see \code{\link{splatParams}})
#' \itemize{
#' \item nGenes
#' \item nCells
#' \item nGroups
#' \item groupCells
#' \item mean.shape
#' \item mean.rate
#' \item bcv.common
#' \item de.prob
#' \item de.downprob
#' }
#' \item Specific
#' \itemize{
#' \item [lun.upFC] - Fold change for up-regulated genes.
#' \item [lun.downFC] - Fold change for down-regulated genes.
#' }
#' }
#'
#' See \code{\link{defaultLunParams}} for example of these parameters.
#' Parameters are set in the tiered manner described in \code{\link{splat}}.
#'
#'
#'
#' @return SCESet object containing the simulated counts and intermediate values
#'
#' @references
#' Lun ATL, Bach K, Marioni JC. Pooling across cells to normalize single-cell
#' RNA sequencing data with many zero counts. Genome Biology (2016)
#'
#' Paper: \url{dx.doi.org/10.1186/s13059-016-0947-7}
#'
#' Code: \url{https://github.com/MarioniLab/Deconvolution2016}
#'
#' @examples
#' sim <- simLun()
#'
#' @importFrom Biobase fData fData<- pData pData<- assayData
#' @importFrom scater newSCESet
#' @importFrom stats rnorm rgamma rnbinom
#' @export
simLun <- function(params = defaultLunParams(), verbose = TRUE, ...) {
if (verbose) {message("Getting parameters...")}
......
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/params.R
\name{defaultLunParams}
\alias{defaultLunParams}
\title{Get default Lun simulation parameters}
\usage{
defaultLunParams()
}
\value{
A splatParams object containing default Lun parameters.
}
\description{
Get a splatParams object with a set of default parameters for the Lun
simulation.
}
\examples{
params <- defaultLunParams()
params
}
......@@ -2,7 +2,7 @@
% Please edit documentation in R/params.R
\name{expandParams}
\alias{expandParams}
\title{Expath parameters}
\title{Expand parameters}
\usage{
expandParams(params)
}
......
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/simulate-lun.R
\name{simLun}
\alias{simLun}
\title{Lun simulation}
\usage{
simLun(params = defaultLunParams(), verbose = TRUE, ...)
}
\arguments{
\item{params}{splatParams object containing Lun simulation parameters.}
\item{verbose}{logical. Whether to print progress messages.}
\item{...}{any additional parameter settings to override what is provided in
\code{params}.}
}
\value{
SCESet object containing the simulated counts and intermediate values
}
\description{
Simulate single-cell RNA-seq count data using the method described in Lun,
Bach and Marioni "Pooling across cells to normalize single-cell RNA
sequencing data with many zero counts".
}
\details{
The Lun simulation generates gene mean expression levels from a gamma
distribution with \code{shape = mean.shape} and \code{rate = mean.rate}.
Counts are then simulated from a negative binomial distribution with
\code{mu = means} and \code{size = 1 / bcv.common}. In addition each cell is
given a size factor (\code{2 ^ rnorm(nCells, mean = 0, sd = 0.5)}) and
differential expression can be simulated with fixed fold changes.
\code{lunSim} requires the following parameters:
\itemize{
\item Common (see \code{\link{splatParams}})
\itemize{
\item nGenes
\item nCells
\item nGroups
\item groupCells
\item mean.shape
\item mean.rate
\item bcv.common
\item de.prob
\item de.downprob
}
\item Specific
\itemize{
\item [lun.upFC] - Fold change for up-regulated genes.
\item [lun.downFC] - Fold change for down-regulated genes.
}
}
See \code{\link{defaultLunParams}} for example of these parameters.
Parameters are set in the tiered manner described in \code{\link{splat}}.
}
\examples{
sim <- simLun()
}
\references{
Lun ATL, Bach K, Marioni JC. Pooling across cells to normalize single-cell
RNA sequencing data with many zero counts. Genome Biology (2016)
Paper: \url{dx.doi.org/10.1186/s13059-016-0947-7}
Code: \url{https://github.com/MarioniLab/Deconvolution2016}
}
......@@ -100,6 +100,9 @@ parameters. It has the following sections and values:
Those shown in brackets cannot currently be easily estimated from a real
dataset by Splatter. This is also shown when a splatParams object is printed
with parameters labelled as either (estimatable) or [not estimatable].
Some simulations (those reproduced from publications) require additional
parameters. These are described in the help for each simulation function.
}
\examples{
params <- splatParams()
......
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