| saveHDF5MultiAssayExperiment {MultiAssayExperiment} | R Documentation |
This function takes a `MultiAssayExperiment` object and uses the `assays`
functionality to obtain data matrices out of the experiments. These are
then saved into the `.h5` file format. This function relies heavily on
the `HDF5Array` package whose installation is required before use.
`saveHDF5MultiAssayExpeirment` preserves the classes contained in the
\linkS4class{ExperimentList} with the exception of `matrix` which is
converted to `HDF5Matrix`. Internal `SummarizedExperiment` assays are
converted to HDF5-backed assays as in
`HDF5Array::saveHDF5SummarizedExperiment`. `SummarizedExperiment`
objects with multiple `i`-th assays will have the first assay take
precedence and others assays will be dropped with a warning.
If the first assay in a `SummarizedExperiment` contains an array,
the array is preserved in the process of saving and loading the
HDF5-backed `MultiAssayExperiment`.
saveHDF5MultiAssayExperiment( x, dir = "h5_mae", prefix = NULL, replace = FALSE, chunkdim = NULL, level = NULL, as.sparse = NA, verbose = NA ) loadHDF5MultiAssayExperiment(dir = "h5_mae", prefix = NULL)
x |
A MultiAssayExperiment object or derivative |
dir |
The path (as a single string) to the directory where to save the HDF5-based MultiAssayExperiment object or to load it from. When saving, the directory will be created if it doesn't already exist. If the directory already exists and no prefix is specified and `replace` is set to `TRUE`, then it's replaced with an empty directory. |
prefix |
An optional prefix to add to the names of the files created
inside |
replace |
When no prefix is specified, should a pre-existing directory be replaced with a new empty one? The content of the pre-existing directory will be lost! |
chunkdim |
The dimensions of the chunks and the compression level to use for writing the assay data to disk. Passed to the internal calls to |
level |
The dimensions of the chunks and the compression level to use for writing the assay data to disk. Passed to the internal calls to |
as.sparse |
Whether the assay data should be flagged as sparse or not. If set to
Passed to the internal calls to |
verbose |
Set to In the case of `saveHDF5MultiAssayExperiment()`, `verbose` is set to `NA` by default, in which case verbosity is controlled by `DelayedArray:::get_verbose_block_processing()`. Setting `verbose` to `TRUE` or `FALSE` overrides this. |
testDir <- file.path(tempdir(), "test_mae")
saveHDF5MultiAssayExperiment(
miniACC, dir = testDir, verbose = TRUE, replace = TRUE
)
## inspect the files in the dir
list.files(testDir)
loadHDF5MultiAssayExperiment(
dir = testDir
)
## remove example files
unlink(testDir, recursive = TRUE)