R/mafGeneSummary.R

Defines functions mafSummary

Documented in mafSummary

#' Summary statistics of MAF
#' @description Summarizes genes and samples irrespective of the type of alteration. This is different from \code{\link{getSampleSummary}} and \code{\link{getGeneSummary}} which returns summaries of only non-synonymous variants.
#' @details This function takes MAF object as input and returns summary table.
#' @param maf an MAF object generated by \code{\link{read.maf}}
#' @return Returns a list of summarized tables
#' @examples
#' laml.maf <- system.file("extdata", "tcga_laml.maf.gz", package = "maftools")
#' laml <- read.maf(maf = laml.maf)
#' mafSummary(maf = laml)
#'
#' @seealso \code{\link{getGeneSummary}} \code{\link{getSampleSummary}}
#' @export

mafSummary = function(maf){
  x = summarizeMaf(maf = data.table::rbindlist(
    list(maf@data, maf@maf.silent),
    use.names = TRUE,
    fill = TRUE
  ),
  chatty = FALSE)[c(
    "variant.classification.summary",
    "gene.summary",
    "variants.per.sample",
    "variant.type.summary"
  )]
  return(x)
}

Try the maftools package in your browser

Any scripts or data that you put into this service are public.

maftools documentation built on Feb. 6, 2021, 2 a.m.