Browse code

do not subset gp for matrix as annotations

Zuguang Gu authored on 18/12/2020 09:51:20
Showing2 changed files

... ...
@@ -824,6 +824,9 @@ anno_points = function(x, which = c("column", "row"), border = TRUE, gp = gpar()
824 824
 	anno@subset_rule$gp = subset_vector
825 825
 	if(input_is_matrix) {
826 826
 		anno@subset_rule$value = subset_matrix_by_row
827
+		if(ncol(value) > 1) {
828
+			anno@subset_rule$gp = NULL
829
+		}
827 830
 	} else {
828 831
 		anno@subset_rule$value = subset_vector
829 832
 		anno@subset_rule$gp = subset_gp
... ...
@@ -1076,6 +1079,9 @@ anno_lines = function(x, which = c("column", "row"), border = TRUE, gp = gpar(),
1076 1079
 	anno@subset_rule$gp = subset_vector
1077 1080
 	if(input_is_matrix) {
1078 1081
 		anno@subset_rule$value = subset_matrix_by_row
1082
+		if(ncol(value) > 1) {
1083
+			anno@subset_rule$gp = NULL
1084
+		}
1079 1085
 	} else {
1080 1086
 		anno@subset_rule$value = subset_vector
1081 1087
 		anno@subset_rule$gp = subset_gp
... ...
@@ -879,6 +879,101 @@ setMethod(f = "draw",
879 879
         grDevices::recordGraphics(eval(code), list(),  as.environment(-1))
880 880
     }
881 881
 
882
+    object@ht_list_param$called_arguments = list(
883
+        newpage = newpage,
884
+        
885
+        row_title = row_title, 
886
+        row_title_side = row_title_side, 
887
+        row_title_gp = row_title_gp,
888
+        column_title = column_title, 
889
+        column_title_side = column_title_side, 
890
+        column_title_gp = column_title_gp, 
891
+
892
+        heatmap_legend_side = heatmap_legend_side, 
893
+        merge_legends = merge_legends,
894
+        show_heatmap_legend = show_heatmap_legend, 
895
+        heatmap_legend_list = heatmap_legend_list,
896
+        annotation_legend_side = annotation_legend_side, 
897
+        show_annotation_legend = show_annotation_legend, 
898
+        annotation_legend_list = annotation_legend_list,
899
+        align_heatmap_legend = align_heatmap_legend,
900
+        align_annotation_legend = align_annotation_legend,
901
+        legend_grouping = legend_grouping,
902
+
903
+        gap = gap, 
904
+        ht_gap = ht_gap, 
905
+
906
+        main_heatmap = main_heatmap,
907
+        padding = padding,
908
+        adjust_annotation_extension = adjust_annotation_extension,
909
+        
910
+        auto_adjust = auto_adjust,
911
+        row_dend_side = row_dend_side,
912
+        row_sub_title_side = row_sub_title_side,
913
+        column_dend_side = column_dend_side,
914
+        column_sub_title_side = column_sub_title_side,
915
+        
916
+        row_gap = row_gap,
917
+        cluster_rows = cluster_rows,
918
+        cluster_row_slices = cluster_row_slices,
919
+        clustering_distance_rows = clustering_distance_rows,
920
+        clustering_method_rows = clustering_method_rows,
921
+        row_dend_width = row_dend_width, 
922
+        show_row_dend = show_row_dend, 
923
+        row_dend_reorder = row_dend_reorder,
924
+        row_dend_gp = row_dend_gp,
925
+        row_order = row_order,
926
+        km = km,
927
+        split = split,
928
+        row_km = row_km,
929
+        row_km_repeats = row_km_repeats,
930
+        row_split = row_split,
931
+        height = height,
932
+        heatmap_height = heatmap_height,
933
+
934
+        column_gap = column_gap,
935
+        cluster_columns = cluster_columns,
936
+        cluster_column_slices = cluster_column_slices,
937
+        clustering_distance_columns = clustering_distance_columns,
938
+        clustering_method_columns = clustering_method_columns,
939
+        column_dend_width = column_dend_width, 
940
+        show_column_dend = show_column_dend, 
941
+        column_dend_reorder = column_dend_reorder,
942
+        column_dend_gp = column_dend_gp,
943
+        column_order = column_order,
944
+        column_km = column_km,
945
+        column_km_repeats = column_km_repeats,
946
+        column_split = column_split,
947
+        width = width,
948
+        heatmap_width = heatmap_width,
949
+
950
+        use_raster = use_raster, 
951
+        raster_device = raster_device,
952
+        raster_quality = raster_quality,
953
+        raster_device_param = raster_device_param,
954
+        raster_resize = raster_resize,
955
+
956
+        post_fun = post_fun,
957
+
958
+        ### global setting
959
+        heatmap_row_names_gp = heatmap_row_names_gp,
960
+        heatmap_column_names_gp = heatmap_column_names_gp,
961
+        heatmap_row_title_gp = heatmap_row_title_gp,
962
+        heatmap_column_title_gp = heatmap_column_title_gp,
963
+        legend_title_gp = legend_title_gp,
964
+        legend_title_position = legend_title_position,
965
+        legend_labels_gp = legend_labels_gp,
966
+        legend_grid_height = legend_grid_height,
967
+        legend_grid_width = legend_grid_width,
968
+        legend_border = legend_border,
969
+        legend_gap = legend_gap,
970
+        heatmap_border = heatmap_border,
971
+        annotation_border = annotation_border,
972
+        fastcluster = fastcluster,
973
+        simple_anno_size = simple_anno_size,
974
+        show_parent_dend_line = show_parent_dend_line
975
+    )
976
+
882 977
     return(invisible(object))
883 978
 })
884 979