% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/get_sample_subgraph_topology.R
\name{get_sample_subgraph_topology}
\alias{get_sample_subgraph_topology}
\title{Create sample-level subgraph topology from a global network}
\usage{
get_sample_subgraph_topology(
  graph_obj,
  mat = NULL,
  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"),
  SpiecEasi.method = c("mb", "glasso"),
  sparcc_R = 20,
  bootstrap = 100
)
}
\arguments{
\item{graph_obj}{An graph object from \code{build_graph_from_mat} or
\code{build_graph_from_df}.}

\item{mat}{Numeric matrix used to build \code{graph_obj}. Rows are OTUs and
columns are samples.}

\item{transfrom.method}{Character. Passed to \code{get_network_topology()}.}

\item{r.threshold}{Numeric. Passed to \code{get_network_topology()}.}

\item{p.threshold}{Numeric. Passed to \code{get_network_topology()}.}

\item{method}{Character. Passed to \code{get_network_topology()}.}

\item{cor.method}{Character. Passed to \code{get_network_topology()}.}

\item{proc}{Character. Passed to \code{get_network_topology()}.}

\item{SpiecEasi.method}{Character. Passed to \code{get_network_topology()};
one of \code{"mb"} or \code{"glasso"} for SpiecEasi inverse-covariance.}

\item{sparcc_R}{Integer. Passed to \code{get_network_topology()} for SparCC p-values. Default 20.}

\item{bootstrap}{Numeric (default = 100). Passed to
\code{get_network_topology()}.}
}
\value{
A list with:
\itemize{
  \item \code{subgraph_list}: sample-wise \code{tbl_graph} subgraphs
  \item \code{topology}: merged sample-wise topology table
  \item \code{Robustness}: merged sample-wise robustness table
  \item \code{sample_stat}: sample-wise node/edge counts and status
}
}
\description{
For each sample (each column in \code{mat}), OTUs with non-zero abundance
are treated as present (\code{OTU != 0}). The function extracts a subgraph
from \code{graph_obj} using \code{igraph::subgraph()}, then computes topology
for each sample-specific subgraph via \code{get_network_topology()}.
}
\examples{
\dontrun{
# `mat` is the OTU/feature-by-sample matrix used to build `graph_obj`.
obj <- build_graph_from_mat(mat = mat, method = "cor")
res <- get_sample_subgraph_topology(
  graph_obj = obj,
  mat       = mat,
  bootstrap = 10
)
head(res$topology)
}
}
