federicomarini/GeneTonic

column names in gs_heatmap cutoff

Closed this issue ยท 7 comments

I have long sample names and when I run gs_heatmap in GeneTonic the column names are cut off from the resulting heatmap. I cannot find the command to adjust the height of the column names, similar to column_names_max_height in ComplexHeatmap. Is there a similar argument to adjust the column name height?

Hi @pkreville,
as of now there's no such parameter to adjust that directly via gs_heatmap.

Are you using the function directly from the app, or only offline?

A possible thought would be to have the ellipsis to pass the further arguments, but I also would like to avoid overcrowding the ui. I'll think of a possible solution with some sensible defaults ๐Ÿ˜‰

A thought - since ComplexHeatmap handles this with metric units and not the length of the column names themselves.
How long are your column names? I am just wondering if it is not just better to cut them up in advance (substr or so), or find e.g. some shortened up version? I get that you would like to display the names in their entirety "since the name might already be explanatory", but otoh it could take up too much space?

Thank you for the reply. I am using it only offline right now. The names aren't terribly long, I am missing ~10 characters which are being cut-off. Unfortunately for me, those 10 characters are the most important for discriminating the samples. I think the best solution for now is to cut the names in advance.
One final question, is it possible to just display the column name clusters from gs_heatmap (i.e. just the column name order in the cluster without the heatmap)? In that way I could at least know the order of the samples in the cluster and I could always update the figures in illustrator.

If you use it in offline mode "that's possibly easy" ๐Ÿ˜‰
I am not aware of a way to extract just the dendrogram-style info, but I get your point.
If you are somehow familiar with the function code, you can edit directly the call to gs_heatmap at this spot:

ch <- ComplexHeatmap::Heatmap(

... and there add the column_names_max_height = units(10, "cm") or just some value above the default 6 - that could do it.
HTH,
Federico

Ah, that worked perfectly! I had to use: column_names_gp = gpar(fontsize = 8)' instead of column_names_max_height. Thank you so much for the help!

You're welcome!
Nice to read that the heatmaps are appreciated as a final format to publish the "expression signatures".
Might well be that this ends up becoming a small feature to be used with the ellipsis, so thank you as well for prompting this idea ๐Ÿ˜‰
F

FYI, in case it can be of help: the latest addon in https://github.com/federicomarini/GeneTonic/tree/gsheatmap_extraparams does provide this override trick "natively" in gs_heatmap.