% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/sig_surv_plot.R
\name{sig_surv_plot}
\alias{sig_surv_plot}
\title{Generate Kaplan-Meier Survival Plot for Signature}
\usage{
sig_surv_plot(
  input_pdata,
  signature,
  project = "KM",
  ID = "ID",
  time = "time",
  status = "status",
  time_type = "month",
  break_month = "auto",
  cols = NULL,
  palette = "jama",
  show_col = TRUE,
  mini_sig = "score",
  fig.type = "png",
  save_path = NULL,
  index = 1
)
}
\arguments{
\item{input_pdata}{Data frame with survival data and signature scores.}

\item{signature}{Character string. Column name of the target signature.}

\item{project}{Character string. Project name for output. Default is `"KM"`.}

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

\item{time}{Character string. Column name for survival time. Default is `"time"`.}

\item{status}{Character string. Column name for survival status. Default is `"status"`.}

\item{time_type}{Character string. Time unit (`"month"` or `"day"`).
Default is `"month"`.}

\item{break_month}{Numeric or `"auto"`. Time axis breaks. Default is `"auto"`.}

\item{cols}{Character vector. Optional custom colors.}

\item{palette}{Character string. Color palette if `cols` not provided.
Default is `"jama"`.}

\item{show_col}{Logical indicating whether to show colors. Default is `TRUE`.}

\item{mini_sig}{Character string. Label for low score group. Default is `"score"`.}

\item{fig.type}{Character string. File format. Default is `"png"`.}

\item{save_path}{Character string or `NULL`. Directory for saving plots.
If `NULL`, plots are not saved. Default is `NULL`.}

\item{index}{Integer. Index for multiple plots. Default is `1`.}
}
\value{
A list containing:
\describe{
  \item{data}{Processed input data with group assignments}
  \item{plots}{Combined survival plots}
}
}
\description{
Creates Kaplan-Meier survival plots for a given signature or gene, with
automatic cutoff determination. Generates three types of plots: optimal
cutoff (best cutoff), tertile-based (3 groups), and median split (2 groups).
}
\examples{
# Create small example data
set.seed(123)
test_data <- data.frame(
  time = runif(100, 0, 100),
  OS_status = sample(c(0, 1), 100, replace = TRUE),
  TMEscore_plus = rnorm(100),
  ID = paste0("S", 1:100)
)
sig_surv_plot(
  input_pdata = test_data,
  signature = "TMEscore_plus",
  time = "time",
  status = "OS_status"
)
}
\author{
Dongqiang Zeng
}
