Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
sirplus
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
BioCellGen-public
sirplus
Commits
3ae99172
Commit
3ae99172
authored
7 years ago
by
Luke Zappia
Browse files
Options
Downloads
Patches
Plain Diff
Add phenoEstimate
parent
6f488ee2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
NAMESPACE
+3
-0
3 additions, 0 deletions
NAMESPACE
R/pheno-estimate.R
+49
-0
49 additions, 0 deletions
R/pheno-estimate.R
man/phenoEstimate.Rd
+38
-0
38 additions, 0 deletions
man/phenoEstimate.Rd
with
90 additions
and
0 deletions
NAMESPACE
+
3
−
0
View file @
3ae99172
...
...
@@ -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)
...
...
This diff is collapsed.
Click to expand it.
R/pheno-estimate.R
0 → 100644
+
49
−
0
View file @
3ae99172
#' 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
)
}
This diff is collapsed.
Click to expand it.
man/phenoEstimate.Rd
0 → 100644
+
38
−
0
View file @
3ae99172
% 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
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment