oncoPrint {ComplexHeatmap} | R Documentation |
Make oncoPrint
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, ...)
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 |
get_type |
If different alterations are encoded in the matrix, this self-defined function determines how to extract them. Only work when |
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 |
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 |
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 |
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 |
remove_empty_columns |
if there is no alteration in that sample, whether remove it on the heatmap |
heatmap_legend_param |
pass to |
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 |
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 |
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 |
gap |
gap between row-slices if the heatmap is split by rows, should be |
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 |
width |
the width of the single heatmap, should be a fixed |
... |
pass to |
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.
A HeatmapList-class
object which means you can add other heatmaps or row annotations to it.
Zuguang Gu <z.gu@dkfz.de>
# There is no example NULL