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

Run checks

parent ae2d4a38
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.6.3 Version: 0.6.4
Date: 2016-10-13 Date: 2016-10-13
Author: Luke Zappia Author: Luke Zappia
Authors@R: as.person(c( Authors@R: as.person(c(
...@@ -25,7 +25,8 @@ Imports: ...@@ -25,7 +25,8 @@ Imports:
locfit, locfit,
akima, akima,
Biobase, Biobase,
checkmate checkmate,
methods
Suggests: Suggests:
testthat testthat
biocViews: SingleCell, RNASeq, Transcriptomics, GeneExpression, Sequencing, biocViews: SingleCell, RNASeq, Transcriptomics, GeneExpression, Sequencing,
......
...@@ -10,6 +10,7 @@ export(setParam) ...@@ -10,6 +10,7 @@ export(setParam)
export(setParams) export(setParams)
export(simpleSimulate) export(simpleSimulate)
exportClasses(SimpleParams) exportClasses(SimpleParams)
importFrom(scater,newSCESet)
importFrom(stats,median) importFrom(stats,median)
importFrom(stats,rgamma) importFrom(stats,rgamma)
importFrom(stats,rnbinom) importFrom(stats,rnbinom)
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
#' #'
#' @return List with the values of the selected parameters. #' @return List with the values of the selected parameters.
#' @examples #' @examples
#' params <- simpleParams() #' params <- newSimpleParams()
#' getParams(params, c("nGenes", "nCells", "mean.rate")) #' getParams(params, c("nGenes", "nCells", "mean.rate"))
#' @export #' @export
getParams <- function(params, names) { getParams <- function(params, names) {
...@@ -37,7 +37,7 @@ getParams <- function(params, names) { ...@@ -37,7 +37,7 @@ getParams <- function(params, names) {
#' #'
#' @return Params object with updated values. #' @return Params object with updated values.
#' @examples #' @examples
#' params <- simpleParams() #' params <- newSimpleParams()
#' params #' params
#' # Set individually #' # Set individually
#' params <- setParams(params, nGenes = 1000, nCells = 50) #' params <- setParams(params, nGenes = 1000, nCells = 50)
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
#' #'
#' Estimate simulation parameters for the simple simulation from a real dataset. #' Estimate simulation parameters for the simple simulation from a real dataset.
#' #'
#' @param x either a counts matrix or an SCESet object containing count data to #' @param data either a counts matrix or an SCESet object containing count data
#' estimate parameters from. #' to estimate parameters from.
#' @param params SimpleParams object to store estimated values in. #' @param params SimpleParams object to store estimated values in.
#' #'
#' @details #' @details
...@@ -24,14 +24,14 @@ estimateSimpleParams <- function(data, params = newSimpleParams()) { ...@@ -24,14 +24,14 @@ estimateSimpleParams <- function(data, params = newSimpleParams()) {
UseMethod("estimateSimpleParams") UseMethod("estimateSimpleParams")
} }
#' @rdname simpleEstimate #' @rdname estimateSimpleParams
#' @export #' @export
estimateSimpleParams.SCESet <- function(data, params = newSimpleParams()) { estimateSimpleParams.SCESet <- function(data, params = newSimpleParams()) {
counts <- scater::counts(x) counts <- scater::counts(data)
estimateSimpleParams(counts, params) estimateSimpleParams(counts, params)
} }
#' @rdname simpleEstimate #' @rdname estimateSimpleParams
#' @importFrom stats median #' @importFrom stats median
#' @export #' @export
estimateSimpleParams.matrix <- function(data, params = newSimpleParams()) { estimateSimpleParams.matrix <- function(data, params = newSimpleParams()) {
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#' sim <- simpleSimulate(nGenes = 1000, nCells = 50) #' sim <- simpleSimulate(nGenes = 1000, nCells = 50)
#' @export #' @export
#' @importFrom stats rgamma rnbinom #' @importFrom stats rgamma rnbinom
#' @importFrom scater newSCESet
simpleSimulate <- function(params = newSimpleParams(), verbose = TRUE, ...) { simpleSimulate <- function(params = newSimpleParams(), verbose = TRUE, ...) {
checkmate::assertClass(params, "SimpleParams") checkmate::assertClass(params, "SimpleParams")
......
File moved
File moved
File moved
...@@ -2,15 +2,21 @@ ...@@ -2,15 +2,21 @@
% Please edit documentation in R/simple-estimate.R % Please edit documentation in R/simple-estimate.R
\name{estimateSimpleParams} \name{estimateSimpleParams}
\alias{estimateSimpleParams} \alias{estimateSimpleParams}
\alias{estimateSimpleParams.SCESet}
\alias{estimateSimpleParams.matrix}
\title{Estimate simple simulation parameters} \title{Estimate simple simulation parameters}
\usage{ \usage{
estimateSimpleParams(data, params = newSimpleParams()) estimateSimpleParams(data, params = newSimpleParams())
\method{estimateSimpleParams}{SCESet}(data, params = newSimpleParams())
\method{estimateSimpleParams}{matrix}(data, params = newSimpleParams())
} }
\arguments{ \arguments{
\item{params}{SimpleParams object to store estimated values in.} \item{data}{either a counts matrix or an SCESet object containing count data
to estimate parameters from.}
\item{x}{either a counts matrix or an SCESet object containing count data to \item{params}{SimpleParams object to store estimated values in.}
estimate parameters from.}
} }
\value{ \value{
SimpleParams object containing the estimated parameters. SimpleParams object containing the estimated parameters.
......
...@@ -18,7 +18,7 @@ List with the values of the selected parameters. ...@@ -18,7 +18,7 @@ List with the values of the selected parameters.
Get multiple parameter values from a Params object. Get multiple parameter values from a Params object.
} }
\examples{ \examples{
params <- simpleParams() params <- newSimpleParams()
getParams(params, c("nGenes", "nCells", "mean.rate")) getParams(params, c("nGenes", "nCells", "mean.rate"))
} }
...@@ -29,7 +29,7 @@ collecting parameter values in some way) or individually (useful when setting ...@@ -29,7 +29,7 @@ collecting parameter values in some way) or individually (useful when setting
them manually), see examples. them manually), see examples.
} }
\examples{ \examples{
params <- simpleParams() params <- newSimpleParams()
params params
# Set individually # Set individually
params <- setParams(params, nGenes = 1000, nCells = 50) params <- setParams(params, nGenes = 1000, nCells = 50)
......
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/simple-estimate.R
\name{estimateSimpleParams.SCESet}
\alias{estimateSimpleParams.SCESet}
\alias{estimateSimpleParams.matrix}
\usage{
\method{estimateSimpleParams}{SCESet}(data, params = newSimpleParams())
\method{estimateSimpleParams}{matrix}(data, params = newSimpleParams())
}
context("simple simulation") context("simple simulation")
test_that("simple simulation output is valid", { test_that("simple simulation output is valid", {
expect_true(validObject(simSimple())) expect_true(validObject(simpleSimulate()))
}) })
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