Skip to contents

Convert correlation results into a bipartite network object.

Usage

build_correlation_network(
  object,
  min_abs_correlation = 0,
  max_q_value = 1,
  direction = c("any", "positive", "negative"),
  top_n = Inf,
  keep_isolated = FALSE
)

Arguments

object

A microbe_metabolite_association object.

min_abs_correlation

Minimum absolute correlation estimate.

max_q_value

Maximum q value.

direction

Direction of correlation to keep.

top_n

Maximum number of edges to keep.

keep_isolated

Whether isolated nodes should be kept.

Value

A microbe_metabolite_network object.

Examples

data("demo_crossomics", package = "microbiomedataset")

x <- calculate_correlation(
  microbiome_data = demo_crossomics$microbiome_data,
  metabolome_data = demo_crossomics$metabolome_data,
  sample_link = demo_crossomics$sample_link,
  metabolome_transform = "none"
)
y <- build_correlation_network(x, min_abs_correlation = 0.2, max_q_value = 0.5)
y
#> microbe_metabolite_network
#> Method: spearman
#> Microbiome rank: Genus
#> Nodes: 17
#> Edges: 10