% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/find_mutations.R
\name{find_mutations}
\alias{find_mutations}
\title{Analyze Mutations Related to Signature Scores}
\usage{
find_mutations(
  mutation_matrix,
  signature_matrix,
  id_signature_matrix = "ID",
  signature,
  min_mut_freq = 0.05,
  plot = TRUE,
  method = "multi",
  point_alpha = 0.1,
  save_path = NULL,
  palette = "jco",
  cols = NULL,
  show_plot = TRUE,
  show_col = FALSE,
  width = 8,
  height = 4,
  oncoprint_group_by = "mean",
  oncoprint_col = "#224444",
  gene_counts = 10,
  jitter = FALSE,
  genes = NULL,
  point_size = 4.5
)
}
\arguments{
\item{mutation_matrix}{A matrix of mutation data with samples in rows and genes in columns.}

\item{signature_matrix}{A data frame with sample identifiers and signature scores.}

\item{id_signature_matrix}{Column name in `signature_matrix` for sample identifiers.}

\item{signature}{Name of the target signature for analysis.}

\item{min_mut_freq}{Minimum mutation frequency required for gene inclusion. Default is 0.05.}

\item{plot}{Logical indicating whether to generate and save plots. Default is TRUE.}

\item{method}{Statistical test method: "multi" for both Cuzick and Wilcoxon, or "Wilcoxon" only. Default is "multi".}

\item{point_alpha}{Transparency of points in box plot. Default is 0.1.}

\item{save_path}{Directory to save plots and results. If NULL, no files are saved.}

\item{palette}{Color palette for box plots(used when cols is NULL). Default is "jco".}

\item{cols}{Character vector. Custom colors for box plots. If NULL, uses palette. Default is NULL.}

\item{show_plot}{Logical indicating whether to display plots. Default is TRUE.}

\item{show_col}{Logical indicating whether to show color codes. Default is FALSE.}

\item{width}{Width of oncoprint plot. Default is 8.}

\item{height}{Height of oncoprint plot. Default is 4.}

\item{oncoprint_group_by}{Grouping method for oncoprint: "mean" or "quantile". Default is "mean".}

\item{oncoprint_col}{Color for mutations in oncoprint. Default is "#224444".}

\item{gene_counts}{Number of genes to display in oncoprint. Default is 10.}

\item{jitter}{Logical indicating whether to add jitter to box plot points. Default is FALSE.}

\item{genes}{Optional vector of gene names; if NULL, selects based on frequency.}

\item{point_size}{Size of points in box plot. Default is 4.5.}
}
\value{
A list containing statistical test results, oncoprint plots, and box plots.
}
\description{
This function identifies mutations associated with a specific signature
score, performs statistical tests
for significance, and generates oncoprints and box plots to visualize
relationships.
}
\examples{
\dontrun{
# This example requires a MAF file from TCGA or maftools
# See maftools or TCGAbiolinks documentation for obtaining MAF files
mut_list <- make_mut_matrix(
  maf = "path_to_maf_file", isTCGA = TRUE,
  category = "multi"
)
mut <- mut_list$snp
results <- find_mutations(
  mutation_matrix = mut, signature_matrix = signature_data,
  id_signature_matrix = "ID", signature = "CD_8_T_effector",
  min_mut_freq = 0.01, plot = TRUE, method = "multi"
)
}
}
\author{
Dongqiang Zeng
}
