作者:Zuguang Gu8
    编译:Steven Shen
    原文:Subset the heatmap list


    Similar as subsetting the Heatmap object (Section 2.13), the heatmap list can also be subsetted by providing row index and column index. For horizontal heatmap list, row index correspond to rows in all heatmaps and annotations, while column index only corresponds to a subset of heatmaps and annotations. For vertical heatmap list, it’s the other way around.

    In following we use horizontal heatmap list as example.

    1. ht1 = Heatmap(mat1, name = "rnorm", col = col_rnorm,
    2. left_annotation = rowAnnotation(foo1 = 1:12, bar1 = anno_points(1:12)))
    3. ht2 = Heatmap(mat2, name = "runif", col = col_runif)
    4. ha = rowAnnotation(foo2 = anno_barplot(1:12), bar2 = 12:1)
    5. ht_list = ht1 + ht2 + ha
    6. names(ht_list)
    7. ## [1] "rnorm" "runif" "foo2" "bar2"
    8. ht_list[1:6, c("rnorm", "bar2")]

    4.10 子集化热图列表 - 图1

    foo1 and bar are components of heatmap rnorm, so they can not be selected in the subset function, while foo2 and bar2 are independent row annotations and they can selected to take subset of them.