View source: R/make_mut_matrix.R
| make_mut_matrix | R Documentation |
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.
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"
)
maf |
Character or MAF object. Path to MAF file or an already loaded MAF object. |
mut_data |
Data frame or NULL. Preloaded MAF-like data (used if 'maf' is NULL). |
isTCGA |
Logical. Whether the MAF follows TCGA conventions. Default is TRUE. |
category |
Character. Mutation category: "all", "snp", "indel", "frameshift", or "multi". Default is "multi". |
Tumor_Sample_Barcode |
Character. Column name for tumor sample IDs. Default is "Tumor_Sample_Barcode". |
Hugo_Symbol |
Character. Column name for gene symbols. Default is "Hugo_Symbol". |
Variant_Classification |
Character. Column name for variant classification (e.g., Frame_Shift_Del). Default is "Variant_Classification". |
Variant_Type |
Character. Column name for variant type (e.g., SNP, INS, DEL). Default is "Variant_Type". |
List of mutation matrices (if category = "multi") or a single matrix for the specified category.
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).
Dongqian Zeng
Shixiang Huang
## Not run:
# 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")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.