cell_fun heatmap – how to change cell size
In the vignette on how to use the ComplexHeatmap (jokergoo.github.io/ComplexHeatmap-reference/book/a-single-heatmap.html) it has a section, 2.9 to be specific labelled cell_fun. Under this section, as pasted below, it explains that you can change the cell width and height.
“cell_fun expects a function with 7 arguments (the argument names can be different from following, but the order must be the same), which are:
j: column index in the matrix. Column index corresponds to the x-direction in the viewport, that’s why j is put as the first argument.
i: row index in the matrix.
x: x coordinate of middle point of the cell which is measured in the viewport of the heatmap body.
y: y coordinate of middle point of the cell which is measured in the viewport of the heatmap body.
width: width of the cell. The value is unit(1/ncol(sub_mat), “npc”) where sub_mat correspond to the sub-matrix by row splitting and column splitting.
height: height of the cell. The value is unit(1/nrow(sub_mat), “npc”).
fill: color of the cell.”
I am confused as to how you can place these 7 vectors into the heatmap code as I only want to change the cell width and height. Would someone know how to help with this?
• 24 views
Read more here: Source link