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

Run checks

parent e6245c7b
No related branches found
No related tags found
No related merge requests found
......@@ -15,6 +15,8 @@ S3method(scDDEstimate,default)
S3method(scDDEstimate,matrix)
S3method(simpleEstimate,SingleCellExperiment)
S3method(simpleEstimate,matrix)
S3method(sparseDCEstimate,SingleCellExperiment)
S3method(sparseDCEstimate,matrix)
S3method(splatEstimate,SingleCellExperiment)
S3method(splatEstimate,matrix)
S3method(zinbEstimate,SingleCellExperiment)
......@@ -43,6 +45,7 @@ export(newMFAParams)
export(newPhenoParams)
export(newSCDDParams)
export(newSimpleParams)
export(newSparseDCParams)
export(newSplatParams)
export(newZINBParams)
export(phenoEstimate)
......@@ -53,6 +56,8 @@ export(setParam)
export(setParams)
export(simpleEstimate)
export(simpleSimulate)
export(sparseDCEstimate)
export(sparseDCSimulate)
export(splatEstimate)
export(splatSimulate)
export(splatSimulateGroups)
......@@ -68,6 +73,7 @@ exportClasses(MFAParams)
exportClasses(PhenoParams)
exportClasses(SCDDParams)
exportClasses(SimpleParams)
exportClasses(SparseDCParams)
exportClasses(SplatParams)
exportClasses(ZINBParams)
importFrom(BiocParallel,SerialParam)
......
......@@ -196,7 +196,7 @@ showDFs <- function(dfs, not.default) {
checkmate::check_list(dfs, types = "data.frame", any.missing = FALSE,
min.len = 1)
checkmate::check_logical(not.default, any.missing = FALSE,
len = length(values))
len = length(dfs))
names(dfs)[not.default] <- toupper(names(dfs)[not.default])
......
......@@ -5,7 +5,7 @@
#'
#' @param counts either a counts matrix or an SingleCellExperiment object
#' containing count data to estimate parameters from.
#' @param condition numeric vector giving the condition each cell belongs to.
#' @param conditions numeric vector giving the condition each cell belongs to.
#' @param nclusters number of cluster present in the dataset.
#' @param norm logical, whether to libray size normalise counts before
#' estimation. Set this to FALSE if counts is already normalised.
......@@ -13,12 +13,13 @@
#'
#' @details
#' The \code{nGenes} and \code{nCells} parameters are taken from the size of the
#' input data. The counts are preprocessed using \code{\link{pre_proc_data}} and
#' then parameters are estimated using \code{\link{sparsedc_cluster}} using
#' lambda values calculated using \code{\link{lambda1_calculator}} and
#' \code{\link{lambda2_calculator}}.
#' input data. The counts are preprocessed using
#' \code{\link[SparseDC]{pre_proc_data}} and then parameters are estimated using
#' \code{\link[SparseDC]{sparsedc_cluster}} using lambda values calculated using
#' \code{\link[SparseDC]{lambda1_calculator}} and
#' \code{\link[SparseDC]{lambda2_calculator}}.
#'
#' See \code{\link{SparsDCParams}} for more details on the parameters.
#' See \code{\link{SparseDCParams}} for more details on the parameters.
#'
#' @return SparseParams object containing the estimated parameters.
#'
......@@ -87,8 +88,8 @@ sparseDCEstimate.matrix <- function(counts, conditions, nclusters, norm = TRUE,
nCells = round(ncol(counts) / 2),
markers.n = markers.n,
markers.shared = markers.n - markers.diff,
clusts.c1 = sort(unique(sdc_res$clusters1)),
clusts.c2 = sort(unique(sdc_res$clusters2)))
clusts.c1 = sort(unique(sdc.res$clusters1)),
clusts.c2 = sort(unique(sdc.res$clusters2)))
return(params)
}
......@@ -9,7 +9,7 @@
#'
#' @details
#' This function is just a wrapper around
#' \code{\link[SparsDC]{sim_data}} that takes a
#' \code{\link[SparseDC]{sim_data}} that takes a
#' \code{\link{SparseDCParams}}, runs the simulation then converts the
#' output from log-expression to counts and returns a
#' \code{\link[SingleCellExperiment]{SingleCellExperiment}} object. The original
......
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/AllClasses.R
\docType{class}
\name{SparseDCParams}
\alias{SparseDCParams}
\alias{SparseDCParams-class}
\title{The SparseDCParams class}
\description{
S4 class that holds parameters for the SparseDC simulation.
}
\section{Parameters}{
The SparseDC simulation uses the following parameters:
\describe{
\item{\code{nGenes}}{The number of genes to simulate in each condition.}
\item{\code{nCells}}{The number of cells to simulate.}
\item{\code{[seed]}}{Seed to use for generating random numbers.}
\item{\code{markers.n}}{Number of marker genes to simulate for each
cluster.}
\item{\code{markers.shared}}{Number of marker genes for each cluster
shared between conditions. Must be less than or equal to
\code{markers.n}}.
\item{\code{[markers.same]}}{Logical. Whether each cluster should have
the same set of marker genes.}
\item{\code{clusts.c1}}{Numeric vector of clusters present in
condition 1. The number of times a cluster is repeated controls the
proportion of cells from that cluster.}
\item{\code{clusts.c2}}{Numeric vector of clusters present in
condition 2. The number of times a cluster is repeated controls the
proportion of cells from that cluster.}
\item{\code{[mean.lower]}}{Lower bound for cluster gene means.}
\item{\code{[mean.upper]}}{Upper bound for cluster gene means.}
}
The parameters not shown in brackets can be estimated from real data using
\code{\link{sparseDCEstimate}}. For details of the SparseDC simulation
see \code{\link{sparseDCSimulate}}.
}
......@@ -2,7 +2,7 @@
% Please edit documentation in R/AllGenerics.R, R/BASiCSParams-methods.R,
% R/Lun2Params-methods.R, R/LunParams-methods.R, R/MFAParams-methods.R,
% R/PhenoParams-methods.R, R/SCDDParams-methods.R, R/SimpleParams-methods.R,
% R/SplatParams-methods.R, R/ZINBParams-methods.R
% R/SparseDCParams-methods.R, R/SplatParams-methods.R, R/ZINBParams-methods.R
\name{newParams}
\alias{newParams}
\alias{newBASiCSParams}
......@@ -12,6 +12,7 @@
\alias{newPhenoParams}
\alias{newSCDDParams}
\alias{newSimpleParams}
\alias{newSparseDCParams}
\alias{newSplatParams}
\alias{newZINBParams}
\title{New Params}
......@@ -30,6 +31,8 @@ newSCDDParams(...)
newSimpleParams(...)
newSparseDCParams(...)
newSplatParams(...)
newZINBParams(...)
......
......@@ -26,7 +26,7 @@ This function is just a wrapper around
\code{\link{PhenoParams}}, runs the simulation then converts the
output from log-expression to counts and returns a
\code{\link[SingleCellExperiment]{SingleCellExperiment}} object. The original
simulated log-expression values are returned in the \code{LogExprs} asssay.
simulated log-expression values are returned in the \code{LogExprs} assay.
See \code{\link[phenopath]{simulate_phenopath}} and the PhenoPath paper for
more details about how the simulation works.
}
......
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/sparseDC-estimate.R
\name{sparseDCEstimate}
\alias{sparseDCEstimate}
\alias{sparseDCEstimate.SingleCellExperiment}
\alias{sparseDCEstimate.matrix}
\title{Estimate SparseDC simulation parameters}
\usage{
sparseDCEstimate(counts, conditions, nclusters, norm = TRUE,
params = newSparseDCParams())
\method{sparseDCEstimate}{SingleCellExperiment}(counts, conditions, nclusters,
norm = TRUE, params = newSparseDCParams())
\method{sparseDCEstimate}{matrix}(counts, conditions, nclusters, norm = TRUE,
params = newSparseDCParams())
}
\arguments{
\item{counts}{either a counts matrix or an SingleCellExperiment object
containing count data to estimate parameters from.}
\item{conditions}{numeric vector giving the condition each cell belongs to.}
\item{nclusters}{number of cluster present in the dataset.}
\item{norm}{logical, whether to libray size normalise counts before
estimation. Set this to FALSE if counts is already normalised.}
\item{params}{PhenoParams object to store estimated values in.}
}
\value{
SparseParams object containing the estimated parameters.
}
\description{
Estimate simulation parameters for the SparseDC simulation from a real
dataset.
}
\details{
The \code{nGenes} and \code{nCells} parameters are taken from the size of the
input data. The counts are preprocessed using
\code{\link[SparseDC]{pre_proc_data}} and then parameters are estimated using
\code{\link[SparseDC]{sparsedc_cluster}} using lambda values calculated using
\code{\link[SparseDC]{lambda1_calculator}} and
\code{\link[SparseDC]{lambda2_calculator}}.
See \code{\link{SparseDCParams}} for more details on the parameters.
}
\examples{
# Load example data
library(scater)
data("sc_example_counts")
conditions <- sample(1:2, ncol(sc_example_counts), replace = TRUE)
params <- sparseDCEstimate(sc_example_counts[1:500, ], conditions,
nclusters = 3)
params
}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/sparseDC-simulate.R
\name{sparseDCSimulate}
\alias{sparseDCSimulate}
\title{SparseDC simulation}
\usage{
sparseDCSimulate(params = newSparseDCParams(), verbose = TRUE, ...)
}
\arguments{
\item{params}{SparseDCParams object containing simulation parameters.}
\item{verbose}{logical. Whether to print progress messages}
\item{...}{any additional parameter settings to override what is provided in
\code{params}.}
}
\value{
SingleCellExperiment containing simulated counts
}
\description{
Simulate counts from cluster in two conditions using the SparseDC method.
}
\details{
This function is just a wrapper around
\code{\link[SparseDC]{sim_data}} that takes a
\code{\link{SparseDCParams}}, runs the simulation then converts the
output from log-expression to counts and returns a
\code{\link[SingleCellExperiment]{SingleCellExperiment}} object. The original
simulated log-expression values are returned in the \code{LogExprs} assay.
See \code{\link[SparseDC]{sim_data}} and the SparseDC paper for
more details about how the simulation works.
}
\examples{
sim <- sparseDCSimulate()
}
\references{
Campbell K, Yau C. Uncovering genomic trajectories with heterogeneous genetic
and environmental backgrounds across single-cells and populations. bioRxiv
(2017).
Barron M, Zhang S, Li J. A sparse differential clustering algorithm for
tracing cell type changes via single-cell RNA-sequencing data.
Nucleic Acids Research (2017).
Paper: \url{10.1093/nar/gkx1113}
}
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