% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/find_outlier_samples.R
\name{find_outlier_samples}
\alias{find_outlier_samples}
\title{Identify Outlier Samples in Gene Expression Data}
\usage{
find_outlier_samples(
  eset,
  yinter = -3,
  project = NULL,
  plot_hculst = FALSE,
  show_plot = TRUE,
  index = NULL,
  save = FALSE
)
}
\arguments{
\item{eset}{Numeric matrix. Gene expression data with genes as rows and
samples as columns.}

\item{yinter}{Numeric. Z-score threshold for identifying outliers.
Default is -3.}

\item{project}{Character or `NULL`. Output directory path for saving plots.
Required if `save = TRUE`. Default is `NULL`.}

\item{plot_hculst}{Logical. Whether to plot hierarchical clustering.
Default is `FALSE`.}

\item{show_plot}{Logical. Whether to display the connectivity plot.
Default is `TRUE`.}

\item{index}{Integer or `NULL`. Index for output file naming.
Default is `NULL`.}

\item{save}{Logical. Whether to save plots to files. Default is `FALSE`.}
}
\value{
Character vector of sample names identified as potential outliers.
}
\description{
Analyzes gene expression data to identify potential outlier samples using
connectivity analysis via the WGCNA package. Calculates normalized
adjacency and connectivity z-scores for each sample, generates connectivity
plots, and optionally performs hierarchical clustering.
}
\examples{
# Simulate data
set.seed(123)
sim_eset <- matrix(rnorm(100 * 10), 100, 10)
rownames(sim_eset) <- paste0("Gene", 1:100)
colnames(sim_eset) <- paste0("Sample", 1:10)

# Add one extreme outlier
sim_eset[, 10] <- sim_eset[, 10] + 50

# Identify outliers
if (requireNamespace("WGCNA", quietly = TRUE)) {
  outs <- find_outlier_samples(eset = sim_eset, show_plot = FALSE)
  print(outs)
}
}
\author{
Dongqiang Zeng
}
