|
36 | 36 | #' \code{\link{scalars}}, \code{\link{sources}}, \code{\link{results}} for |
37 | 37 | #' accessors. |
38 | 38 | #' |
| 39 | +#' @aliases ModelArray-class |
| 40 | +#' @rdname ModelArray-class |
39 | 41 | #' @importClassesFrom DelayedArray DelayedArray |
40 | 42 | #' @exportClass ModelArray |
41 | 43 | ModelArray <- setClass( |
@@ -70,54 +72,53 @@ ModelArraySeed <- function(filepath, name, type = NA) { |
70 | 72 |
|
71 | 73 |
|
72 | 74 |
|
73 | | -#' Load element-wise data from an HDF5 file as a ModelArray object |
| 75 | +#' Load element-wise data from an HDF5 file |
74 | 76 | #' |
75 | 77 | #' @description |
76 | | -#' Reads scalar matrices and (optionally) saved analysis results from an HDF5 |
77 | | -#' file and returns a \linkS4class{ModelArray} object. |
| 78 | +#' Reads scalar matrices and (optionally) saved analysis results from |
| 79 | +#' an HDF5 file and returns a \linkS4class{ModelArray} object. |
78 | 80 | #' |
79 | 81 | #' @details |
80 | 82 | #' The constructor reads each scalar listed in \code{scalar_types} from |
81 | | -#' \code{/scalars/<scalar_type>/values} in the HDF5 file, wrapping them as |
82 | | -#' \linkS4class{DelayedArray} objects for lazy access. Source filenames are |
83 | | -#' extracted from HDF5 attributes or companion datasets. |
| 83 | +#' \code{/scalars/<scalar_type>/values}, wrapping them as |
| 84 | +#' \linkS4class{DelayedArray} objects. Source filenames are extracted |
| 85 | +#' from HDF5 attributes or companion datasets. |
84 | 86 | #' |
85 | | -#' If \code{analysis_names} is non-empty, saved results are read from |
86 | | -#' \code{/results/<name>/results_matrix} along with column name metadata. |
| 87 | +#' If \code{analysis_names} is non-empty, saved results are loaded from |
| 88 | +#' \code{/results/<name>/results_matrix}. |
87 | 89 | #' |
88 | 90 | #' \strong{Debugging tip:} If you encounter |
89 | | -#' \code{"Error in h(simpleError(msg, call)) : error in evaluating the |
90 | | -#' argument 'seed'..."}, check that \code{scalar_types} matches the groups |
91 | | -#' present in the file. Inspect with \code{rhdf5::h5ls(filepath)}. |
| 91 | +#' \code{"error in evaluating the argument 'seed'..."}, check that |
| 92 | +#' \code{scalar_types} matches groups in the file. Inspect with |
| 93 | +#' \code{rhdf5::h5ls(filepath)}. |
92 | 94 | #' |
93 | | -#' @param filepath Character. Path to an existing HDF5 (\code{.h5}) file |
94 | | -#' containing element-wise scalar data. |
95 | | -#' @param scalar_types Character vector. Names of scalar groups to read from |
96 | | -#' \code{/scalars/} in the HDF5 file. Default is \code{c("FD")}. Must match |
97 | | -#' group names in the file; verify with \code{rhdf5::h5ls(filepath)}. |
| 95 | +#' @param filepath Character. Path to an existing HDF5 (\code{.h5}) |
| 96 | +#' file containing element-wise scalar data. |
| 97 | +#' @param scalar_types Character vector. Names of scalar groups to read |
| 98 | +#' from \code{/scalars/} in the HDF5 file. Default is \code{c("FD")}. |
| 99 | +#' Must match group names in the file. |
98 | 100 | #' @param analysis_names Character vector. Subfolder names under |
99 | | -#' \code{/results/} to load. Default is \code{character(0)} (no results |
100 | | -#' loaded). |
| 101 | +#' \code{/results/} to load. Default is \code{character(0)} (none). |
101 | 102 | #' |
102 | 103 | #' @return A \linkS4class{ModelArray} object. |
103 | 104 | #' |
104 | 105 | #' @seealso \linkS4class{ModelArray} for the class definition, |
105 | | -#' \code{\link{h5summary}} for inspecting an HDF5 file without loading, |
106 | | -#' \code{\link{scalars}}, \code{\link{sources}} for accessing loaded data. |
| 106 | +#' \code{\link{h5summary}} for inspecting an HDF5 file. |
107 | 107 | #' |
108 | 108 | #' @examples |
109 | 109 | #' \dontrun{ |
110 | 110 | #' ma <- ModelArray("path/to/data.h5", scalar_types = c("FD", "FC")) |
111 | 111 | #' ma |
112 | | -#' scalars(ma) |
113 | 112 | #' } |
114 | 113 | #' |
| 114 | +#' @rdname ModelArray |
| 115 | +#' @aliases ModelArray |
115 | 116 | #' @export |
116 | 117 | #' @import methods |
117 | 118 | #' @importFrom dplyr %>% |
118 | 119 | #' @importFrom DelayedArray DelayedArray realize |
119 | 120 | #' @importFrom rhdf5 h5readAttributes |
120 | | -modelarray <- function(filepath, |
| 121 | +ModelArray <- function(filepath, |
121 | 122 | scalar_types = c("FD"), |
122 | 123 | analysis_names = character(0)) { |
123 | 124 | # TODO: try and use hdf5r instead of rhdf5 and delayedarray here |
|
0 commit comments