R/addons-GenomicAlignments.R

Defines functions append_transpilers_for_GenomicAlignments

# GenomicAlignments::summarizeOverlaps(features, reads) =>
#
# with(doFuture::registerDoFuture(flavor = "%dofuture%"), {
#   options(future.disposable = <future arguments>)
#   GenomicAlignments::summarizeOverlaps(features, reads, BPPARAM = BiocParallel::DoparParam())
# })
#
append_transpilers_for_GenomicAlignments <- function() {
  ## These GenomicAlignments functions accept BPPARAM via '...'
  ## (S4 generics)
  names <- c(
    "summarizeOverlaps"
  )

  ns <- getNamespace("GenomicAlignments")
  transpilers <- list()
  for (name in names) {
    if (exists(name, mode = "function", envir = ns, inherits = TRUE)) {
      args <- list(BPPARAM = quote(BiocParallel::DoparParam()))
      transpilers[[name]] <- list(
        label = sprintf("GenomicAlignments::%s() ~> GenomicAlignments::%s(..., BPPARAM = BiocParallel::DoparParam())", name, name),
        transpiler = make_futurize_for_doFuture(args = args)
      )
    }
  }

  transpilers <- list(transpilers)
  names(transpilers) <- "GenomicAlignments"

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

  ## Return required packages
  c("GenomicAlignments", "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.