% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/stats_tests.R
\name{gene.correlation.matrix}
\alias{gene.correlation.matrix}
\title{Compute Pairwise Gene Co-expression Correlation Matrix}
\usage{
gene.correlation.matrix(expression.matrix, probe.ids, method = "pearson")
}
\arguments{
\item{expression.matrix}{Numeric matrix of gene expression values as returned
by \code{extract.expression()$expression}. Rows are probes, columns are
samples.}

\item{probe.ids}{Integer vector of probe IDs to include, as returned by
\code{find.probe.by.gene()}.}

\item{method}{Character. Correlation method: \code{"pearson"} (default),
\code{"spearman"}, or \code{"kendall"}. Spearman is recommended when
distributions are skewed or outliers are a concern.}
}
\value{
A symmetric numeric matrix of dimensions \code{length(probe.ids)} x
\code{length(probe.ids)}, where each cell contains the pairwise correlation
coefficient across all samples. Diagonal values are 1. Row and column
names correspond to probe IDs.
}
\description{
Calculates pairwise correlations between a set of genes across all samples,
producing a symmetric correlation matrix that quantifies co-expression
relationships.
}
\details{
Co-expression correlations capture whether two genes tend to be
simultaneously up- or down-regulated across samples, which can suggest
shared regulatory control or pathway membership. The resulting matrix is
the direct input for \code{plot.correlation.heatmap()}.
}
\examples{
\donttest{
set.seed(42)
expr.mat <- matrix(rnorm(400), nrow = 4, ncol = 100)
rownames(expr.mat) <- c(101, 102, 103, 104)
probe.ids <- c(101, 102, 103, 104)
cor.mat <- gene.correlation.matrix(expr.mat, probe.ids)
correlation.heatmap.plot(cor.mat, gene.names = c("BRCA1", "TP53", "MYC", "EGFR"))
}

}
