% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/ggNetView_RMT.R
\name{ggNetView_RMT}
\alias{ggNetView_RMT}
\title{One-shot, non-interactive RMT threshold scan with auto selection}
\usage{
ggNetView_RMT(
  mat,
  transfrom.method = c("none", "scale", "center", "log2", "log10", "ln", "rrarefy",
    "rrarefy_relative"),
  method = c("WGCNA", "SpiecEasi", "SPARCC", "cor"),
  cor.method = c("pearson", "kendall", "spearman"),
  SpiecEasi.method = c("mb", "glasso"),
  nr_thresholds = 51,
  interval = NULL,
  unfold.method = c("gaussian", "spline"),
  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,
  seed = 1115
)
}
\arguments{
\item{mat}{Numeric matrix.
A numeric matrix with samples in colums and variables in rows}

\item{transfrom.method}{Character.
Data transformation methods applied before correlation analysis.
Options include:
"none" (raw data),
"scale" (z-score standardization),
"center" (mean centering only),
"log2" (log2 transfrom),
"log10" (log10 transfrom),
"ln" (natural transfrom ),
"rrarefy" (random rarefaction using \code{vegan::rrarefy}),
"rrarefy_relative" (rarefy then convert to relative abundance).}

\item{method}{Character.
Relationship analysis methods.
Options include: "WGCNA", "SpiecEasi", "SPARCC" and "cor".}

\item{cor.method}{Character.
Correlation analysis method.
Options include "pearson", "kendall", and "spearman".}

\item{SpiecEasi.method}{Character.
Method used in \code{SpiecEasi} network inference; options include "mb" and "glasso".}

\item{nr_thresholds}{Integer. Number of thresholds to scan (default 51).}

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

\item{unfold.method}{"gaussian" or "spline" (default "gaussian").}

\item{bandwidth}{Bandwidth for gaussian unfolding (passed to stats::density), default "nrd0".}

\item{nr.fit.points}{Integer, number of support points for spline unfolding (default 51).}

\item{discard.outliers}{Logical. Remove eigenvalue outliers via IQR before unfolding (default TRUE).}

\item{discard.zeros}{Logical. Drop all-zero rows/cols after thresholding (default TRUE).}

\item{min.mat.dim}{Integer. Early stop if effective dim < this (default 40).}

\item{max.ev.spacing}{Numeric. Cutoff for spacing tail when computing NNSD metrics (default 3).}

\item{save_plots}{Logical. Save PNGs (non-interactive) into out_dir (default FALSE).}

\item{out_dir}{Character. Output directory for plots (default "RMT_plots").}

\item{verbose}{Logical. Print progress (default TRUE).}

\item{seed}{Integer (default = 1115).
Random seed for reproducibility.}
}
\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).
}
\description{
One-shot, non-interactive RMT threshold scan with auto selection
}
\examples{
\dontrun{
set.seed(1)
m <- stats::cor(scale(matrix(stats::rnorm(40000), 200, 200)))
rownames(m) <- colnames(m) <- paste0("g", seq_len(200))
res <- ggNetView_RMT(m, method = "cor")
res$chosen_threshold
}
}
