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

Add phenoEstimate

parent 6f488ee2
No related branches found
No related tags found
No related merge requests found
......@@ -6,6 +6,8 @@ S3method(lunEstimate,SingleCellExperiment)
S3method(lunEstimate,matrix)
S3method(mfaEstimate,SingleCellExperiment)
S3method(mfaEstimate,matrix)
S3method(phenoEstimate,SingleCellExperiment)
S3method(phenoEstimate,matrix)
S3method(scDDEstimate,SingleCellExperiment)
S3method(scDDEstimate,default)
S3method(scDDEstimate,matrix)
......@@ -35,6 +37,7 @@ export(newPhenoParams)
export(newSCDDParams)
export(newSimpleParams)
export(newSplatParams)
export(phenoEstimate)
export(phenoSimulate)
export(scDDEstimate)
export(scDDSimulate)
......
#' Estimate PhenoPath simulation parameters
#'
#' Estimate simulation parameters for the PhenoPath simulation from a real
#' dataset.
#'
#' @param counts either a counts matrix or an SingleCellExperiment object
#' containing count data to estimate parameters from.
#' @param params PhenoParams object to store estimated values in.
#'
#' @details
#' The \code{nGenes} and \code{nCells} parameters are taken from the size of the
#' input data. The total number of genes is evenly divided into the four types.
#' See \code{\link{PhenoParams}} for more details on the parameters.
#'
#' @return PhenoParams object containing the estimated parameters.
#'
#' @examples
#' data("sc_example_counts")
#' params <- phenoEstimate(sc_example_counts)
#' params
#' @export
phenoEstimate <- function(counts, params = newPhenoParams()) {
UseMethod("phenoEstimate")
}
#' @rdname phenoEstimate
#' @export
phenoEstimate.SingleCellExperiment <- function(counts,
params = newPhenoParams()) {
counts <- BiocGenerics::counts(counts)
phenoEstimate(counts, params)
}
#' @rdname phenoEstimate
#' @export
phenoEstimate.matrix <- function(counts, params = newPhenoParams()) {
checkmate::assertClass(params, "PhenoParams")
nGenes <- nrow(counts)
quarter <- floor(nGenes / 4)
params <- setParams(params, nCells = ncol(counts),
n.de = nGenes - 3 * quarter,
n.pst = quarter, n.pst.beta = quarter,
n.de.pst.beta = quarter)
return(params)
}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/pheno-estimate.R
\name{phenoEstimate}
\alias{phenoEstimate}
\alias{phenoEstimate.SingleCellExperiment}
\alias{phenoEstimate.matrix}
\title{Estimate PhenoPath simulation parameters}
\usage{
phenoEstimate(counts, params = newPhenoParams())
\method{phenoEstimate}{SingleCellExperiment}(counts,
params = newPhenoParams())
\method{phenoEstimate}{matrix}(counts, params = newPhenoParams())
}
\arguments{
\item{counts}{either a counts matrix or an SingleCellExperiment object
containing count data to estimate parameters from.}
\item{params}{PhenoParams object to store estimated values in.}
}
\value{
PhenoParams object containing the estimated parameters.
}
\description{
Estimate simulation parameters for the PhenoPath simulation from a real
dataset.
}
\details{
The \code{nGenes} and \code{nCells} parameters are taken from the size of the
input data. The total number of genes is evenly divided into the four types.
See \code{\link{PhenoParams}} for more details on the parameters.
}
\examples{
data("sc_example_counts")
params <- phenoEstimate(sc_example_counts)
params
}
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