Complex heatmaps: how not to cluster the slices?
1
1
Entering edit mode
5.2 years ago
micecanfly ▴ 10

Hi, below is the command with which I make heat maps with library(ComplexHeatmap). I do splitting by both columns and the rows, and it works. However, despite having 'cluster_row_slices = FALSE' and ' cluster_column_slices = FALSE', I still get both slices of columns and slices of rows reordered. Any idea what is wrong? If needed, I will try to make a reproducible example. Just am hoping that maybe there is some obvious mistake?

Heatmap(z_dheat, 
            cluster_columns=FALSE, 
            show_row_dend = FALSE, 
            border=TRUE, 
            name = "z-score", 
            show_row_names = TRUE, 
            show_column_names = FALSE,
            row_labels = dheat[rownames(dheat),2],
            split=dsplit$pathway, 
            column_split=samples$Group,
            cluster_row_slices = FALSE,
            cluster_column_slices = FALSE,
            top_annotation = colAnn,
            column_title = "Exp1", col=col_fun)
r complexheatmaps • 9.3k views
ADD COMMENT
0
Entering edit mode
5.2 years ago
dodausp ▴ 190

With that info you provided, first thing I would try was to turn row_split argument off. It is likely that the splitting is happening because your split = dsplit$pathway. And if you look at the Heatmap() function documentation, row_split=split.

That would be my first guess.

Something like:

Heatmap(z_dheat, 
            cluster_columns=FALSE, 
            show_row_dend = FALSE, 
            border=TRUE, 
            name = "z-score", 
            show_row_names = TRUE, 
            show_column_names = FALSE,
            row_labels = dheat[rownames(dheat),2],
            split=dsplit$pathway, 
            column_split=samples$Group,
            cluster_row_slices = FALSE,
            cluster_column_slices = FALSE,
            top_annotation = colAnn,
            column_title = "Exp1", col=col_fun,
            row_split = NULL)
ADD COMMENT
0
Entering edit mode

Thank you! Does not seem to solve the problem, as it also rearranges the slices of columns when splitting by rows is not present. If no splitting, columns are arranged as in the data matrix z_dheat:

Heatmap(z_dheat, 
        cluster_columns=FALSE, 
        show_row_dend = FALSE, 
        show_row_names = TRUE, 
        show_column_names = FALSE,
        top_annotation = colAnn,
        column_title = "Exp1", col=col_fun)

If I add splitting by columns column_split=samples$Group, the order of slices changes; despite cluster_column_slices = FALSE. Anything I can do to help it?

Heatmap(z_dheat, 
            cluster_columns=FALSE, 
            show_row_dend = FALSE, 
            show_row_names = TRUE, 
            show_column_names = FALSE,
            column_split=samples$Group,
            cluster_column_slices = FALSE,
            top_annotation = colAnn,
            column_title = "Exp1", col=col_fun)
ADD REPLY
0
Entering edit mode

Have you tried running it with the default settings? There shouldn't be any splitting there.

Heatmap(z_heat)
ADD REPLY
0
Entering edit mode

I do need splitting. I just do not want to rearrange the slices, I want them in original order (but sliced). It should be achieved by the command cluster_column_slices = FALSE. However, it still does rearrange the slices

ADD REPLY

Login before adding your answer.

Traffic: 2910 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