R/addons-DESeq2.R

Defines functions append_transpilers_for_DESeq2

# DESeq2::DESeq(dds) =>
#
# with(doFuture::registerDoFuture(flavor = "%dofuture%"), {
#   options(future.disposable = <future arguments>)
#   DESeq2::DESeq(dds, parallel = TRUE, BPPARAM = BiocParallel::DoparParam())
# })
#
append_transpilers_for_DESeq2 <- function() {
  transpilers <- make_package_transpilers("DESeq2", FUN = function(fcn, name) {
    if ("BPPARAM" %in% names(formals(fcn))) {
      args <- list(BPPARAM = quote(BiocParallel::DoparParam()))
      if ("parallel" %in% names(formals(fcn))) {
        args <- c(list(parallel = TRUE), args)
      }
      list(
        label = sprintf("DESeq2::%s() ~> DESeq2::%s(..., parallel = TRUE, BPPARAM = BiocParallel::DoparParam())", name, name),
        transpiler = make_futurize_for_doFuture(args = args)
      )
    }
  })

  append_transpilers("futurize::add-on", transpilers)

  ## Return required packages
  c("DESeq2", "BiocParallel", "doFuture")
}

Try the futurize package in your browser

Any scripts or data that you put into this service are public.

futurize documentation built on March 19, 2026, 1:07 a.m.