Variants Visualization

Summary

plotmafSummary(maf = dataForReport[["maf"]], rmOutlier = TRUE, addStat = 'median', dashboard = TRUE, titvRaw = FALSE)

Variant Level

Oncoplots

clinicalFeatures=dataForReport[["clinicalFeatures"]]
clinicalFeaturesSize=length(unique(unlist(dataForReport[["mafProcessed"]]$variantMafOncoPlot@data[,..clinicalFeatures])))
if (clinicalFeaturesSize>99) {
  print(paste0("clinicalFeature ",paste(clinicalFeatures,collapse=", ")," has too many groups. Reduce it to less than 99 groups for Oncoplots"))
  clinicalFeatures=NULL
}

oncoplot(maf = dataForReport[["mafProcessed"]]$variantMafOncoPlot, top = 10,removeNonMutated=FALSE,showTumorSampleBarcodes=TRUE,clinicalFeatures=clinicalFeatures,barcode_mar=9,gene_mar=9)
if (dataForReport[["performVaf"]]) {
  cat("### VAF\n")
#  plotVaf(maf = dataForReport[["maf"]], vafCol = dataForReport[["vafCol"]])
  ##variant level
  plotVaf(maf = dataForReport[["mafProcessed"]]$variantMafOncoPlot, vafCol = dataForReport[["vafCol"]])
}

Transition and Transversions

mafContent.titv = titv(maf = dataForReport[["maf"]], plot = FALSE, useSyn = TRUE)
plotTiTv(res = mafContent.titv,showBarcodes=TRUE)
if (dataForReport[["genome"]] %in% c("hg18","hg19","hg38")) {
  cat("### Rainfall plots\n")
  rainfallPlot(maf = dataForReport[["maf"]],ref.build=dataForReport[["genome"]])
}

Compare mutation load against TCGA cohorts

mafMutload = tcgaCompare(maf = dataForReport[["maf"]])

Gene Level

Genecloud

suppressWarnings(geneCloud(input = dataForReport[["maf"]], top = 15))

Oncoplots

clinicalFeatures=dataForReport[["clinicalFeatures"]]
clinicalFeaturesSize=length(unique(unlist(dataForReport[["maf"]]@data[,..clinicalFeatures])))
if (clinicalFeaturesSize>99) {
    print(paste0("clinicalFeature ",paste(clinicalFeatures,collapse=", ")," has too many groups. Reduce it to less than 99 groups for Oncoplots and Oncostrip"))
  clinicalFeatures=NULL
}
try(oncoplot(maf = dataForReport[["maf"]], top = 10,removeNonMutated=FALSE,showTumorSampleBarcodes=TRUE,clinicalFeatures=clinicalFeatures,barcode_mar=9))

Oncostrip

try(oncostrip(maf = dataForReport[["maf"]], top=10,genes=dataForReport[["interestedGenes"]],removeNonMutated=FALSE,showTumorSampleBarcodes=TRUE,clinicalFeatures=clinicalFeatures,barcode_mar=9))
if (dataForReport[["performVaf"]]) {
  cat("### Gene VAF\n")
  plotVaf(maf = dataForReport[["maf"]], vafCol = dataForReport[["vafCol"]])
}

Lollipop plots for amino acid changes

#check if the interestedGenes were recorded in protein_domains.RDs 
gff = readRDS(file = system.file("extdata", "protein_domains.RDs", package = "maftools"))
data.table::setDT(x = gff)
interestedGenesInDb=intersect(dataForReport[["interestedGenes"]],gff[,HGNC])
if (length(dataForReport[["interestedGenes"]])>length(interestedGenesInDb)) {
  temp=setdiff(dataForReport[["interestedGenes"]],interestedGenesInDb)
  warning(paste0(length(temp), " interestedGenes were not recored in protein_domains database, removed from Lollipop plots"))
  print(paste0("Interested Genes removed: ", paste(temp,collapse=";")))
}

if (length(interestedGenesInDb)>0) {
  for (i in 1:length(interestedGenesInDb)) {
    try(print(lollipopPlot(maf = dataForReport[["maf"]], gene = interestedGenesInDb[i], AACol = dataForReport[["AACol"]], showMutationRate = TRUE)))
  }
} else {
    warning(paste0("Zero genes recored in protein_domains database, no Lollipop plots"))
}


slzhao/mafreport documentation built on April 29, 2023, 8:39 a.m.