Skip to contents

Constructs an undirected feature–feature or feature–exposure correlation network from correlation results stored in a MultiAssayExperiment object. The function supports multiple correlation formats depending on feature_type, and stores or returns an igraph object with associated node and edge metadata.

Usage

run_create_network(
  expomicset,
  feature_type = c("degs", "omics", "factors", "factor_features", "exposures",
    "degs_feature_cor", "omics_feature_cor", "factor_features_feature_cor"),
  action = c("add", "get")
)

Arguments

expomicset

A MultiAssayExperiment object containing correlation results in metadata.

feature_type

Type of correlation result to convert to a network. One of: "degs", "omics", "factors", "factor_features", "exposures", "degs_feature_cor", "omics_feature_cor", or "factor_features_feature_cor".

action

Whether to "add" the network to the object or "get" it as a list.

Value

If action = "add", returns the updated MultiAssayExperiment with a new network entry in metadata. If action = "get", returns a list with graph (an igraph object) and summary (a tibble).

Details

The function detects the appropriate edge and node structure based on column names in the correlation results. Edge weights are based on correlation coefficients and include FDR values.

Examples

if (FALSE) { # \dontrun{
expomicset <- run_correlation(expomicset, feature_type = "omics", feature_cors = TRUE)
expomicset <- run_create_network(expomicset, feature_type = "omics_feature_cor")
net <- run_create_network(expomicset, feature_type = "omics_feature_cor", action = "get")
plot(net$graph)
} # }