Skip to content

Commit

Permalink
Merge pull request #1122 from jiajic/suite_dev
Browse files Browse the repository at this point in the history
docs: Add instructions for adding new methods and operations
  • Loading branch information
jiajic authored Mar 3, 2025
2 parents 2397b88 + 4c5a65b commit ea5a69b
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 5 deletions.
17 changes: 17 additions & 0 deletions R/normalize.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
# Data Processing and Pipelining ------------------------------------------ #
# ADDING NEW METHODS
# - 1. Define the operation as a function.
# (See # internals / implementations section below)
# ## if adding a new operation type ##
# - 1.1 Define an extending param class
# - 1.2 Create an internal function to generate the class with default params
# (See # internals / params setup)
# - 1.3 Update the relevant factory function (normParam, scaleParam,
# adjustParam). Add method to to the `match.arg` and register it in the
# switch statement, pointing at the new default params internal
# function.
# - 2. Add the S4 method for the matrix/param combination desired
# - 3. Update the method documentation (if a method was added). Both the
# operation-specific documentation and under `process_param`, linking
# to it.

# Documentation ####

#' @name processExpression
Expand Down
10 changes: 5 additions & 5 deletions R/zzz.R
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,11 @@

if (requireNamespace("dbMatrix", quietly = TRUE)) {
setMethod("processData",
signature(x = "dbMatrix", param = "logNormParam"),
function(x, param) {
x[] <- dplyr::mutate(x[], x = x + param$offset)
log(x) / log(param$base)
}
signature(x = "dbMatrix", param = "logNormParam"),
function(x, param) {
x[] <- dplyr::mutate(x[], x = x + param$offset)
log(x) / log(param$base)
}
)
}
})
Expand Down

0 comments on commit ea5a69b

Please sign in to comment.