get_selected_Z: Extract selected (retained) omics features from a fitted...

View source: R/model_extractors.R

get_selected_ZR Documentation

Extract selected (retained) omics features from a fitted LUCID model

Description

Reads model$select$selectZ, auto-detecting the model type from class(model) and collapsing any per-cluster selection matrix (a parallel-model layer's selectZ can be a K x M matrix rather than a plain vector) to one logical value per feature via an internal helper. Unlike exposure selection, every stage of a serial model has a meaningful omics selection, so this returns a per-stage breakdown rather than one stage's alone.

Usage

get_selected_Z(model, layer = NULL, stage = NULL)

Arguments

model

A fitted early_lucid, lucid_parallel, or lucid_serial object.

layer

For a parallel model (or a serial stage that is itself a parallel sub-model): which layer's own omics selection to return. If NULL (the default), returns a named list, one entry per layer.

stage

For a serial model only: which stage's own omics selection to return. If NULL (the default), returns a named list, one entry per stage (each shaped like this function's early/parallel return, depending on that stage's own type).

Value

A named logical vector (early; parallel with layer given), a named list of logical vectors (parallel with layer = NULL), or a named list of per-stage results (serial).

Examples

idx <- 1:200
G <- sim_data$G[idx, ]
Z <- sim_data$Z[idx, ]
Y_normal <- sim_data$Y_normal[idx, ]
fit <- estimate_lucid(G = G, Z = Z, Y = Y_normal, lucid_model = "early",
                      family = "normal", K = 2, Rho_Z_Mu = 5,
                      max_itr = 10, max_tot.itr = 30)
get_selected_Z(fit)

LUCIDus documentation built on Sept. 3, 2026, 1:06 a.m.