% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/find_marker_in_bulk.R
\name{find_markers_in_bulk}
\alias{find_markers_in_bulk}
\title{Identify Marker Features in Bulk Expression Data}
\usage{
find_markers_in_bulk(
  pdata,
  eset,
  group,
  id_pdata = "ID",
  nfeatures = 2000,
  top_n = 20,
  thresh.use = 0.25,
  only.pos = TRUE,
  min.pct = 0.25,
  npcs = 30
)
}
\arguments{
\item{pdata}{Data frame. Sample metadata.}

\item{eset}{Matrix. Gene expression or signature score matrix.}

\item{group}{Character. Column name in pdata specifying grouping variable.}

\item{id_pdata}{Character. Column name for sample IDs. Default is "ID".}

\item{nfeatures}{Integer. Number of top variable features to select. Default is 2000.}

\item{top_n}{Integer. Number of top markers to retain per cluster. Default is 20.}

\item{thresh.use}{Numeric. Threshold for marker selection. Default is 0.25.}

\item{only.pos}{Logical. Whether to retain only positive markers. Default is TRUE.}

\item{min.pct}{Numeric. Minimum expression percentage threshold. Default is 0.25.}

\item{npcs}{Integer. Number of principal components to use. Default is 30.}
}
\value{
List with components: `sce` (Seurat object), `markers` (all markers), `top_markers` (top markers per group).
}
\description{
Identifies informative marker features across groups from bulk gene
expression or signature score matrices using Seurat workflows. Performs
feature selection, scaling, PCA, clustering, and marker discovery.
}
\examples{
if (requireNamespace("Seurat", quietly = TRUE) && requireNamespace("Matrix", quietly = TRUE)) {
  # Simulate data
  set.seed(123)
  sim_eset <- matrix(abs(rnorm(100 * 30)), 100, 30)
  rownames(sim_eset) <- paste0("Gene", 1:100)
  colnames(sim_eset) <- paste0("Sample", 1:30)
  
  sim_pdata <- data.frame(
    ID = paste0("Sample", 1:30),
    TMEcluster = rep(c("A", "B", "C"), each = 10)
  )
  
  res <- find_markers_in_bulk(
    pdata = sim_pdata, eset = sim_eset,
    group = "TMEcluster", npcs = 5
  )
  if (!is.null(res)) head(res$top_markers)
}
}
