Skip to contents

Reads nodes, points, edges, and group membership from a set object produced by rENA::model() (tma pipeline) and returns a ModelData list ready for rendering.

Usage

qe_extract(
  set,
  directed = NULL,
  id_col = "ENA_UNIT",
  node_id_col = "code",
  group_col = "Condition"
)

Arguments

set

A model set object from rENA::model() or ona::model().

directed

Logical, or NULL (default). When NULL, directionality is detected automatically: sets with class "ena.ordered.set" (ONA) are treated as directed; standard ENA sets are treated as undirected. Pass TRUE or FALSE explicitly only if you need to override the default.

id_col

Unit-ID column name in the set's meta/points frames.

node_id_col

Code-ID column name in the nodes frame.

group_col

Group column name.

Value

A ModelData list (see qe_model_data()).

Details

The set object must expose:

  • set$rotation$nodes — code positions data.frame with a code column

  • set$points — unit positions data.frame with ENA_UNIT, Condition, and rotated-dimension columns

  • set$line.weights — edge-weight columns (one per code pair)

  • set$meta.data — unit metadata including ENA_UNIT, Condition

Edge column names are normalised: " & " separators are replaced with "." so qeviz's edge parser can resolve them (e.g. "Data & Collab" becomes "Data.Collab").

Examples

if (FALSE) { # \dontrun{
library(tma); library(rENA)
data(RS.data)
result <- tma::accumulate(tensor, codes = codes,
                          context_model = ctx, ordered = FALSE)
ena_set   <- rENA::model(result)
ena_model <- qe_extract(ena_set, directed = FALSE)
qe_plot(ena_model)
} # }