旋转复杂热图包中Upset图的注释。

huangapple go评论82阅读模式
英文:

Rotate annotation in Upset plot of complex heatmap package

问题

I want to show the numbers of the bars in the top annotation barplot in the Upset plot of ComplexHeatmap. However, I could only find parameters to rotate the name of the annotations, but not the annotations themselfes.

Taken from the ComplexHeatmap Documentation:

lt = list(set1 = c("a", "b", "c"),
          set2 = c("b", "c", "d", "e"))
x = list_to_matrix(lt, universal_set = letters)
m2 = make_comb_mat(x)
m2 = m2[comb_degree(m2) > 0]
UpSet(m2, top_annotation = upset_top_annotation(m2, add_numbers = T))

旋转复杂热图包中Upset图的注释。

Is there a way to not have the numbers rotated by 45 degrees?

英文:

I want to show the numbers of the bars in the top annotation barplot in the Upset plot of ComplexHeatmap. However, I could only find parameters to rotate the name of the annotations, but not the annotations themselfes.

Taken from the ComplexHeatmap Documentation:

lt = list(set1 = c("a", "b", "c"),
          set2 = c("b", "c", "d", "e"))
x = list_to_matrix(lt, universal_set = letters)
m2 = make_comb_mat(x)
m2 = m2[comb_degree(m2) > 0]
UpSet(m2, top_annotation = upset_top_annotation(m2, add_numbers = T))

旋转复杂热图包中Upset图的注释。

Is there a way to not have the numbers rotated by 45 degrees?

答案1

得分: 4

numbers_rot = 0可以添加到upset_top_annotation中。

anno_barplot文档中有更多选项,可以查看?anno_barplot

英文:

You can do this by adding numbers_rot = 0 to the upset_top_annotation.

lt = list(set1 = c("a", "b", "c"),
          set2 = c("b", "c", "d", "e"))
x = list_to_matrix(lt, universal_set = letters)
m2 = make_comb_mat(x)
m2 = m2[comb_degree(m2) > 0]
UpSet(m2, top_annotation = upset_top_annotation(m2, add_numbers = T, numbers_rot = 0))

This option is somewhat hidden in the documentation, as it is not a parameter for upset_top_annotation, but gets passed to the anno_barplot. You can find more options to pass by looking at ?anno_barplot

Hope this helps!

huangapple
  • 本文由 发表于 2023年3月31日 22:08:19
  • 转载请务必保留本文链接:https://go.coder-hub.com/75899480.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定