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
654d14e0
Commit
654d14e0
authored
8 years ago
by
Luke Zappia
Browse files
Options
Downloads
Patches
Plain Diff
Add lunEstimate function
parent
3dce282b
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
DESCRIPTION
+1
-1
1 addition, 1 deletion
DESCRIPTION
R/SimpleParams-methods.R
+1
-1
1 addition, 1 deletion
R/SimpleParams-methods.R
R/lun-estimate.R
+43
-0
43 additions, 0 deletions
R/lun-estimate.R
with
45 additions
and
2 deletions
DESCRIPTION
+
1
−
1
View file @
654d14e0
Package: splatter
Type: Package
Title: Simple Simulation of Single-cell RNA Sequencing Data
Version: 0.6.1
1
Version: 0.6.1
2
Date: 2016-10-14
Author: Luke Zappia
Authors@R: as.person(c(
...
...
This diff is collapsed.
Click to expand it.
R/SimpleParams-methods.R
+
1
−
1
View file @
654d14e0
...
...
@@ -36,7 +36,7 @@ setMethod("show", "SimpleParams", function(object) {
"(Shape)"
=
"mean.shape"
),
"Counts:"
=
c
(
"[Dispersion]"
=
"count.disp"
))
# Mean parameters aren't esti
a
mated for the LunParams object which
# Mean parameters aren't estimated for the LunParams object which
# inherits from SimpleParams
if
(
class
(
object
)
==
"LunParams"
)
{
pp
[[
"Mean:"
]]
<-
c
(
"[Rate]"
=
"mean.rate"
,
"[Shape]"
=
"mean.shape"
)
...
...
This diff is collapsed.
Click to expand it.
R/lun-estimate.R
0 → 100644
+
43
−
0
View file @
654d14e0
#' Estimate Lun simulation parameters
#'
#' Estimate simulation parameters for the Lun simulation from a real dataset.
#'
#' @param counts either a counts matrix or an SCESet object containing count
#' data to estimate parameters from.
#' @param params LunParams object to store estimated values in.
#'
#' @details
#' The \code{nGenes} and \code{nCells} parameters are taken from the size of the
#' input data. No other parameters are estimated. See \code{\link{LunParams}}
#' for more details on the parameters.
#'
#' @return LunParams object containing the estimated parameters.
#'
#' @examples
#' data("sc_example_counts")
#' params <- lunEstimate(sc_example_counts)
#' params
#' @export
lunEstimate
<-
function
(
counts
,
params
=
newLunParams
())
{
UseMethod
(
"lunEstimate"
)
}
#' @rdname lunEstimate
#' @export
lunEstimate.SCESet
<-
function
(
counts
,
params
=
newLunParams
())
{
counts
<-
scater
::
counts
(
counts
)
lunEstimate
(
counts
,
params
)
}
#' @rdname lunEstimate
#' @importFrom stats median
#' @export
lunEstimate.matrix
<-
function
(
counts
,
params
=
newLunParams
())
{
checkmate
::
assertClass
(
params
,
"LunParams"
)
params
<-
setParams
(
params
,
nGenes
=
nrow
(
counts
),
groupCells
=
ncol
(
counts
))
return
(
params
)
}
\ No newline at end of file
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