get_table_from_maf: Produce a Mutation Matrix from a MAF

Description Usage Arguments Value Examples

View source: R/maf_to_tables.R

Description

A function to, given a mutation annotation dataset with columns for sample barcode, gene name and mutation type, to reformulate this as a mutation matrix, with rows denoting samples, columns denoting gene/mutation type combinations, and the individual entries giving the number of mutations observed. This will likely be very sparse, so we save it as a sparse matrix for efficiency.

Usage

1
2
3
4
5
6
7
8
9
get_table_from_maf(
  maf,
  sample_list = NULL,
  gene_list = NULL,
  acceptable_genes = NULL,
  for_biomarker = "TIB",
  include_synonymous = TRUE,
  dictionary = NULL
)

Arguments

maf

(dataframe) A table of annotated mutations containing the columns 'Tumor_Sample_Barcode', 'Hugo_Symbol', and 'Variant_Classification'.

sample_list

(character) Optional parameter specifying the set of samples to include in the mutation matrix.

gene_list

(character) Optional parameter specifying the set of genes to include in the mutation matrix.

acceptable_genes

(character) Optional parameter specifying a set of acceptable genes, for example those which are in an ensembl databse.

for_biomarker

(character) Used for defining a dictionary of mutations. See the function get_mutation_dictionary() for details.

include_synonymous

(logical) Optional parameter specifying whether to include synonymous mutations in the mutation matrix.

dictionary

(character) Optional parameter directly specifying the mutation dictionary to use. See the function get_mutation_dictionary() for details.

Value

A list with the following entries:

Examples

1
2
3
4
5
6
7
# We use the preloaded maf file example_maf_data
# Now we make a mutation matrix
table <- get_table_from_maf(example_maf_data$maf, sample_list = paste0("SAMPLE_", 1:100))

print(names(table))
print(table$matrix[1:10,1:10])
print(table$col_names[1:10])

ICBioMark documentation built on Nov. 15, 2021, 5:09 p.m.