writeHDF5Array {HDF5Array} | R Documentation |
A function for writing an array-like object to an HDF5 file.
writeHDF5Array(x, filepath=NULL, name=NULL, chunkdim=NULL, level=NULL, verbose=FALSE)
x |
The array-like object to write to an HDF5 file. If |
filepath |
|
name |
|
chunkdim |
The dimensions of the chunks to use for writing the data to disk.
By default, |
level |
The compression level to use for writing the data to disk.
By default, |
verbose |
Set to |
Please note that, depending on the size of the data to write to disk
and the performance of the disk, writeHDF5Array
can take a long
time to complete. Use verbose=TRUE
to see its progress.
Use setHDF5DumpFile
and setHDF5DumpName
to
control the location of automatically created HDF5 datasets.
An HDF5Array object pointing to the newly written HDF5 dataset on disk.
When passed a DelayedArray object, writeHDF5Array
realizes it on disk, that is, all the delayed operations carried
by the object are executed on-the-fly while the object is written to disk.
This uses a block-processing strategy so that the full object is not
realized at once in memory. Instead the object is processed block by block
i.e. the blocks are realized in memory and written to disk one at a time.
In other words, writeHDF5Array(x, ...)
is semantically equivalent
to writeHDF5Array(as.array(x), ...)
, except that as.array(x)
is not called because this would realize the full object at once in memory.
See ?DelayedArray
for general information about
DelayedArray objects.
HDF5Array objects.
saveHDF5SummarizedExperiment
and
loadHDF5SummarizedExperiment
in this
package (the HDF5Array package) for saving/loading
an HDF5-based SummarizedExperiment
object to/from disk.
HDF5-dump-management for controlling the location of automatically created HDF5 datasets.
h5ls
in the rhdf5 package.
library(rhdf5) library(h5vcData) tally_file <- system.file("extdata", "example.tally.hfs5", package="h5vcData") h5ls(tally_file) cov0 <- HDF5Array(tally_file, "/ExampleStudy/16/Coverages") cov1 <- cov0[ , , 29000001:29000007] out_file <- tempfile() writeHDF5Array(cov1, out_file, "cov1") h5ls(out_file)