Closed itsvenu closed 5 years ago
What do you mean by "to save column dendrogram and annotation to pdf"? Do you mean to save the whole plot as a PDF? If so, just put pdf() in front of your heatmap calls:
pdf(...)
Heatmap(...)
dev.off()
Thanks for the reply. I would like to save only dendrogram and annotation track without heatmap.
Somethings like this: this, adding colored bars
Thank you.
It is not supported yet, but I've added it to my future plan.
aw, alright then. Thank you.
Or you can treat the heatmap annotations as heatmaps. Compare following two heatmaps:
m = matrix(rnorm(100), 10)
dend = as.dendrogram(hclust(dist(t(m))))
Heatmap(m, cluster_columns = dend,
top_annotation = HeatmapAnnotation(foo = 1:10, bar = anno_barplot(1:10)))
# take the first heatmap annotation as a normal heatmap (one-row heatmap)
Heatmap(rbind(1:10), cluster_columns = dend, height = unit(5, "mm"),
top_annotation = HeatmapAnnotation(bar = anno_barplot(1:10)))
That trick seems to do what I want. Thanks a lot.
I've updated the package. Now you just set a zero-row or zero-column matrix to the heatmap. See the following example:
hc = hclust(dist(matrix(rnorm(100), 10)))
Heatmap(matrix(nc = 0, nr = 10), cluster_rows = hc,
right_annotation = rowAnnotation(
foo = anno_points(1:10),
sth = 1:10,
bar = anno_barplot(1:10)),
row_split = 2)
Hi Zuguang,
this is really awesome. Thanks a lot. Should I install directly from github?
Yes.
Hi @jokergoo ! Sorry for commenting on this old closed issue, let me know if I should open a new one. I have done what suggested here, and I manage to get my dendogram without heatmap, however, it seems that the dendo is missing the labels? Is there anyway to put them back? Thank you in advance
Hi @iranmdl , can you post it in a new issue and also add code and plot there? Then I will have a look.
Hi Zuguang,
As title says, I would like to save column dendrogram and annotation to pdf. I didn't find any info in the manual regarding this (or did I miss anything?). Is it possible yet all?
Thanks a lot for the awesome package.