@@ -13,20 +13,24 @@ vignette: |
1313 %\VignetteEncoding{UTF-8}
1414---
1515
16- # Introduction
17-
18- HDF5-backed DataFrame objects and methods.
19-
2016``` {r load-libs}
2117library(rhdf5)
2218library(HDF5Array)
2319library(HDF5DataFrame)
2420```
2521
22+ # Introduction
23+
24+ ` r Biocpkg("HDF5DataFrame") ` is an R/Bioconductor package for HDF5-backed
25+ DataFrame objects and methods. Each column of a data frame is stored
26+ as a separate one dimensional array in an HDF5 file.
27+ ` r Biocpkg("HDF5DataFrame") ` organizes these arrays and serves them
28+ as a ` DataFrame ` -like object.
29+
2630# Installation
2731
2832You can install ` r Biocpkg("HDF5DataFrame") ` from Bioconductor using
29- ** BiocManager** :
33+ ` r CRANpkg(" BiocManager") ` :
3034
3135``` {r bioc, eval=FALSE}
3236if (!requireNamespace("BiocManager", quietly = TRUE)) {
@@ -35,30 +39,19 @@ if (!requireNamespace("BiocManager", quietly = TRUE)) {
3539BiocManager::install("HDF5DataFrame")
3640```
3741
38- Or you can install the development version of ` r Biocpkg("HDF5DataFrame") `
39- from GitHub like so:
40-
41- ``` {r devtools, eval=FALSE}
42- if (!require("devtools", quietly = TRUE))
43- install.packages("devtools")
44- devtools::install_github("BIMSBbioinfo/HDF5DataFrame")
45- ```
46-
4742# Usage
4843
49- The main usage of the HDF5DataFrame is to deliver DelayedArray
50- operations for DataFrames
44+ We use ` writeHDF5DataFrame ` to write the a ` data.frame ` to an HDF5 file.
45+ You can also specify the HDF5 group (` name ` ) where columns of the data frame
46+ are stored.
5147
5248``` {r read}
53-
54- # create h5 and a group for the hdf5 backed data frames
55- output_h5ad <- tempfile(fileext = ".h5")
56-
5749# data
5850data("chickwts")
5951metadata <- chickwts
6052
6153# create HDF5DataFrame and write to hdf5
54+ output_h5ad <- tempfile(fileext = ".h5")
6255metadata_hdf5 <- writeHDF5DataFrame(metadata,
6356 filepath = output_h5ad,
6457 name = "metadata",
@@ -70,12 +63,19 @@ metadata_hdf5
7063
7164# Methods
7265
66+ You can use various ` DataFrame ` methods on ` HDF5DataFrame ` objects such as
67+ ` cbind ` where an in-memory ` data.frame ` can be combined with the ` HDF5DataFrame `
68+ object.
69+
7370``` {r methods}
7471# cbind with in memory data
7572metadata_hdf5 <- cbind(metadata_hdf5, metadata)
7673metadata_hdf5
7774```
7875
76+ You can also realize the ` HDF5DataFrame ` object into an in-memory
77+ ` data.frame ` any time.
78+
7979``` {r methods2}
8080# coerce to data.frame
8181metadata_hdf5 <- as.data.frame(metadata_hdf5)
0 commit comments