blockApply {DelayedArray} | R Documentation

## Block processing of an array-like object

### Description

A set of utilities for processing an array-like object block by block.

### Usage

    blockApply(x, FUN, ..., grid=NULL, BPPARAM=getAutoBPPARAM())
    blockReduce(FUN, x, init, BREAKIF=NULL, grid=NULL)

    effectiveGrid(block)
    currentBlockId(block)
    currentViewport(block)

    getAutoGridMaker()
    setAutoGridMaker(GRIDMAKER="blockGrid")
    getAutoBPPARAM()
    setAutoBPPARAM(BPPARAM=NULL)

### Arguments

`x` | An array-like object.
`FUN` | Coming soon...
`...` | Coming soon...
`grid` | Coming soon...
`BPPARAM` | Coming soon...
`init` | Coming soon...
`BREAKIF` | Coming soon...
`block` | Coming soon...
`GRIDMAKER` | The function to use as automatic grid maker, that is, the function that will be used by `blockApply()` and `blockReduce()` to make a grid when no grid is supplied via their `grid` argument. The function will be called on array-like object `x` and must return an ArrayGrid object, say `grid`, that is compatible with `x` i.e. such that `refdim(grid)` is identical to `dim(x)`. `GRIDMAKER` can be specified as a function or as a single string naming a function. It can be a user-defined function or a pre-defined grid maker like `blockGrid`, `rowGrid`, or `colGrid`. The automatic grid maker is set to `blockGrid` at package startup and can be reset anytime to this value by calling `setAutoGridMaker()` with no argument.

### Details

Coming soon...

### See Also

- `blockGrid` to define grids to use in the context of block processing of array-like objects.

- `MulticoreParam`, `SnowParam`, and `bpparam`, from the BiocParallel package.

- `read_block`.

- DelayedArray objects.

- Advanced users: RealizationSink objects for writing an array-like object block by block to disk (or to memory).

### Examples

    ## ---------------------------------------------------------------------
    ## blockApply()
    ## ---------------------------------------------------------------------

    ## Coming soon...

    ## ---------------------------------------------------------------------
    ## blockReduce()
    ## ---------------------------------------------------------------------

    ## Coming soon...

    ## ---------------------------------------------------------------------
    ## CONTROL THE DEFAULT GRID MAKER
    ## ---------------------------------------------------------------------
    getAutoGridMaker()
    setAutoGridMaker(function(x) colGrid(x, ncol=5))
    getAutoGridMaker()

    m <- matrix(runif(600), ncol=12)
    blockApply(m, currentViewport)

    ## Reset automatic grid maker to factory settings:
    setAutoGridMaker()

[Package DelayedArray version 0.14.1 Index]