作者: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 called background which defines how to draw background and it should be always put as the first element in the alter_fun list. In following example, backgrond color is changed to light green with borders.

    1. oncoPrint(mat,
    2. alter_fun = list(
    3. background = function(x, y, w, h) grid.rect(x, y, w, h,
    4. gp = gpar(fill = "#00FF0020")),
    5. snv = function(x, y, w, h) grid.rect(x, y, w*0.9, h*0.9,
    6. gp = gpar(fill = col["snv"], col = NA)),
    7. indel = function(x, y, w, h) grid.rect(x, y, w*0.9, h*0.4,
    8. gp = gpar(fill = col["indel"], col = NA))
    9. ), col = col)

    7.1.3 背景 - 图1

    Or just remove the background (don’t set it to NULL. Setting background directly to NULL means to use the default style of background whch is in grey):

    1. oncoPrint(mat,
    2. alter_fun = list(
    3. background = function(...) NULL,
    4. snv = function(x, y, w, h) grid.rect(x, y, w*0.9, h*0.9,
    5. gp = gpar(fill = col["snv"], col = NA)),
    6. indel = function(x, y, w, h) grid.rect(x, y, w*0.9, h*0.4,
    7. gp = gpar(fill = col["indel"], col = NA))
    8. ), col = col)

    7.1.3 背景 - 图2