jokergoo / ComplexHeatmap

Make Complex Heatmaps
https://jokergoo.github.io/ComplexHeatmap-reference/book/
Other
1.31k stars 227 forks source link

Oncoprint with heatmap left and bottom #1219

Open attja opened 2 weeks ago

attja commented 2 weeks ago

Thank you for the great package. I have an oncoprint and I would like to add a heatmap to the left aligned with the gene names and an additional heatmap to the bottom aligned with the samples. My command is the following (ComplexHeatmap_2.20.0):

> draw(gh+op %v% sh)
Error in h(simpleError(msg, call)) : 
  error in evaluating the argument 'object' in selecting a method for function 'draw': `nrow` of all heatmaps and `nobs` of all annotations should be the same
for horizontal heatmap list.
  heatmap 'gh': 8
  heatmap 'oncoPrint': 8
  heatmap 'sh': 6

The dimensions are right.

> dim(gh_matrix)
[1] 8 7
> dim(op_matrix)
[1]  8 10
> dim(sh_matrix)
[1]  6 10

Columns/rows are match in oncoprint and heatmaps.

> identical(rownames(gh_matrix), rownames(op_matrix))
[1] TRUE
> identical(colnames(sh_matrix), colnames(op_matrix))
[1] TRUE

How could I create such a layout?