Light wrapper around BiocParallel
functions that
automatically applies appropriate parallel function.
Arguments
- X
Any object for which methods
length
,[
, and[[
are implemented.- FUN
The
function
to be applied to each element ofX
.- apply_fun
A
BiocParallel
function to use for parallel processing. (default =BiocParallel::bplapply
)- BPPARAM
A
BiocParallelParam-class
object specifying run parameters. (default = bpparam())- ...
Arguments passed on to
BiocParallel::bplapply
,BiocParallel::bpmapply
BPREDO
A
list
of output frombplapply
with one or more failed elements. When a list is given inBPREDO
,bpok
is used to identify errors, tasks are rerun and inserted into the original results.BPOPTIONS
Additional options to control the behavior of the parallel evaluation, see
bpoptions
.MoreArgs
List of additional arguments to
FUN
.SIMPLIFY
If
TRUE
the result will be simplified usingsimplify2array
.USE.NAMES
If
TRUE
the result will be named.
Examples
half_it <- function(arg1) return(arg1 / 2)
x <- seq_len(10)
res <- MotifPeeker:::bpapply(x, half_it)
print(res)
#> [[1]]
#> [1] 0.5
#>
#> [[2]]
#> [1] 1
#>
#> [[3]]
#> [1] 1.5
#>
#> [[4]]
#> [1] 2
#>
#> [[5]]
#> [1] 2.5
#>
#> [[6]]
#> [1] 3
#>
#> [[7]]
#> [1] 3.5
#>
#> [[8]]
#> [1] 4
#>
#> [[9]]
#> [1] 4.5
#>
#> [[10]]
#> [1] 5
#>