Skip to content

Commit

Permalink
Use initialize() method instead of prototype for Params class
Browse files Browse the repository at this point in the history
See issue Oshlack#132
  • Loading branch information
wenjie2wang committed Jan 28, 2022
1 parent 1eec243 commit f539996
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions R/AllClasses.R
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,14 @@ setClass("Params",
contains = "VIRTUAL",
slots = c(nGenes = "numeric",
nCells = "numeric",
seed = "numeric"),
prototype = prototype(nGenes = 10000, nCells = 100,
seed = sample(seq_len(1e6), 1)))
seed = "numeric"))

setMethod("initialize", "Params", function(.Object, ...) {
.Object@nGenes <- 10000
.Object@nCells <- 100
.Object@seed <- sample(seq_len(1e6), 1)
.Object
})

#' The SimpleParams class
#'
Expand Down

0 comments on commit f539996

Please sign in to comment.