Skip to content

Commit 568479a

Browse files
committed
Built site for ModelArray@0.1.5: 7a39f02
1 parent b3953a3 commit 568479a

8 files changed

Lines changed: 214 additions & 21 deletions

File tree

llms.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ If you use ModelArray, please cite:
124124
## All functions
125125

126126
- [`ModelArray()`](https://pennlinc.github.io/ModelArray/reference/ModelArray.md)
127-
: Construct a ModelArray object
127+
: ModelArray class
128128
- [`ModelArray.gam()`](https://pennlinc.github.io/ModelArray/reference/ModelArray.gam.md)
129129
: Run GAM for element-wise data
130130
- [`ModelArray.lm()`](https://pennlinc.github.io/ModelArray/reference/ModelArray.lm.md)

pkgdown.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ articles:
1212
installations: installations.html
1313
modelling: modelling.html
1414
walkthrough: walkthrough.html
15-
last_built: 2026-03-27T22:38Z
15+
last_built: 2026-03-28T00:35Z
1616
urls:
1717
reference: https://pennlinc.github.io/ModelArray/reference
1818
article: https://pennlinc.github.io/ModelArray/articles

reference/ModelArray-class.html

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<html>
2+
<head>
3+
<meta http-equiv="refresh" content="0;URL=https://pennlinc.github.io/ModelArray/reference/ModelArray.html" />
4+
<meta name="robots" content="noindex">
5+
<link rel="canonical" href="https://pennlinc.github.io/ModelArray/reference/ModelArray.html">
6+
</head>
7+
</html>
8+

reference/ModelArray.html

Lines changed: 102 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

reference/ModelArray.md

Lines changed: 99 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,120 @@
1-
# Construct a ModelArray object
1+
# ModelArray class
22

3-
Load element-wise data from an .h5 file as a \`ModelArray\` object.
3+
A ModelArray wraps one or more element-wise scalar matrices (e.g., FD,
4+
FC, log_FC for fixel data) read lazily via DelayedArray, along with any
5+
previously saved analysis results. The object holds references to the
6+
underlying HDF5 file and reads data on demand, making it suitable for
7+
large-scale neuroimaging datasets.
8+
9+
Reads scalar matrices and (optionally) saved analysis results from an
10+
HDF5 file and returns a ModelArray object.
411

512
## Usage
613

714
``` r
15+
ModelArray(filepath, scalar_types = c("FD"), analysis_names = character(0))
16+
817
ModelArray(filepath, scalar_types = c("FD"), analysis_names = character(0))
918
```
1019

1120
## Arguments
1221

1322
- filepath:
1423

15-
Path to an .h5 file
24+
Character. Path to an existing HDF5 (`.h5`) file containing
25+
element-wise scalar data.
1626

1727
- scalar_types:
1828

19-
Expected scalars
29+
Character vector. Names of scalar groups to read from `/scalars/` in
30+
the HDF5 file. Default is `c("FD")`. Must match group names in the
31+
file; verify with `rhdf5::h5ls(filepath)`.
2032

2133
- analysis_names:
2234

23-
The subfolder names for results in the .h5 file. If empty (default),
24-
results are not read.
35+
Character vector. Subfolder names under `/results/` to load. Default
36+
is `character(0)` (no results loaded).
2537

2638
## Value
2739

28-
A \`ModelArray\` object
40+
A ModelArray object.
41+
42+
## Details
43+
44+
ModelArray is an S4 class that represents element-wise scalar data and
45+
associated statistical results backed by an HDF5 file on disk.
46+
47+
Each scalar in the HDF5 file is stored at `/scalars/<name>/values` as a
48+
matrix of elements (rows) by source files (columns). Source filenames
49+
are read from HDF5 attributes or companion datasets. Analysis results,
50+
if present, live under `/results/<analysis_name>/results_matrix`.
51+
52+
ModelArray objects are typically created with the `ModelArray`
53+
constructor function. Element-wise models are fit with
54+
[`ModelArray.lm`](https://pennlinc.github.io/ModelArray/reference/ModelArray.lm.md),
55+
[`ModelArray.gam`](https://pennlinc.github.io/ModelArray/reference/ModelArray.gam.md),
56+
or
57+
[`ModelArray.wrap`](https://pennlinc.github.io/ModelArray/reference/ModelArray.wrap.md).
58+
59+
The constructor reads each scalar listed in `scalar_types` from
60+
`/scalars/<scalar_type>/values` in the HDF5 file, wrapping them as
61+
DelayedArray objects for lazy access. Source filenames are extracted
62+
from HDF5 attributes or companion datasets.
63+
64+
If `analysis_names` is non-empty, saved results are read from
65+
`/results/<name>/results_matrix` along with column name metadata.
66+
67+
**Debugging tip:** If you encounter
68+
`"Error in h(simpleError(msg, call)) : error in evaluating the argument 'seed'..."`,
69+
check that `scalar_types` matches the groups present in the file.
70+
Inspect with `rhdf5::h5ls(filepath)`.
71+
72+
## Slots
73+
74+
- `sources`:
75+
76+
A named list of character vectors. Each element corresponds to a
77+
scalar and contains the source filenames (one per input file/subject).
78+
79+
- `scalars`:
80+
81+
A named list of DelayedArray matrices. Each matrix has elements as
82+
rows and source files as columns.
83+
84+
- `results`:
85+
86+
A named list of analysis results. Each element is itself a list
87+
containing at minimum `results_matrix` (a DelayedArray).
88+
89+
- `path`:
90+
91+
Character. Path(s) to the HDF5 file(s) on disk.
92+
93+
## See also
94+
95+
`ModelArray` for the constructor,
96+
[`ModelArray.lm`](https://pennlinc.github.io/ModelArray/reference/ModelArray.lm.md),
97+
[`ModelArray.gam`](https://pennlinc.github.io/ModelArray/reference/ModelArray.gam.md),
98+
[`ModelArray.wrap`](https://pennlinc.github.io/ModelArray/reference/ModelArray.wrap.md)
99+
for analysis,
100+
[`scalars`](https://pennlinc.github.io/ModelArray/reference/scalars.md),
101+
[`sources`](https://pennlinc.github.io/ModelArray/reference/sources.md),
102+
[`results`](https://pennlinc.github.io/ModelArray/reference/results.md)
103+
for accessors.
104+
105+
ModelArray for the class definition,
106+
[`h5summary`](https://pennlinc.github.io/ModelArray/reference/h5summary.md)
107+
for inspecting an HDF5 file without loading,
108+
[`scalars`](https://pennlinc.github.io/ModelArray/reference/scalars.md),
109+
[`sources`](https://pennlinc.github.io/ModelArray/reference/sources.md)
110+
for accessing loaded data.
111+
112+
## Examples
113+
114+
``` r
115+
if (FALSE) { # \dontrun{
116+
ma <- ModelArray("path/to/data.h5", scalar_types = c("FD", "FC"))
117+
ma
118+
scalars(ma)
119+
} # }
120+
```

reference/index.html

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

reference/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
## All functions
44

55
- [`ModelArray()`](https://pennlinc.github.io/ModelArray/reference/ModelArray.md)
6-
: Construct a ModelArray object
6+
: ModelArray class
77
- [`ModelArray.gam()`](https://pennlinc.github.io/ModelArray/reference/ModelArray.gam.md)
88
: Run GAM for element-wise data
99
- [`ModelArray.lm()`](https://pennlinc.github.io/ModelArray/reference/ModelArray.lm.md)

search.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)