% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/ggNetView_multi.R
\name{ggNetView_multi}
\alias{ggNetView_multi}
\title{Visualize network with custom layouts in different samples}
\usage{
ggNetView_multi(
  mat,
  group_info,
  transfrom.method = c("none", "scale", "center", "log2", "log10", "ln", "rrarefy",
    "rrarefy_relative"),
  r.threshold = 0.7,
  p.threshold = 0.05,
  method = c("WGCNA", "SpiecEasi", "SPARCC", "cor"),
  cor.method = c("pearson", "kendall", "spearman"),
  proc = c("holm", "hochberg", "hommel", "bonferroni", "BH", "BY", "fdr", "none"),
  module.method = c("Fast_greedy", "Walktrap", "Edge_betweenness", "Spinglass"),
  SpiecEasi.method = c("mb", "glasso"),
  sparcc_R = 20,
  node_annotation = NULL,
  top_modules = 15,
  layout = NULL,
  node_add = 7,
  ring_n = NULL,
  r = 1,
  center = TRUE,
  idx = NULL,
  shrink = 1,
  inner_shrink = 1,
  k_nn = 12,
  push_others_delta = 0,
  layout.module = c("random", "adjacent", "order"),
  shape = 21,
  pointalpha = 1,
  pointsize = c(1, 10),
  pointstroke = 0.3,
  pointlabel = NULL,
  pointlabelsize = 5,
  group.by = "Modularity",
  fill.by = "Modularity",
  color.by = NULL,
  fill = NULL,
  color = NULL,
  jitter = FALSE,
  jitter_sd = 0.1,
  plot_line = TRUE,
  mapping_line = FALSE,
  curve = F,
  curvature = 0.25,
  linealpha = 0.25,
  linecolor = "grey70",
  label = FALSE,
  labelsize = 10,
  labelsegmentsize = 1,
  labelsegmentalpha = 1,
  add_group_outer = FALSE,
  add_group_outer_expand = 2,
  add_group_outer_color = "grey50",
  add_group_outer_fill = NULL,
  add_group_outer_fill_alpha = 0.2,
  add_group_outer_linetype = 1,
  add_group_outer_linewidth = 0.5,
  add_outer = FALSE,
  q_outer = 0.88,
  expand_outer = 1.02,
  bandwidth_scale = 1,
  outerwidth = 1.25,
  outerlinetype = 2,
  outeralpha = 0.5,
  nodelabsize = 5,
  remove = FALSE,
  dropOthers = FALSE,
  orientation = "up",
  angle = 0,
  scale = T,
  anchor_dist = 6,
  layout_nrow = NULL,
  layout_ncol = NULL,
  seed = 1115,
  nrow = NULL,
  ncol = NULL
)
}
\arguments{
\item{mat}{Numeric matrix.
A numeric matrix with samples in rows and variables in columns.}

\item{group_info}{DataFrame
The group information contains: Sample and Group}

\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{r.threshold}{Numeric.
Correlation coefficient threshold; edges are kept only if |r| >= r.threshold.}

\item{p.threshold}{p.threshold
Significance threshold for correlations; edges are kept only if p < p.threshold.}

\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{proc}{Character.
Correlation p-value adjustment methods.
Options include:
"holm", "hochberg", "hommel", "bonferroni",
"BH", "BY", "fdr", and "none".}

\item{module.method}{Character.
Network community detection (module identification) method.
Options include "Fast_greedy", "Walktrap", "Edge_betweenness", and "Spinglass".}

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

\item{sparcc_R}{Integer.
Number of bootstrap/permutation replicates for SparCC p-values (when \code{method = "SPARCC"}).
Default 20.}

\item{node_annotation}{Data frame.
Optional node annotation table, containing metadata such as taxonomy or functional categories.}

\item{top_modules}{Integer.
Number of top-ranked modules to retain for downstream visualization or analysis.}

\item{layout}{Character string.
Custom layouts; one of "gephi", "square", "square2", "petal",
"petal2", "heart_centered","diamond", "star", "star_concentric","rectangle,
"rightiso_layers" etc.}

\item{node_add}{Integer (default = 7).
Number of nodes to add in each layer of the layout.}

\item{ring_n}{Numeric (default = 7)
Numbers of ring in rings layout.}

\item{r}{Numeric (default = 1).
Radius increment for concentric or layered layouts.}

\item{center}{Logical (default = TRUE).
Whether to place a node at the center of the layout.}

\item{idx}{Optional.
Index of nodes to be emphasized or centered in the layout}

\item{shrink}{Numeric (default = 1).
Shrinkage factor applied to the center points.}

\item{inner_shrink}{Numeric (default = 1).
Intra-module compactness factor for \code{layout = "WGCNA"} only.
See \code{\link{ggNetView}} for details.  Ignored by other layouts.}

\item{k_nn}{Numeric (default = 8).
Number of nearest neighbors used to build the local adjacency graph.}

\item{push_others_delta}{Numeric (default = 0).
Radial offset applied to the "Others" module to slightly}

\item{layout.module}{Character  (default = "random")
- random : modules are distributed more randomly and independently.
- adjacent : modules are positioned close to each other, minimizing inter-module gaps.
- order : modules are distributed by order, applicable to `Bipartite, Tripartite, Quadripartite, Multipartite, Pentapartite Layout`}

\item{shape}{Integer  (default = 21).
The point shape likely in ggplot2.}

\item{pointalpha}{Integer  (default = 1).
The point alpha}

\item{pointsize}{Vector (default =  c(1,10))
The point size rang.}

\item{pointstroke}{Integer  (default = 0.3).}

\item{pointlabel}{Character (default = NULL).
Optional node label mode for top Degree nodes within each module.
Supported values: \code{"topN"} (e.g. \code{"top1"}, \code{"top7"}, \code{"top20"})
and \code{"ALL"}.}

\item{pointlabelsize}{Integer (default = 5).
Change point label size.}

\item{group.by}{Character (default = "Modularity").
Change group for nodes}

\item{fill.by}{Character (default = "Modularity").
Change fill for nodes}

\item{color.by}{Character (default = NULL).
Change color for nodes}

\item{fill}{Named vector of colors for node fill.
If \code{NULL} (default), uses \code{scale_fill_ggnetview}; if provided, uses \code{scale_fill_manual(values = fill)}.}

\item{color}{Named vector of colors for node/edge/label color.
If \code{NULL} (default), uses \code{scale_color_ggnetview}; if provided, uses \code{scale_color_manual(values = color)}.}

\item{jitter}{Logical (default = FALSE).
Whether to apply jitter to points.}

\item{jitter_sd}{Integer  (default = 0.1).
The standard deviation of the jitter applied when `jitter = TRUE`.}

\item{plot_line}{Logical (default = TRUE).
Whether to plot line in net plot.}

\item{mapping_line}{Logical (default = FALSE).
Whether to mapping line in ggNetView.}

\item{curve}{Logical (default = FALSE).
Whether to plot curve line in net plot.}

\item{curvature}{Integer (default = 0.25)
The curve level of curve line when curve is TRUE}

\item{linealpha}{Integer  (default = 0.25).
Change  line alpha.}

\item{linecolor}{Character  (default = "grey70").
Change  line color.}

\item{label}{Logical or Character (default = FALSE).
Whether to display module labels. If a character string, used as legend prefix.}

\item{labelsize}{Integer  (default = 10).
Change Module label size.}

\item{labelsegmentsize}{Integer  (default = 1).
Change  label segment size.}

\item{labelsegmentalpha}{Integer  (default = 1).
Change  label segment alpha.}

\item{add_group_outer}{Logical (default = FALSE).
Whether to add a circle boundary around the entire network (mimics \code{ggforce::geom_mark_circle}).}

\item{add_group_outer_expand}{Numeric (default = 2).
Expansion in mm for the group circle; passed to \code{geom_mark_circle(expand = ...)}.}

\item{add_group_outer_color}{Character (default = "grey50").
Color of the group outer circle border.}

\item{add_group_outer_fill}{Character or NULL (default = NULL).
Fill color of the group outer circle. \code{NULL} = no fill (transparent).}

\item{add_group_outer_fill_alpha}{Numeric (default = 0.2).
Alpha (transparency) of the group outer circle fill.}

\item{add_group_outer_linetype}{Integer or character (default = 1).
Linetype of the group outer circle (e.g. 1 = solid, 2 = dashed).}

\item{add_group_outer_linewidth}{Numeric (default = 0.5).
Line width of the group outer circle.}

\item{add_outer}{Logical (default = FALSE).
Whether to draw a smooth outer boundary around each module (KDE + HDR
contour). See \code{\link{ggNetView}} for full details.}

\item{q_outer}{Numeric (default = 0.88).
HDR coverage of the outer boundary (fraction of the module's empirical
probability mass enclosed by the contour).}

\item{expand_outer}{Numeric (default = 1.02).
Multiplicative scaling applied to each polygon from its own centroid.}

\item{bandwidth_scale}{Numeric (default = 1.0).
Multiplier on the robust normal-reference 2D KDE bandwidth used to build
the outer boundary.}

\item{outerwidth}{Integer  (default = 1.25).
Change  outer linewidth.}

\item{outerlinetype}{Integer  (default = 2).
Change  outer linetype.}

\item{outeralpha}{Integer  (default = 0.5).
Change  outer alpha.}

\item{nodelabsize}{Integer  (default = 5).
Change  node label size.}

\item{remove}{Logical (default = FALSE).
Remove nodes that are not modules.}

\item{dropOthers}{Logical (default = FALSE).
If TRUE, remove nodes in the \code{"Others"} module before layout and visualization.}

\item{orientation}{Character string.
Custom orientation; one of "up","down","left","right".}

\item{angle}{Integer  (default = 0).
Change  orientation angle.}

\item{scale}{Logical  (default = T).
modules applicable to `Bipartite, Tripartite, Quadripartite, Multipartite, Pentapartite Layout` to scale the radius}

\item{anchor_dist}{Integer (default = 6)
the distance of each modules, applicable to `Bipartite, Tripartite, Quadripartite, Multipartite, Pentapartite Layout`}

\item{layout_nrow}{Integer (default = NULL).
Number of layout rows passed to \code{ggNetView} when using consensus-module grid layouts.}

\item{layout_ncol}{Integer (default = NULL).
Number of layout columns passed to \code{ggNetView} when using consensus-module grid layouts.}

\item{seed}{Integer (default = 1115).
Random seed for reproducibility.}

\item{nrow}{Integer (default = NULL).
Number of rows in the combined patchwork plot.}

\item{ncol}{Integer (default = NULL).
Number of columns in the combined patchwork plot.}
}
\value{
A ggplot object representing the network visualization.
}
\description{
Visualize network with custom layouts in different samples
}
\examples{
\dontrun{
# `mat` is a numeric matrix (features x samples) and
# `group_info` is a data frame with columns Sample and Group.
p <- ggNetView_multi(
  mat        = mat,
  group_info = group_info,
  method     = "cor",
  layout     = "fr"
)
}
}
