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

Set up basic structure of splat function

parent 2d741c7e
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.3.1
Date: 2016-10-07
Version: 0.3.2
Date: 2016-10-09
Author: Luke Zappia
Authors@R: as.person(c(
"Luke Zappia <luke.zappia@mcri.edu.au> [aut, cre]",
......
......@@ -10,6 +10,10 @@ export(getParams)
export(mergeParams)
export(setParams)
export(splatParams)
importFrom(BioBase,fData)
importFrom(BioBase,pData)
importFrom(scater,counts)
importFrom(scater,newSCESet)
importFrom(stats,dnbinom)
importFrom(stats,median)
importFrom(stats,nls)
# setup metadata
# Means
# Groups
# Paths
# Lib size
# Base Means
# BCV
# Means
# Counts
# Dropout
# Add metadata
#
# Add length
# Median outliers
# set.seed
# group DE
#' FUNCTION TITLE
#'
#' FUNCTION DESCRIPTION
#'
#' @param params DESCRIPTION.
#' @param method DESCRIPTION.
#' @param add.assay DESCRIPTION.
#' @param verbose DESCRIPTION.
#' @param ... DESCRIPTION.
#'
#' @return RETURN DESCRIPTION
#' @examples
#' # ADD EXAMPLES HERE
#' @importFrom BioBase pData fData
#' @importFrom scater newSCESet counts
splat <- function(params = defaultParams(), method = c("groups", "paths"),
add.assay = TRUE, verbose = TRUE, ...) {
method <- match.arg(method)
params <- setParams(params, ...)
params <- mergeParams(params, defaultParams())
# Get the parameters we are going to use
n.cells <- getParams(params, "nCells")
n.genes <- getParams(params, "nGenes")
n.groups <- getParams(params, "nGroups")
group.cells <- getParams(params, "groupCells")
# Set up name vectors
cell.names <- paste0("Cell", 1:n.cells)
gene.names <- paste0("Gene", 1:n.genes)
group.names <- paste0("Group", 1:n.groups)
# Create SCESet with dummy counts to store simulation
dummy.counts <- matrix(1, ncol = n.cells, nrow = n.genes)
rownames(dummy.counts) <- gene.names
colnames(dummy.counts) <- cell.names
phenos <- new("AnnotatedDataFrame", data = data.frame(Cell = cell.names))
rownames(phenos) <- cell.names
features <- new("AnnotatedDataFrame", data = data.frame(Gene = gene.names))
rownames(features) <- gene.names
sim <- newSCESet(countData = dummy.counts, phenoData = phenos,
featureData = features)
# Make groups vector which is the index of param$groupCells repeated
# params$groupCells[index] times
groups <- lapply(1:n.groups, function(i, g) {rep(i, g[i])},
g = group.cells)
groups <- unlist(groups)
pData(sim)$Group <- group.names[groups]
# Create new SCESet to make sure values are calculated correctly
sce <- newSCESet(countData = counts(sim),
phenoData = new("AnnotatedDataFrame", data = pData(sim)),
featureData = new("AnnotatedDataFrame", data = fData(sim)))
return(sce)
}
\ No newline at end of file
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/simulate.R
\name{splat}
\alias{splat}
\title{FUNCTION TITLE}
\usage{
splat(params = defaultParams(), method = c("groups", "paths"),
add.assay = TRUE, verbose = TRUE, ...)
}
\arguments{
\item{params}{DESCRIPTION.}
\item{method}{DESCRIPTION.}
\item{add.assay}{DESCRIPTION.}
\item{verbose}{DESCRIPTION.}
\item{...}{DESCRIPTION.}
}
\value{
RETURN DESCRIPTION
}
\description{
FUNCTION DESCRIPTION
}
\examples{
# ADD EXAMPLES HERE
}
......@@ -23,6 +23,7 @@ parameters. It has the following sections and values:
\itemize{
\item nGenes - Number of genes to simulate.
\item nCells - Number of cells to simulate.
\item nGroups - Number of groups to simulate.
\item [groupCells] - Vector giving the number of cells in each simulation
group/path.
\item mean (mean parameters)
......
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