BiocParallel (version 1.0.3)

bpmapply: Parallel mapply-like functionality

Description

bpmapply applies FUN to first elements of ..., the second elements and so on. Any type of object in ... is allowed, provided length, [, and [[ methods are available. The return value is a list of length equal to the length of all objects provided, as with mapply.

Usage

bpmapply(FUN, ..., MoreArgs=NULL, SIMPLIFY=TRUE, USE.NAMES=TRUE, BPRESUME=getOption("BiocParallel.BPRESUME", FALSE), BPPARAM=bpparam())
"bpmapply"(FUN, ..., MoreArgs=NULL, SIMPLIFY=TRUE, USE.NAMES=TRUE, BPRESUME=getOption("BiocParallel.BPRESUME", FALSE), BPPARAM=bpparam())
"bpmapply"(FUN, ..., MoreArgs=NULL, SIMPLIFY=TRUE, USE.NAMES=TRUE, BPRESUME=getOption("BiocParallel.BPRESUME", FALSE), BPPARAM=bpparam())
"bpmapply"(FUN, ..., MoreArgs=NULL, SIMPLIFY=TRUE, USE.NAMES=TRUE, BPRESUME=getOption("BiocParallel.BPRESUME", FALSE), BPPARAM=bpparam())

Arguments

FUN
The function to be applied to each element passed via ....
...
Objects for which methods length, [, and [[ are implemented. All objects must have the same length or shorter objects will be replicated to have length equal to the longest.
MoreArgs
List of additional arguments to FUN.
SIMPLIFY
If TRUE the result will be simplified using simplify2array.
USE.NAMES
If TRUE the result will be named.
BPRESUME
Flag to determine if a previous partially successful run should be resumed. See bpresume for details.
BPPARAM
An optional BiocParallelParam instance determining the parallel back-end to be used during evaluation.

Value

lapply.

Details

See showMethods{bplapply} for additional methods, e.g., method?bplapply("MulticoreParam").

See Also

bpvec for parallel, vectorized calculations.

BiocParallelParam for possible values of BPPARAM.

Examples

Run this code
showMethods("bpmapply")

## ten tasks (1:10) so ten calls to FUN default registered parallel
## back-end. Compare with bpvec.
result <- bpmapply(function(greet, who) {
    paste(Sys.getpid(), greet, who)
}, c("morning", "night"), c("sun", "moon"))
cat(paste(result, collapse="\n"), "\n")

Run the code above in your browser using DataLab