Skip to contents

One-shot, non-interactive RMT threshold scan with auto selection

Usage

ggNetView_RMT(
  mat,
  nr_thresholds = 51,
  interval = NULL,
  unfold.method = c("gaussian", "spline"),
  method = c("WGCNA", "SpiecEasi", "SPARCC", "cor"),
  bandwidth = "nrd0",
  nr.fit.points = 51,
  discard.outliers = TRUE,
  discard.zeros = TRUE,
  min.mat.dim = 40,
  max.ev.spacing = 3,
  save_plots = FALSE,
  out_dir = "RMT_plots",
  verbose = TRUE
)

Arguments

mat

Numeric, symmetric, square matrix (e.g., correlation or weighted adjacency).

nr_thresholds

Integer. Number of thresholds to scan (default 51).

interval

Optional numeric length-2 vector [min, max] for scanning range over |mat| upper triangle (default auto).

unfold.method

"gaussian" or "spline" (default "gaussian"). #' @param method Character. Relationship analysis methods. Options include: "WGCNA", "SpiecEasi", "SPARCC" and "cor".

bandwidth

Bandwidth for gaussian unfolding (passed to stats::density), default "nrd0".

nr.fit.points

Integer, number of support points for spline unfolding (default 51).

discard.outliers

Logical. Remove eigenvalue outliers via IQR before unfolding (default TRUE).

discard.zeros

Logical. Drop all-zero rows/cols after thresholding (default TRUE).

min.mat.dim

Integer. Early stop if effective dim < this (default 40).

max.ev.spacing

Numeric. Cutoff for spacing tail when computing NNSD metrics (default 3).

save_plots

Logical. Save PNGs (non-interactive) into out_dir (default FALSE).

out_dir

Character. Output directory for plots (default "RMT_plots").

verbose

Logical. Print progress (default TRUE).

Value

A list with: chosen_threshold, chosen_reason, tested_thresholds, scores (data.frame), unfolded (last-step unfolding), meta (matrix info & params), plots (file paths if saved).

Examples

NULL
#> NULL


# m <- cor(scale(matrix(rnorm(40000), 200, 200)))
# res <- ggNetView_RMT(m, save_plots=TRUE)
# res$chosen_threshold