List the assays present on a GDS (or that a reducer would produce)
Source:R/gds-class.R
list_assays.RdDiscoverability helper for finding assay names to pass to assay(),
write_nifti_assays(), or write_out() without having to run a job and
inspect names(assays(fit)). Works on a realised gds, a lazy
gds_plan/gds_source (reporting the input assays the source probed),
or—when reducer is supplied—reports a reducer's declared output stems
without computing anything.
Arguments
- x
A realised
gds, agds_plan, or agds_source.- reducer
Optional reducer name (e.g.
"meta:re","ols:voxelwise", or an alias like"random"). When supplied,xis ignored and the reducer's declaredprovidesstems are returned. Regression/LMM reducers expandcoef/se_coef/z_coef/t_coef/p_coefinto per-termcoef:<term>etc. at compute time, so realised names depend on the model formula.- info
Logical; if
TRUE(default) return a data frame withassay,role, andunitscolumns (fromassay_info()where registered, elseNA); ifFALSEreturn a plain character vector of names.
Examples
beta <- array(rnorm(5 * 4), c(5, 4, 1))
var <- array(1, c(5, 4, 1))
g <- new_gds(list(beta = beta, var = var), space_sample_labels(letters[1:5]),
subjects = paste0("s", 1:4), contrasts = "c1")
fit <- one_sample(g) |> compute()
list_assays(fit) # names + roles of computed assays
#> assay role units
#> 1 sigma2 <NA> <NA>
#> 2 df_res <NA> <NA>
#> 3 n_obs <NA> <NA>
#> 4 cov_tri <NA> <NA>
#> 5 coef:(Intercept) <NA> <NA>
#> 6 se_coef:(Intercept) <NA> <NA>
#> 7 t_coef:(Intercept) <NA> <NA>
#> 8 p_coef:(Intercept) <NA> <NA>
list_assays(reducer = "meta:re") # what random-effects would produce
#> assay role units
#> 1 beta_g <NA> <NA>
#> 2 var_g <NA> <NA>
#> 3 se_g <NA> <NA>
#> 4 z_g <NA> <NA>
#> 5 p_g <NA> <NA>
#> 6 tau2 <NA> <NA>
#> 7 Q <NA> <NA>
#> 8 I2 <NA> <NA>
#> 9 n_eff n_eff <NA>