% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/make_mut_matrix.R
\name{make_mut_matrix}
\alias{make_mut_matrix}
\title{Construct Mutation Matrices from MAF Data}
\usage{
make_mut_matrix(
  maf = NULL,
  mut_data = NULL,
  isTCGA = TRUE,
  category = c("multi", "all", "snp", "indel", "frameshift"),
  Tumor_Sample_Barcode = "Tumor_Sample_Barcode",
  Hugo_Symbol = "Hugo_Symbol",
  Variant_Classification = "Variant_Classification",
  Variant_Type = "Variant_Type"
)
}
\arguments{
\item{maf}{Character or MAF object. Path to MAF file or an already loaded MAF object.}

\item{mut_data}{Data frame or NULL. Preloaded MAF-like data (used if 'maf' is NULL).}

\item{isTCGA}{Logical. Whether the MAF follows TCGA conventions. Default is TRUE.}

\item{category}{Character. Mutation category: "all", "snp", "indel", "frameshift", or "multi". Default is "multi".}

\item{Tumor_Sample_Barcode}{Character. Column name for tumor sample IDs. Default is "Tumor_Sample_Barcode".}

\item{Hugo_Symbol}{Character. Column name for gene symbols. Default is "Hugo_Symbol".}

\item{Variant_Classification}{Character. Column name for variant classification (e.g., Frame_Shift_Del). Default is "Variant_Classification".}

\item{Variant_Type}{Character. Column name for variant type (e.g., SNP, INS, DEL). Default is "Variant_Type".}
}
\value{
List of mutation matrices (if category = "multi") or a single matrix for the specified category.
}
\description{
Builds mutation presence/absence matrices from MAF input (file path or MAF
object). Supports multiple categories: all mutations, SNPs, indels, and
frameshift mutations. When category = "multi", returns a list of matrices
for each category. Compatible with TCGA-formatted data.
}
\note{
Some users may encounter errors from upstream data import (e.g.
"Can't combine ..$Tumor_Seq_Allele2" when using TCGAbiolinks or
TCGAmutations).
This is due to inconsistent column types in the source MAF tables,
not an issue of this function.
Please ensure your MAF or merged data frame uses consistent column types
(e.g. convert allele columns to character before input).
}
\examples{
\dontrun{
# See maftools or TCGAbiolinks documentation for obtaining MAF input
# Example: Download MAF file from TCGA portal
mut_list <- make_mut_matrix(maf = "path_to_maf_file.maf", isTCGA = TRUE, category = "multi")
}
}
\author{
Dongqian Zeng

Shixiang Huang
}
