TCGABiolinks
MAFDash provides a wrapper function that tries to simplify retrieving data using TCGABiolinks
. Valid project codes can be viewed by running TCGABiolinks::getGDCprojects()
and checking the “tumor” column.
library(MAFDash)
library(TCGABiolinks)
tcga_code = "UVM" ## Uveal Melanoma
caller = "mutect2"
title_label = paste0("TCGA-",tcga_code)
maf_file <- getMAFdataTCGA(tcga_code,variant_caller = caller)
TCGABiolinks
tcga_clinical <- TCGAbiolinks::GDCquery_clinic(project = paste0("TCGA-",tcga_code), type = "clinical")
tcga_clinical$Tumor_Sample_Barcode <- tcga_clinical$submitter_id
The filterMAF
function can be used to filter the MAF data in various ways. Importantly, by default, it will remove commonly occurring mutations that are often considered to be false position ( FLAG genes )
filtered_mafdata <- filterMAF(maf_file)
The easiest way to add clinical annotations to the oncoplot is to add clinical data to the clinical.data
slot of a MAF
object before passing it to the generateOncoplot()
function.
MAFDash also provides a function that defines reasonable colors for some common clinical annotations provided with TCGA datasets.
filtered_maf <- read.maf(filtered_mafdata, clinicalData = tcga_clinical)
annotation_colors <- getTCGAClinicalColors(ageRange = range(tcga_clinical$age_at_diagnosis, na.rm=T))
The add_clinical_annotations
argument can be:
clinical.data
slot of the MAF
object. Columns with all missing values are ignored. Maximum number of annotations plotted is 10 (first 10 non-empty columns of clinical.data
)
custom_onco <- generateOncoPlot(filtered_maf,
add_clinical_annotations = names(annotation_colors),
clin_data_colors = annotation_colors)
A lot of maftools
's plots are base graphics, so they're drawn to a device and not returned. But we can simply save them to a file and provide the file path.
library(maftools)
tcgacompare_file <- file.path(getwd(),"tcga_compare.png")
png(tcgacompare_file,width=8, height=6, units="in", res=400)
tcgaCompare(filtered_maf,tcga_capture_size = NULL)
dev.off()
This function is built on top of maftools
's somaticInteractions()
function. It's just a different way of visualizing co-occurence or mutual exclusivity between genes.
ribbonplot_file <- file.path(getwd(),"ribbon.pdf")
generateRibbonPlot(filtered_maf,save_name = ribbonplot_file)
customplotlist <- list("summary_plot"=T,
"burden"=T,
"TCGA Comparison"=tcgacompare_file,
"oncoplot"=T,
"Annotated Oncoplot"=custom_onco
)
## Filename to output to; if output directory doesn't exist, it will be created
html_filename=file.path("examples/TCGA-UVM.custom.mafdash.html")
## Render dashboard
getMAFDashboard(MAFfilePath = filtered_maf,
plotList = customplotlist,
outputFileName = html_filename,
outputFileTitle = "Customized Dashboard")
The output can be seen here.