Subset the HeatmapAnnotation object

# S3 method for HeatmapAnnotation
[(x, i, j)

Arguments

x

A HeatmapAnnotation-class object.

i

Index of observations.

j

Index of annotations.

Examples

ha = HeatmapAnnotation(foo = 1:10, bar = anno_points(10:1), sth = cbind(1:10, 10:1)) ha[1:5, ]
#> A HeatmapAnnotation object with 3 annotations #> name: heatmap_annotation_2 #> position: column #> items: 5 #> width: 1npc #> height: 25.7029196070292mm #> this object is subsetable #> 5.13831111111111mm extension on the left #> 7.11716666666666mm extension on the right #> #> name annotation_type color_mapping height #> foo continuous vector random 5mm #> bar anno_points() 10mm #> sth continuous matrix random 10mm
ha[, c("foo", "bar")]
#> A HeatmapAnnotation object with 2 annotations #> name: heatmap_annotation_2 #> position: column #> items: 10 #> width: 1npc #> height: 15.3514598035146mm #> this object is subsetable #> 5.13831111111111mm extension on the left #> 7.11716666666666mm extension on the right #> #> name annotation_type color_mapping height #> foo continuous vector random 5mm #> bar anno_points() 10mm
ha[, 1:2]
#> A HeatmapAnnotation object with 2 annotations #> name: heatmap_annotation_2 #> position: column #> items: 10 #> width: 1npc #> height: 15.3514598035146mm #> this object is subsetable #> 5.13831111111111mm extension on the left #> 7.11716666666666mm extension on the right #> #> name annotation_type color_mapping height #> foo continuous vector random 5mm #> bar anno_points() 10mm
ha[1:5, c("foo", "sth")]
#> A HeatmapAnnotation object with 2 annotations #> name: heatmap_annotation_2 #> position: column #> items: 5 #> width: 1npc #> height: 15.3514598035146mm #> this object is subsetable #> 6.75733333333333mm extension on the right #> #> name annotation_type color_mapping height #> foo continuous vector random 5mm #> sth continuous matrix random 10mm