cell_fun heatmap - how to change cell size
0
0
Entering edit mode
6 weeks ago
margott.j ▴ 10

Hi!

In the vignette on how to use the ComplexHeatmap (https://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?

Many thanks,

Margot

complexheatmap R heatmap • 182 views
ADD COMMENT
1
Entering edit mode

I think the purpose of cell_fun is to draw customized cell, e.g., you want to show the correlation efficient in each cell.

Adjusting the width and heigth of heatmap should be able to change cell width and height, you can find relevant tutorial in 2.10

ADD REPLY
0
Entering edit mode

thank you so much this worked for me!

ADD REPLY

Login before adding your answer.

Traffic: 1468 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6