作者:Zuguang Gu8
翻译:Steven Shen
原文:https://jokergoo.github.io/ComplexHeatmap-reference/book/oncoprint.html#oncoprint-background
If
alter_fun
is specified as a list, the order of the elements controls the order of adding graphics. There is a special element calledbackground
which defines how to draw background and it should be always put as the first element in thealter_fun
list. In following example, backgrond color is changed to light green with borders.
oncoPrint(mat,
alter_fun = list(
background = function(x, y, w, h) grid.rect(x, y, w, h,
gp = gpar(fill = "#00FF0020")),
snv = function(x, y, w, h) grid.rect(x, y, w*0.9, h*0.9,
gp = gpar(fill = col["snv"], col = NA)),
indel = function(x, y, w, h) grid.rect(x, y, w*0.9, h*0.4,
gp = gpar(fill = col["indel"], col = NA))
), col = col)
Or just remove the background (don’t set it to
NULL
. Settingbackground
directly toNULL
means to use the default style of background whch is in grey):
oncoPrint(mat,
alter_fun = list(
background = function(...) NULL,
snv = function(x, y, w, h) grid.rect(x, y, w*0.9, h*0.9,
gp = gpar(fill = col["snv"], col = NA)),
indel = function(x, y, w, h) grid.rect(x, y, w*0.9, h*0.4,
gp = gpar(fill = col["indel"], col = NA))
), col = col)