% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/feature_selection.R
\name{feature_select}
\alias{feature_select}
\title{Feature Selection via Correlation or Differential Expression}
\usage{
feature_select(
  x,
  y,
  method = c("cor", "dif"),
  family = c("spearman", "pearson"),
  cutoff = NULL,
  padjcut = NULL
)
}
\arguments{
\item{x}{Numeric matrix. Features (rows) by samples (columns).}

\item{y}{Numeric or factor. Response vector (quantitative or binary).}

\item{method}{Character. "cor" (correlation) or "dif" (differential expression). Default c("cor","dif").}

\item{family}{Character. Correlation method if method = "cor": "spearman" or "pearson".}

\item{cutoff}{Numeric. Absolute correlation (for cor) or |log2FC| (for dif) threshold.}

\item{padjcut}{Numeric. Adjusted p-value cutoff.}
}
\value{
Character vector of selected feature names.
}
\description{
Selects informative features using either correlation with a quantitative
response or differential expression (limma) for binary/continuous
responses.
}
\examples{
# Simulate data
set.seed(123)
sim_eset <- matrix(rnorm(100 * 50), 100, 50)
rownames(sim_eset) <- c("PDCD1", paste0("Gene", 2:100))
colnames(sim_eset) <- paste0("Sample", 1:50)
pd1 <- as.numeric(sim_eset["PDCD1", ])
group <- ifelse(pd1 > mean(pd1), "high", "low")

# Correlation method
pd1_cor <- feature_select(
  x = sim_eset, y = pd1, method = "cor",
  family = "pearson", padjcut = 0.05, cutoff = 0.5
)

# Differential expression method
pd1_dif <- feature_select(
  x = sim_eset, y = pd1, method = "dif",
  padjcut = 0.05, cutoff = 2
)
pd1_dif_2 <- feature_select(
  x = sim_eset, y = group,
  method = "dif", padjcut = 0.05, cutoff = 2
)
}
