Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow further arguments in msqrobAggregate #61

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions R/msqrobAggregate.R
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@
#' @param aggregateFun A function used for quantitative feature aggregation.
#' Details can be found in the documentation of the `aggregateFeatures`
#' of the `QFeatures` package.
#'
#'
#' @param ... Additional arguments passed to the function specified in the `aggregateFun` argument.
#'
#' @param modelColumnName `character` to indicate the variable name that is used
#' to store the msqrob models in the rowData of the SummarizedExperiment
#' instance or of the assay of the QFeatures instance. Default is "msqrobModels".
Expand Down Expand Up @@ -109,7 +111,8 @@ setMethod(
maxitRob = 1,
tol = 1e-6,
doQR = TRUE,
lmerArgs = list(control = lmerControl(calc.derivs = FALSE))) {
lmerArgs = list(control = lmerControl(calc.derivs = FALSE)),
...) {
if (!fcol %in% colnames(rowData(object)))
stop("The rowData does not contain variable '", fcol, "'.")
if (ridge == FALSE & is.null(findbars(formula)) ){
Expand Down Expand Up @@ -157,7 +160,8 @@ setMethod(
object <- QFeatures::aggregateFeatures(
object = object,
fcol = fcol,
fun = aggregateFun
fun = aggregateFun,
...
)

rowData(object)[[modelColumnName]] <- modelOutput
Expand All @@ -181,7 +185,8 @@ setMethod(
maxitRob = 1,
tol = 1e-6,
doQR = TRUE,
lmerArgs = list(control = lmerControl(calc.derivs = FALSE))) {
lmerArgs = list(control = lmerControl(calc.derivs = FALSE)),
...) {
if (is.null(object[[i]])) stop("QFeatures object does not contain assay ", i)
x <- getWithColData(object, i)
x <- msqrobAggregate(
Expand All @@ -195,9 +200,10 @@ setMethod(
maxitRob = maxitRob,
tol = tol,
doQR = doQR,
lmerArgs = lmerArgs
lmerArgs = lmerArgs,
...
)
object <- addAssay(object, x, name)
addAssayLink(object, i, name, varFrom = fcol, varTo = fcol)
}
)
)
Loading