maftools_cluster_samples: maftools_cluster_samples

maftools_cluster_samplesR Documentation

maftools_cluster_samples

Description

Identify and visualise clusters of cancer samples based on somatic mutation data (gene-level differences visualised, not variant-level)

Approach involves:

  1. Selecting a geneset of interest (by default uses genes mutated in the most samples).

  2. Calculating 1-jaccard distance between samples based on which genes of the genesets are mutated.

  3. Running heirarchical clustering algorithm using pheatmap.

  4. Visualise resulting heatmap with user-selected annotations.

Usage

maftools_cluster_samples(
  maf,
  custom_genelist_to_cluster_by = NULL,
  number_of_genes = 50,
  genes_to_annotate = NULL,
  annotate_most_altered_genes = TRUE,
  topn_genes = 5,
  metadata_columns = NULL,
  include_silent_mutations = FALSE,
  show_rownames = FALSE,
  show_colnames = FALSE,
  annotation_legend = TRUE,
  fontsize = 10
)

Arguments

maf

maf object from maftools package (maf)

custom_genelist_to_cluster_by

names of genes to base clustering on. If unsure what genes to use. By default, the top 50 genes ranked by how manys samples they are mutated in will be used (character vector)

number_of_genes

number of genes to cluster based on. Chooses genes which are mutated in the most samples (only matters if not supplying custom_genelist_to_cluster_by) (integer)

genes_to_annotate

a custom list of genes to plot as a pseudo oncoplot (string)

annotate_most_altered_genes

automatically annotate with mutational status of genes mutated in the most samples (this is always based on coding/splice site mutation) (bool)

topn_genes

if annotate_most_altered_genes is true, how many genes to automatically visualise (integer)

metadata_columns

name of metadata columns to annotate heatmap based on (character)

include_silent_mutations

consider a gene mutated even if the only mutations present are silent (bool)

show_rownames

show sample names on rows (bool)

show_colnames

show sample names on columns (bool)

annotation_legend

show annotation legend (flag)

fontsize

font size (number)

Value

pheatmap object

Examples

maf <- maftools::tcgaLoad("GBM", source = "Firehose") 
maftools_cluster_samples(maf)

CCICB/CRUX documentation built on Jan. 28, 2024, 10:12 p.m.