% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/gam_utils.r
\name{maf2gam}
\alias{maf2gam}
\title{Generate gam from the maf file}
\usage{
maf2gam(
  maf,
  sample.col = "Tumor_Sample_Barcode",
  gene.col = "Hugo_Symbol",
  value.var = "HGVSp_Short",
  samples = NULL,
  genes = NULL,
  fun.aggregate = length,
  binarize = TRUE,
  fill = NA
)
}
\arguments{
\item{maf}{A MAF dataframe}

\item{sample.col}{Column name for sample IDs}

\item{gene.col}{Column name for gene symbols}

\item{value.var}{Column used as the value to aggregate}

\item{samples}{Vector of sample IDs to include; NULL keeps all samples present in the MAF}

\item{genes}{Vector of gene names to include; NULL keeps all genes present in the MAF}

\item{fun.aggregate}{Aggregation function applied per (sample, gene) cell}

\item{binarize}{If TRUE, convert aggregated counts to binary presence/absence}

\item{fill}{Value used for missing (sample, gene) combinations}
}
\value{
Numeric matrix (samples x genes) representing the gene alteration matrix.
}
\description{
\code{maf2gam()} takes a maf file and converts into gam
}
\examples{
data(luad_maf, package = "SelectSim")
small_maf <- luad_maf[
  luad_maf$Tumor_Sample_Barcode \%in\%
    unique(luad_maf$Tumor_Sample_Barcode)[1:5],
]
gam <- maf2gam(small_maf)
dim(gam)

}
