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
9c2154f1
Commit
9c2154f1
authored
8 years ago
by
Luke Zappia
Browse files
Options
Downloads
Patches
Plain Diff
Use checkParams and getParams
parent
ebc0e307
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
R/params.R
+45
-38
45 additions, 38 deletions
R/params.R
with
45 additions
and
38 deletions
R/params.R
+
45
−
38
View file @
9c2154f1
...
@@ -127,32 +127,38 @@ splatParams <- function(...) {
...
@@ -127,32 +127,38 @@ splatParams <- function(...) {
#' @export
#' @export
print.splatParams
<-
function
(
x
,
...
)
{
print.splatParams
<-
function
(
x
,
...
)
{
pp
<-
list
(
"Global:"
=
c
(
"(Genes)"
=
x
$
nGenes
,
"(Cells)"
=
x
$
nCells
,
pp
<-
list
(
"Global:"
=
c
(
"(Genes)"
=
"nGenes"
,
"[Group Cells]"
=
x
$
groupCells
),
"(Cells)"
=
"nCells"
,
"Mean:"
=
c
(
"(Rate)"
=
x
$
mean
$
rate
,
"(Shape)"
=
x
$
mean
$
shape
),
"[Group Cells]"
=
"groupCells"
),
"Library size:"
=
c
(
"(Location)"
=
x
$
lib
$
loc
,
"Mean:"
=
c
(
"(Rate)"
=
"mean.rate"
,
"(Scale)"
=
x
$
lib
$
scale
),
"(Shape)"
=
"mean.shape"
),
"Expression outliers:"
=
c
(
"(Probability)"
=
x
$
out
$
prob
,
"Library size:"
=
c
(
"(Location)"
=
"lib.loc"
,
"(Lo Probability)"
=
x
$
out
$
loProb
,
"(Scale)"
=
"lib.scale"
),
"(Location)"
=
x
$
out
$
facLoc
,
"Exprs outliers:"
=
c
(
"(Probability)"
=
"out.prob"
,
"(Scale)"
=
x
$
out
$
facScale
),
"(Lo Prob)"
=
"out.loProb"
,
"Differential expression:"
=
c
(
"[Probability]"
=
x
$
de
$
prob
,
"(Location)"
=
"out.facLoc"
,
"[Down Prob]"
=
x
$
de
$
downProb
,
"(Scale)"
=
"out.facScale"
),
"[Location]"
=
x
$
de
$
facLoc
,
"Differential exprs:"
=
c
(
"[Probability]"
=
"de.prob"
,
"[Scale]"
=
x
$
de
$
facScale
),
"[Down Prob]"
=
"de.downProb"
,
"BCV:"
=
c
(
"(Common Disp)"
=
x
$
bcv
$
common
,
"[Location]"
=
"de.facLoc"
,
"(Degrees of Freedom)"
=
x
$
bcv
$
DF
),
"[Scale]"
=
"de.facScale"
),
"Dropout:"
=
c
(
"(Present T/F)"
=
x
$
dropout
$
present
,
"BCV:"
=
c
(
"(Common Disp)"
=
"bcv.common"
,
"(Midpoint)"
=
x
$
dropout
$
mid
,
"(DoF)"
=
"bcv.DF"
),
"(Shape)"
=
x
$
dropout
$
shape
),
"Dropout:"
=
c
(
"(Present T/F)"
=
"dropout.present"
,
"Paths:"
=
c
(
"[From]"
=
x
$
path
$
from
,
"[Length]"
=
x
$
path
$
length
,
"(Midpoint)"
=
"dropout.mid"
,
"[Skew]"
=
x
$
path
$
skew
,
"(Shape)"
=
"dropout.shape"
),
"[Non-linear Prob]"
=
x
$
path
$
nonlinearProb
,
"Paths:"
=
c
(
"[From]"
=
"path.from"
,
"[Sigma Factor]"
=
x
$
path
$
sigmaFac
))
"[Length]"
=
"path.length"
,
"[Skew]"
=
"path.skew"
,
"[Non-linear]"
=
"path.nonlinearProb"
,
"[Sigma Factor]"
=
"path.sigmaFac"
))
for
(
category
in
names
(
pp
))
{
for
(
category
in
names
(
pp
))
{
parameters
<-
getParams
(
x
,
pp
[[
category
]])
parameters
<-
sapply
(
parameters
,
paste
,
collapse
=
", "
)
names
(
parameters
)
<-
names
(
pp
[[
category
]])
cat
(
category
,
"\n"
)
cat
(
category
,
"\n"
)
print
.default
(
pp
[[
category
]]
,
print.gap
=
2
)
print
(
noquote
(
parameters
)
,
print.gap
=
2
)
cat
(
"\n"
)
cat
(
"\n"
)
}
}
}
}
...
@@ -205,6 +211,8 @@ setParams <- function(params, ...) {
...
@@ -205,6 +211,8 @@ setParams <- function(params, ...) {
}
}
}
}
checkParams
(
params
)
return
(
params
)
return
(
params
)
}
}
...
@@ -310,13 +318,8 @@ checkParams <- function(params) {
...
@@ -310,13 +318,8 @@ checkParams <- function(params) {
for
(
idx
in
seq_along
(
types
))
{
for
(
idx
in
seq_along
(
types
))
{
name
<-
names
(
types
)[
idx
]
name
<-
names
(
types
)[
idx
]
name.split
<-
strsplit
(
name
,
"."
,
fixed
=
TRUE
)[[
1
]]
type
<-
types
[
idx
]
type
<-
types
[
idx
]
if
(
length
(
name.split
)
==
1
)
{
value
<-
getParams
(
name
)
value
<-
params
[[
name
]]
}
else
{
value
<-
params
[[
name.split
[
1
]]][[
name.split
[
2
]]]
}
# Check vector properties first so we can exclude vectors with an NA
# Check vector properties first so we can exclude vectors with an NA
# before the next section
# before the next section
...
@@ -387,6 +390,8 @@ mergeParams <- function(params1, params2) {
...
@@ -387,6 +390,8 @@ mergeParams <- function(params1, params2) {
}
}
}
}
checkParams
()
return
(
params1
)
return
(
params1
)
}
}
...
@@ -405,15 +410,17 @@ defaultParams <- function() {
...
@@ -405,15 +410,17 @@ defaultParams <- function() {
params
<-
splatParams
()
params
<-
splatParams
()
params
<-
setParams
(
params
,
nGenes
=
10000
,
nCells
=
100
,
params
<-
setParams
(
params
,
nGenes
=
10000
,
nCells
=
100
,
groupCells
=
100
,
mean.rate
=
0.3
,
mean.shape
=
0.4
,
groupCells
=
100
,
mean.rate
=
0.3
,
mean.shape
=
0.4
,
lib.loc
=
10
,
lib.scale
=
0.5
,
out.prob
=
0.1
,
lib.loc
=
10
,
lib.scale
=
0.5
,
out.prob
=
0.1
,
out.loProb
=
0.5
,
out.facLoc
=
4
,
out.facScale
=
1
,
out.loProb
=
0.5
,
out.facLoc
=
4
,
out.facScale
=
1
,
de.prob
=
0.1
,
de.downProb
=
0.5
,
de.facLoc
=
4
,
de.prob
=
0.1
,
de.downProb
=
0.5
,
de.facLoc
=
4
,
de.facScale
=
1
,
bcv.common
=
0.1
,
bcv.DF
=
25
,
de.facScale
=
1
,
bcv.common
=
0.1
,
bcv.DF
=
25
,
dropout.present
=
TRUE
,
dropout.mid
=
0
,
dropout.present
=
TRUE
,
dropout.mid
=
0
,
dropout.shape
=
-1
,
path.from
=
0
,
dropout.shape
=
-1
,
path.from
=
0
,
path.length
=
100
,
path.length
=
100
,
path.skew
=
0.5
,
path.skew
=
0.5
,
path.nonlinearProb
=
0.1
,
path.nonlinearProb
=
0.1
,
path.sigmaFac
=
0.8
)
path.sigmaFac
=
0.8
)
checkParams
()
return
(
params
)
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