rechunkByMargins {beachmat} | R Documentation |
Convert an existing HDF5Matrix into a pure column- or row-based chunk layout.
rechunkByMargins(x, size=5000, outfile=NULL, outname=NULL, outlevel=NULL, byrow=TRUE)
x |
A HDF5Matrix object. |
size |
An integer scalar specifying the number of elements in each chunk. |
outfile |
A string containing the name for the output HDF5 file, chosen by |
outname |
A string containing the name for the output HDF5 data set, chosen by |
outlevel |
An integer scalar specifying the compression level, chosen by |
byrow |
A logical scalar indicating if the output file should be row-chunked (default) or column-chunked. |
Pure column- or row-based chunk layouts are optimal for random column and row access, respectively, from a HDF5 file. This function can be used to convert a file into a pure row/column layout prior to calling other functions. In many cases, a small investment in rechunking time is repaid by a reduction in access times in downstream procedures.
A HDF5Matrix object pointing to the HDF5 file containing the data from x
but with the new chunk layout.
Aaron Lun
A <- as(matrix(runif(5000), nrow=100, ncol=50), "HDF5Array") byrow <- rechunkByMargins(A, byrow=TRUE) bycol <- rechunkByMargins(A, byrow=FALSE)