Skip to content

Commit

Permalink
Allow further arguments in msqrobAggregate
Browse files Browse the repository at this point in the history
  • Loading branch information
StijnVandenbulcke committed May 7, 2024
1 parent 3590a80 commit b1c7cf3
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions R/msqrobAggregate.R
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,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 +158,8 @@ setMethod(
object <- QFeatures::aggregateFeatures(
object = object,
fcol = fcol,
fun = aggregateFun
fun = aggregateFun,
...
)

rowData(object)[[modelColumnName]] <- modelOutput
Expand All @@ -181,7 +183,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 +198,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)
}
)
)

0 comments on commit b1c7cf3

Please sign in to comment.