oncoplot {maftools} | R Documentation

## draw an oncoplot

### Description

takes output generated by read.maf and draws an oncoplot

### Usage

    oncoplot(
      maf,
      top = 20,
      genes = NULL,
      altered = FALSE,
      mutsig = NULL,
      mutsigQval = 0.1,
      drawRowBar = TRUE,
      drawColBar = TRUE,
      includeColBarCN = TRUE,
      draw_titv = FALSE,
      logColBar = FALSE,
      clinicalFeatures = NULL,
      exprsTbl = NULL,
      additionalFeature = NULL,
      additionalFeaturePch = 20,
      additionalFeatureCol = "white",
      additionalFeatureCex = 0.9,
      annotationDat = NULL,
      annotationColor = NULL,
      genesToIgnore = NULL,
      showTumorSampleBarcodes = FALSE,
      barcode_mar = 4,
      gene_mar = 5,
      removeNonMutated = TRUE,
      fill = TRUE,
      cohortSize = NULL,
      colors = NULL,
      sortByMutation = FALSE,
      sortByAnnotation = FALSE,
      numericAnnoCol = NULL,
      groupAnnotationBySize = TRUE,
      annotationOrder = NULL,
      keepGeneOrder = FALSE,
      GeneOrderSort = TRUE,
      sampleOrder = NULL,
      writeMatrix = FALSE,
      sepwd_genes = 0.5,
      sepwd_samples = 0.25,
      fontSize = 0.8,
      SampleNamefontSize = 1,
      showTitle = TRUE,
      titleFontSize = 1.5,
      legendFontSize = 1.2,
      annotationFontSize = 1.2,
      bgCol = "#CCCCCC",
      borderCol = "white",
      colbar_pathway = FALSE
    )

### Arguments

`maf` | an `MAF` object generated by `read.maf`
`top` | how many top genes to be drawn. defaults to 20.
`genes` | Just draw oncoplot for these genes. Default NULL.
`altered` | Default FALSE. Chooses top genes based on muatation status. If `TRUE` chooses top genes based alterations (CNV or mutation).
`mutsig` | Mutsig resuts if availbale. Usually file named sig_genes.txt If provided plots significant genes and correpsonding Q-values as side row-bar. Default NULL.
`mutsigQval` | Q-value to choose significant genes from mutsig results. Default 0.1
`drawRowBar` | logical plots barplot for each gene. Default `TRUE`.
`drawColBar` | logical plots barplot for each sample. Default `TRUE`.
`includeColBarCN` | Whether to include CN in column bar plot. Default TRUE
`draw_titv` | logical Includes TiTv plot. `FALSE`
`logColBar` | Plot top bar plot on log10 scale. Default `FALSE`.
`clinicalFeatures` | columns names from 'clinical.data' slot of `MAF` to be drawn in the plot. Dafault NULL.
`exprsTbl` | Expression values if availble. Must be a data.frame with two columns containing to gene names and expression values.
`additionalFeature` | a vector of length two indicating column name in the MAF and the factor level to be highlighted.
`additionalFeaturePch` | Default 20
`additionalFeatureCol` | Default "white"
`additionalFeatureCex` | Default 0.9
`annotationDat` | If MAF file was read without clinical data, provide a custom `data.frame` with a column `Tumor_Sample_Barcode` containing sample names along with rest of columns with annotations. You can specify which columns to be drawn using 'clinicalFeatures' argument.
`annotationColor` | Custom colors to use for 'clinicalFeatures'. Must be a named list containing a named vector of colors. Default NULL. See example for more info.
`genesToIgnore` | do not show these genes in Oncoplot. Default NULL.
`showTumorSampleBarcodes` | logical to include sample names.
`barcode_mar` | Default 4
`gene_mar` | Default 5
`removeNonMutated` | Logical. If `TRUE` removes samples with no mutations in the oncoplot for better visualization. Default `TRUE`.
`fill` | Logical. If `TRUE` draws genes and samples as blank grids even when they are not altered.
`cohortSize` | Number of sequenced samples in the cohort. Default all samples from Cohort. You can manually specify the cohort size. Default `NULL`
`colors` | named vector of colors for each Variant_Classification.
`sortByMutation` | Force sort matrix according mutations. Helpful in case of MAF was read along with copy number data. Default FALSE.
`sortByAnnotation` | logical sort oncomatrix (samples) by provided 'clinicalFeatures'. Sorts based on first 'clinicalFeatures'. Defaults to FALSE. column-sort
`numericAnnoCol` | color palette used for numeric annotations. Default 'YlOrBr' from RColorBrewer
`groupAnnotationBySize` | Further group 'sortByAnnotation' orders by their size. Defaults to TRUE. Largest groups comes first.
`annotationOrder` | Manually specify order for annotations. Works only for first 'clinicalFeatures'. Default NULL.
`keepGeneOrder` | logical whether to keep order of given genes. Default FALSE, order according to mutation frequency
`GeneOrderSort` | logical this is applicable when 'keepGeneOrder' is TRUE. Default TRUE
`sampleOrder` | Manually speify sample names for oncolplot ordering. Default NULL.
`writeMatrix` | writes character coded matrix used to generate the plot to an output file.
`sepwd_genes` | Default 0.5
`sepwd_samples` | Default 0.25
`fontSize` | font size for gene names. Default 0.8.
`SampleNamefontSize` | font size for sample names. Default 1
`showTitle` | Default TRUE
`titleFontSize` | font size for title. Default 1.5
`legendFontSize` | font size for legend. Default 1.2
`annotationFontSize` | font size for annotations. Default 1.2
`bgCol` | Background grid color for wild-type (not-mutated) samples. Default gray - "#CCCCCC"
`borderCol` | border grid color (not-mutated) samples. Default 'white'.
`colbar_pathway` | Draw top column bar with respect to diplayed pathway. Default FALSE.

### Details

Takes maf file as input and plots it as a matrix. Any desired clincal features can be added at the bottom of the oncoplot by providing `clinicalFeatures`. Oncoplot can be sorted either by mutations or by clinicalFeatures using arguments `sortByMutation` and `sortByAnnotation` respectively.

### Value

None.

### See Also

`oncostrip`

### Examples

    laml.maf <- system.file("extdata", "tcga_laml.maf.gz", package = "maftools")
    laml.clin = system.file('extdata', 'tcga_laml_annot.tsv', package = 'maftools')
    laml <- read.maf(maf = laml.maf, clinicalData = laml.clin)
    #Basic onocplot
    oncoplot(maf = laml, top = 3)
    #Changing colors for variant classifications (You can use any colors, here in this example we will use a color palette from RColorBrewer)
    col = RColorBrewer::brewer.pal(n = 8, name = 'Paired')
    names(col) = c('Frame_Shift_Del','Missense_Mutation', 'Nonsense_Mutation', 'Multi_Hit', 'Frame_Shift_Ins',
                   'In_Frame_Ins', 'Splice_Site', 'In_Frame_Del')
    #Color coding for FAB classification; try getAnnotations(x = laml) to see available annotations.
    fabcolors = RColorBrewer::brewer.pal(n = 8,name = 'Spectral')
    names(fabcolors) = c("M0", "M1", "M2", "M3", "M4", "M5", "M6", "M7")
    fabcolors = list(FAB_classification = fabcolors)
    oncoplot(maf = laml, colors = col, clinicalFeatures = 'FAB_classification', sortByAnnotation = TRUE, annotationColor = fabcolors)

[Package maftools version 2.2.10 Index]