% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/tme_cluster.R
\name{tme_cluster}
\alias{tme_cluster}
\title{Identification of TME Cluster}
\usage{
tme_cluster(
  input,
  features = NULL,
  pattern = NULL,
  id = NULL,
  scale = TRUE,
  method = "kmeans",
  min_nc = 2,
  max.nc = 6
)
}
\arguments{
\item{input}{Data frame containing the input dataset.}

\item{features}{Vector of features to use for clustering. Default is NULL
(uses all columns or pattern-selected columns).}

\item{pattern}{Regular expression pattern for selecting features.
Default is NULL.}

\item{id}{Column name for identifiers. Default is NULL (uses row names).}

\item{scale}{Logical indicating whether to scale features. Default is TRUE.}

\item{method}{Clustering method. Default is "kmeans".}

\item{min_nc}{Minimum number of clusters to evaluate. Default is 2.}

\item{max.nc}{Maximum number of clusters to evaluate. Default is 6.}
}
\value{
Data frame with cluster assignments appended.
}
\description{
Performs TME (Tumor Microenvironment) clustering analysis using various
clustering methods. Supports feature selection, scaling, and automatic
determination of optimal cluster number.
}
\examples{
set.seed(123)
input_data <- data.frame(
  ID = paste0("Sample", 1:20),
  xCell_Tcells = rnorm(20),
  xCell_Bcells = rnorm(20),
  xCell_Macrophages = rnorm(20),
  Other_feature = rnorm(20)
)
result <- tme_cluster(
  input = input_data,
  pattern = "xCell",
  id = "ID",
  method = "kmeans"
)
table(result$cluster)
}
\author{
Dongqiang Zeng
}
