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
7d31532f
Commit
7d31532f
authored
8 years ago
by
Luke Zappia
Browse files
Options
Downloads
Patches
Plain Diff
Set up basic structure of splat function
parent
2d741c7e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
DESCRIPTION
+2
-2
2 additions, 2 deletions
DESCRIPTION
NAMESPACE
+4
-0
4 additions, 0 deletions
NAMESPACE
R/simulate.R
+78
-0
78 additions, 0 deletions
R/simulate.R
man/splat.Rd
+30
-0
30 additions, 0 deletions
man/splat.Rd
man/splatParams.Rd
+1
-0
1 addition, 0 deletions
man/splatParams.Rd
with
115 additions
and
2 deletions
DESCRIPTION
+
2
−
2
View file @
7d31532f
Package: splatter
Type: Package
Title: Simple Simulation of Single-cell RNA Sequencing Data
Version: 0.3.
1
Date: 2016-10-0
7
Version: 0.3.
2
Date: 2016-10-0
9
Author: Luke Zappia
Authors@R: as.person(c(
"Luke Zappia <luke.zappia@mcri.edu.au> [aut, cre]",
...
...
This diff is collapsed.
Click to expand it.
NAMESPACE
+
4
−
0
View file @
7d31532f
...
...
@@ -10,6 +10,10 @@ export(getParams)
export(mergeParams)
export(setParams)
export(splatParams)
importFrom(BioBase,fData)
importFrom(BioBase,pData)
importFrom(scater,counts)
importFrom(scater,newSCESet)
importFrom(stats,dnbinom)
importFrom(stats,median)
importFrom(stats,nls)
This diff is collapsed.
Click to expand it.
R/simulate.R
0 → 100644
+
78
−
0
View file @
7d31532f
# setup metadata
# Means
# Groups
# Paths
# Lib size
# Base Means
# BCV
# Means
# Counts
# Dropout
# Add metadata
#
# Add length
# Median outliers
# set.seed
# group DE
#' FUNCTION TITLE
#'
#' FUNCTION DESCRIPTION
#'
#' @param params DESCRIPTION.
#' @param method DESCRIPTION.
#' @param add.assay DESCRIPTION.
#' @param verbose DESCRIPTION.
#' @param ... DESCRIPTION.
#'
#' @return RETURN DESCRIPTION
#' @examples
#' # ADD EXAMPLES HERE
#' @importFrom BioBase pData fData
#' @importFrom scater newSCESet counts
splat
<-
function
(
params
=
defaultParams
(),
method
=
c
(
"groups"
,
"paths"
),
add.assay
=
TRUE
,
verbose
=
TRUE
,
...
)
{
method
<-
match.arg
(
method
)
params
<-
setParams
(
params
,
...
)
params
<-
mergeParams
(
params
,
defaultParams
())
# Get the parameters we are going to use
n.cells
<-
getParams
(
params
,
"nCells"
)
n.genes
<-
getParams
(
params
,
"nGenes"
)
n.groups
<-
getParams
(
params
,
"nGroups"
)
group.cells
<-
getParams
(
params
,
"groupCells"
)
# Set up name vectors
cell.names
<-
paste0
(
"Cell"
,
1
:
n.cells
)
gene.names
<-
paste0
(
"Gene"
,
1
:
n.genes
)
group.names
<-
paste0
(
"Group"
,
1
:
n.groups
)
# Create SCESet with dummy counts to store simulation
dummy.counts
<-
matrix
(
1
,
ncol
=
n.cells
,
nrow
=
n.genes
)
rownames
(
dummy.counts
)
<-
gene.names
colnames
(
dummy.counts
)
<-
cell.names
phenos
<-
new
(
"AnnotatedDataFrame"
,
data
=
data.frame
(
Cell
=
cell.names
))
rownames
(
phenos
)
<-
cell.names
features
<-
new
(
"AnnotatedDataFrame"
,
data
=
data.frame
(
Gene
=
gene.names
))
rownames
(
features
)
<-
gene.names
sim
<-
newSCESet
(
countData
=
dummy.counts
,
phenoData
=
phenos
,
featureData
=
features
)
# Make groups vector which is the index of param$groupCells repeated
# params$groupCells[index] times
groups
<-
lapply
(
1
:
n.groups
,
function
(
i
,
g
)
{
rep
(
i
,
g
[
i
])},
g
=
group.cells
)
groups
<-
unlist
(
groups
)
pData
(
sim
)
$
Group
<-
group.names
[
groups
]
# Create new SCESet to make sure values are calculated correctly
sce
<-
newSCESet
(
countData
=
counts
(
sim
),
phenoData
=
new
(
"AnnotatedDataFrame"
,
data
=
pData
(
sim
)),
featureData
=
new
(
"AnnotatedDataFrame"
,
data
=
fData
(
sim
)))
return
(
sce
)
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
man/splat.Rd
0 → 100644
+
30
−
0
View file @
7d31532f
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/simulate.R
\name{splat}
\alias{splat}
\title{FUNCTION TITLE}
\usage{
splat(params = defaultParams(), method = c("groups", "paths"),
add.assay = TRUE, verbose = TRUE, ...)
}
\arguments{
\item{params}{DESCRIPTION.}
\item{method}{DESCRIPTION.}
\item{add.assay}{DESCRIPTION.}
\item{verbose}{DESCRIPTION.}
\item{...}{DESCRIPTION.}
}
\value{
RETURN DESCRIPTION
}
\description{
FUNCTION DESCRIPTION
}
\examples{
# ADD EXAMPLES HERE
}
This diff is collapsed.
Click to expand it.
man/splatParams.Rd
+
1
−
0
View file @
7d31532f
...
...
@@ -23,6 +23,7 @@ parameters. It has the following sections and values:
\itemize{
\item nGenes - Number of genes to simulate.
\item nCells - Number of cells to simulate.
\item nGroups - Number of groups to simulate.
\item [groupCells] - Vector giving the number of cells in each simulation
group/path.
\item mean (mean parameters)
...
...
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