oncoPrint: Make oncoPrint

Description Usage Arguments Details Value Author(s) Examples

View source: R/oncoPrint.R

Description

Make oncoPrint

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
oncoPrint(mat, get_type = function(x) x,
    alter_fun = alter_fun_list, alter_fun_list = NULL, col,
    row_order = oncoprint_row_order(),
    column_order = oncoprint_column_order(),
    show_pct = TRUE, pct_gp = row_names_gp, pct_digits = 0,
    axis_gp = gpar(fontsize = 8),
    show_row_barplot = TRUE,
    row_barplot_width = unit(2, "cm"),
    remove_empty_columns = FALSE,
    heatmap_legend_param = list(title = "Alterations"),
    top_annotation = HeatmapAnnotation(column_bar = anno_oncoprint_barplot(),
    annotation_height = unit(2, "cm")),
    top_annotation_height = top_annotation@size,
    bottom_annotation = new("HeatmapAnnotation"),
    bottom_annotation_height = bottom_annotation@size,
    barplot_ignore = NULL,
    row_title = character(0),
    row_title_side = c("left", "right"),
    row_title_gp = gpar(fontsize = 14),
    row_title_rot = switch(row_title_side[1], "left" = 90, "right" = 270),
    column_title = character(0),
    column_title_side = c("top", "bottom"),
    column_title_gp = gpar(fontsize = 14),
    column_title_rot = 0,
    show_row_names = TRUE,
    row_names_gp = gpar(fontsize = 12),
    show_column_names = FALSE,
    column_names_gp = gpar(fontsize = 12),
    split = NULL,
    gap = unit(1, "mm"),
    combined_name_fun = function(x) paste(x, collapse = "/"),
    width = NULL,
    ...)

Arguments

mat

a character matrix which encodes mulitple alterations or a list of matrix for which every matrix contains binary value representing the alteration is present or absent. When it is a list, the names represent alteration types. You can use unify_mat_list to make all matrix having same row names and column names.

get_type

If different alterations are encoded in the matrix, this self-defined function determines how to extract them. Only work when mat is a matrix.

alter_fun

a single function or a list of functions which define how to add graphics for different alterations. If it is a list, the names of the list should cover all alteration types.

alter_fun_list

deprecated, use alter_run instead.

col

a vector of color for which names correspond to alteration types.

row_order

order of genes. By default it is sorted by frequency of alterations decreasingly. Set it to NULL if you don't want to set the order

column_order

order of samples. By default the order is calculated by the 'memo sort' method which can visualize the mutual exclusivity across genes. Set it to NULL if you don't want to set the order

show_pct

whether show percent values on the left of the oncoprint

pct_gp

graphic paramters for percent row annotation

pct_digits

digits for percent values

axis_gp

graphic paramters for axes

show_row_barplot

whether show barplot annotation on rows

row_barplot_width

width of barplot annotation on rows. It should be a unit object

remove_empty_columns

if there is no alteration in that sample, whether remove it on the heatmap

heatmap_legend_param

pass to Heatmap

top_annotation

by default the top annotation contains barplots representing frequency of mutations in every sample.

top_annotation_height

total height of the column annotations on the top.

bottom_annotation

a HeatmapAnnotation object.

bottom_annotation_height

total height of the column annotations on the bottom.

barplot_ignore

specific alterations that you don't want to put on the barplots. If you want to really suppress the top barplot set top_annotation to NULL.

row_title

title on row.

row_title_side

will the title be put on the left or right of the heatmap?

row_title_gp

graphic parameters for drawing text.

row_title_rot

rotation of row titles. Only 0, 90, 270 are allowed to set.

column_title

title on column.

column_title_side

will the title be put on the top or bottom of the heatmap?

column_title_gp

graphic parameters for drawing text.

column_title_rot

rotation of column titles. Only 0, 90, 270 are allowed to set.

show_row_names

whether show row names.

row_names_gp

graphic parameters for drawing text.

show_column_names

whether show column names.

column_names_gp

graphic parameters for drawing text.

split

a vector or a data frame by which the rows are split. But if cluster_rows is a clustering object, split can be a single number indicating rows are to be split according to the split on the tree.

gap

gap between row-slices if the heatmap is split by rows, should be unit object. If it is a vector, the order corresponds to top to bottom in the heatmap

combined_name_fun

if the heatmap is split by rows, how to make a combined row title for each slice? The input parameter for this function is a vector which contains level names under each column in split.

width

the width of the single heatmap, should be a fixed unit object. It is used for the layout when the heatmap is appended to a list of heatmaps.

...

pass to Heatmap, so can set bottom_annotation here.

Details

The function returns a normal heatmap list and you can add more heatmaps/row annotations to it.

The 'memo sort' method is from https://gist.github.com/armish/564a65ab874a770e2c26 . Thanks to B. Arman Aksoy for contributing the code.

The function would be a little bit slow if you plot it in an interactive device because all alterations are added through a foo loop.

For more explanation, please go to the vignette.

Value

A HeatmapList-class object which means you can add other heatmaps or row annotations to it.

Author(s)

Zuguang Gu <[email protected]>

Examples

1
2
# There is no example
NULL

eilslabs/ComplexHeatmap documentation built on Oct. 19, 2017, 2:13 p.m.