Set parameters
Source:R/AllGenerics.R
, R/KersplatParams-methods.R
, R/Params-methods.R
, and 1 more
setParams.Rd
Set multiple parameters in a Params object.
Usage
setParams(object, update = NULL, ...)
# S4 method for class 'KersplatParams'
setParams(object, update = NULL, ...)
# S4 method for class 'Params'
setParams(object, update = NULL, ...)
# S4 method for class 'SplatParams'
setParams(object, update = NULL, ...)
Details
Each parameter is set by a call to setParam
. If the same
parameter is specified multiple times it will be set multiple times.
Parameters can be specified using a list via update
(useful when
collecting parameter values in some way) or individually (useful when setting
them manually), see examples.
Examples
params <- newSimpleParams()
params
#> A Params object of class SimpleParams
#> Parameters can be (estimable) or [not estimable], 'Default' or 'NOT DEFAULT'
#> Secondary parameters are usually set during simulation
#>
#> Global:
#> (Genes) (Cells) [SEED]
#> 10000 100 262817
#>
#> 3 additional parameters
#>
#> Mean:
#> (Rate) (Shape)
#> 0.3 0.4
#>
#> Counts:
#> [Dispersion]
#> 0.1
#>
# Set individually
params <- setParams(params, nGenes = 1000, nCells = 50)
params
#> A Params object of class SimpleParams
#> Parameters can be (estimable) or [not estimable], 'Default' or 'NOT DEFAULT'
#> Secondary parameters are usually set during simulation
#>
#> Global:
#> (GENES) (CELLS) [SEED]
#> 1000 50 262817
#>
#> 3 additional parameters
#>
#> Mean:
#> (Rate) (Shape)
#> 0.3 0.4
#>
#> Counts:
#> [Dispersion]
#> 0.1
#>
# Set via update list
params <- setParams(params, list(mean.rate = 0.2, mean.shape = 0.8))
params
#> A Params object of class SimpleParams
#> Parameters can be (estimable) or [not estimable], 'Default' or 'NOT DEFAULT'
#> Secondary parameters are usually set during simulation
#>
#> Global:
#> (GENES) (CELLS) [SEED]
#> 1000 50 262817
#>
#> 3 additional parameters
#>
#> Mean:
#> (RATE) (SHAPE)
#> 0.2 0.8
#>
#> Counts:
#> [Dispersion]
#> 0.1
#>