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
712fe45c
Commit
712fe45c
authored
7 years ago
by
Luke Zappia
Browse files
Options
Downloads
Patches
Plain Diff
Add mfaEstimate
parent
d173ae09
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/mfa-estimate.R
+46
-0
46 additions, 0 deletions
R/mfa-estimate.R
man/mfaEstimate.Rd
+37
-0
37 additions, 0 deletions
man/mfaEstimate.Rd
with
86 additions
and
0 deletions
NAMESPACE
+
3
−
0
View file @
712fe45c
...
...
@@ -4,6 +4,8 @@ S3method(lun2Estimate,SingleCellExperiment)
S3method(lun2Estimate,matrix)
S3method(lunEstimate,SingleCellExperiment)
S3method(lunEstimate,matrix)
S3method(mfaEstimate,SingleCellExperiment)
S3method(mfaEstimate,matrix)
S3method(scDDEstimate,SingleCellExperiment)
S3method(scDDEstimate,matrix)
S3method(simpleEstimate,SingleCellExperiment)
...
...
@@ -23,6 +25,7 @@ export(lunSimulate)
export(makeCompPanel)
export(makeDiffPanel)
export(makeOverallPanel)
export(mfaEstimate)
export(newLun2Params)
export(newLunParams)
export(newMFAParams)
...
...
This diff is collapsed.
Click to expand it.
R/mfa-estimate.R
0 → 100644
+
46
−
0
View file @
712fe45c
#' Estimate mfa simulation parameters
#'
#' Estimate simulation parameters for the mfa simulation from a real dataset.
#'
#' @param counts either a counts matrix or a SingleCellExperiment object
#' containing count data to estimate parameters from.
#' @param params MFAParams object to store estimated values in.
#'
#' @details
#' The \code{nGenes} and \code{nCells} parameters are taken from the size of the
#' input data. The dropout lambda parameter is estimate using
#' \code{\link[mfa]{empirical_lambda}}. See \code{\link{MFAParams}} for more
#' details on the parameters.
#'
#' @return MFAParams object containing the estimated parameters.
#'
#' @examples
#' data("sc_example_counts")
#' params <- mfaEstimate(sc_example_counts)
#' params
#' @export
mfaEstimate
<-
function
(
counts
,
params
=
newMFAParams
())
{
UseMethod
(
"mfaEstimate"
)
}
#' @rdname mfaEstimate
#' @export
mfaEstimate.SingleCellExperiment
<-
function
(
counts
,
params
=
newMFAParams
())
{
counts
<-
BiocGenerics
::
counts
(
counts
)
mfaEstimate
(
counts
,
params
)
}
#' @rdname mfaEstimate
#' @export
mfaEstimate.matrix
<-
function
(
counts
,
params
=
newMFAParams
())
{
checkmate
::
assertClass
(
params
,
"MFAParams"
)
dropout.lambda
<-
mfa
::
empirical_lambda
(
t
(
counts
))
params
<-
setParams
(
params
,
nGenes
=
nrow
(
counts
),
nCells
=
ncol
(
counts
),
dropout.lambda
=
dropout.lambda
)
return
(
params
)
}
This diff is collapsed.
Click to expand it.
man/mfaEstimate.Rd
0 → 100644
+
37
−
0
View file @
712fe45c
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/mfa-estimate.R
\name{mfaEstimate}
\alias{mfaEstimate}
\alias{mfaEstimate.SingleCellExperiment}
\alias{mfaEstimate.matrix}
\title{Estimate mfa simulation parameters}
\usage{
mfaEstimate(counts, params = newMFAParams())
\method{mfaEstimate}{SingleCellExperiment}(counts, params = newMFAParams())
\method{mfaEstimate}{matrix}(counts, params = newMFAParams())
}
\arguments{
\item{counts}{either a counts matrix or a SingleCellExperiment object
containing count data to estimate parameters from.}
\item{params}{MFAParams object to store estimated values in.}
}
\value{
MFAParams object containing the estimated parameters.
}
\description{
Estimate simulation parameters for the mfa simulation from a real dataset.
}
\details{
The \code{nGenes} and \code{nCells} parameters are taken from the size of the
input data. The dropout lambda parameter is estimate using
\code{\link[mfa]{empirical_lambda}}. See \code{\link{MFAParams}} for more
details on the parameters.
}
\examples{
data("sc_example_counts")
params <- mfaEstimate(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