@@ -33,7 +33,7 @@ function genotype_heatmap2_new_legend(input,title,chrom_label_info,sample_names,
33
33
ticktext = [" No Call (0)" , " Homozygous Reference" , " Heterozygous Variant" , " Homozygous Variant" ])
34
34
);
35
35
36
- # we define a custom legend using shapes and a text scatter trace
36
+ # we define a custom legend using shapes and a text scatter trace #x_axis_text_anchor+extra_right_margin_space
37
37
trace2 = scatter (
38
38
;x= [x_axis_text_anchor,x_axis_text_anchor,x_axis_text_anchor,x_axis_text_anchor,x_axis_text_anchor+ extra_right_margin_space], y= y= [position_1+ text_point_increment,position_3+ text_point_increment,position_5+ text_point_increment,position_7+ text_point_increment,position_9+ text_point_increment],
39
39
mode= " text" , name= " legend label" ,
@@ -136,20 +136,21 @@ function genotype_heatmap_with_groups(input::Array{Int64,2},title::String,chrom_
136
136
);
137
137
138
138
# we define a custom legend using shapes and a text scatter trace
139
+
139
140
trace2 = scatter (
140
141
;x= [x_axis_text_anchor,x_axis_text_anchor,x_axis_text_anchor,x_axis_text_anchor,x_axis_text_anchor+ extra_right_margin_space,x_axis_text_anchor,x_axis_text_anchor], y= y= [position_1+ text_point_increment,position_2+ text_point_increment,position_3+ text_point_increment,position_4+ text_point_increment,position_5+ text_point_increment,position_7+ text_point_increment,position_8+ text_point_increment],
141
142
mode= " text" , name= " legend label" ,
142
143
textposition= " middle right" ,
143
- text= [" No Call" , " Homozygous Reference" , " Heterozygous Variant" , " Homozygous Variant" ," " , " Trait 2" ," Trait 1" ],
144
+ text= [" No Call" , " Homozygous Reference" , " Heterozygous Variant" , " Homozygous Variant" ," " , " Trait 2" ," Trait 1" ],
144
145
marker_size= 300 , textfont_family= " Raleway, sans-serif" )
145
146
146
147
shapes = [
147
148
rect (x0= legend_xaxis_anchor, y0= position_4, x1= legend_xaxis_anchor_2, y1= position_5, opacity= 1.0 , fillcolor= " rgb(251,231,65)" , line_color= " black" ),
148
149
rect (x0= legend_xaxis_anchor, y0= position_3, x1= legend_xaxis_anchor_2, y1= position_4, opacity= 1.0 , fillcolor= " rgb(65,165,137)" , line_color= " black" ),
149
150
rect (x0= legend_xaxis_anchor, y0= position_2, x1= legend_xaxis_anchor_2, y1= position_3, opacity= 1.0 , fillcolor= " rgb(51,106,145)" , line_color= " black" ),
150
151
rect (x0= legend_xaxis_anchor, y0= position_1, x1= legend_xaxis_anchor_2, y1= position_2, opacity= 1.0 , fillcolor= " rgb(255,255,255)" , line_color= " black" ),
151
- rect (x0= legend_xaxis_anchor, y0= position_7, x1= legend_xaxis_anchor_2, y1= position_8, opacity= 1.0 , fillcolor= " rgb(151, 154, 154 )" , line_color= " black" ),
152
- rect (x0= legend_xaxis_anchor, y0= position_8, x1= legend_xaxis_anchor_2, y1= position_9, opacity= 1.0 , fillcolor= " rgb(208, 211, 212 )" , line_color= " black" )
152
+ rect (x0= legend_xaxis_anchor, y0= position_7, x1= legend_xaxis_anchor_2, y1= position_8, opacity= 1.0 , fillcolor= " rgb(208, 211, 212 )" , line_color= " black" ),
153
+ rect (x0= legend_xaxis_anchor, y0= position_8, x1= legend_xaxis_anchor_2, y1= position_9, opacity= 1.0 , fillcolor= " rgb(151, 154, 154 )" , line_color= " black" )
153
154
]
154
155
155
156
data = [trace, trace2]
@@ -380,8 +381,8 @@ function dp_heatmap2_with_groups(input::Array{Int64,2},title::String,chrom_label
380
381
data = [trace, trace2]
381
382
382
383
shapes = [
383
- rect (x0= legend_xaxis_anchor, y0= position_7, x1= legend_xaxis_anchor_2, y1= position_8, opacity= 1.0 , fillcolor= " rgb(151, 154, 154 )" , line_color= " black" ),
384
- rect (x0= legend_xaxis_anchor, y0= position_8, x1= legend_xaxis_anchor_2, y1= position_9, opacity= 1.0 , fillcolor= " rgb(208, 211, 212 )" , line_color= " black" ),
384
+ rect (x0= legend_xaxis_anchor, y0= position_7, x1= legend_xaxis_anchor_2, y1= position_8, opacity= 1.0 , fillcolor= " rgb(208, 211, 212 )" , line_color= " black" ),
385
+ rect (x0= legend_xaxis_anchor, y0= position_8, x1= legend_xaxis_anchor_2, y1= position_9, opacity= 1.0 , fillcolor= " rgb(151, 154, 154 )" , line_color= " black" ),
385
386
rect (x0= legend_xaxis_anchor, y0= position_5, x1= legend_xaxis_anchor_2, y1= position_6, opacity= 1.0 , fillcolor= " rgb(37,114,242)" , line_color= " black" ),
386
387
rect (x0= legend_xaxis_anchor, y0= position_4, x1= legend_xaxis_anchor_2, y1= position_5, opacity= 1.0 , fillcolor= " rgb(67,138,254)" , line_color= " black" ),
387
388
rect (x0= legend_xaxis_anchor, y0= position_3, x1= legend_xaxis_anchor_2, y1= position_4, opacity= 1.0 , fillcolor= " rgb(110,182,255)" , line_color= " black" ),
@@ -579,7 +580,7 @@ function generate_legend_increments_ungrouped(input)
579
580
legend_xaxis_anchor = number_samples + distance_from_plot_edge
580
581
legend_xaxis_anchor_2 = legend_xaxis_anchor + width_of_color_box
581
582
x_axis_text_anchor = legend_xaxis_anchor_2 + number_samples/ 40
582
- extra_right_margin_space= number_samples/ 5
583
+ extra_right_margin_space= number_samples/ 4
583
584
extra_right_margin_space_dp = number_samples/ 10
584
585
585
586
position_1 = number_rows/ 2
@@ -613,7 +614,7 @@ function generate_legend_increments_grouped(input)
613
614
legend_xaxis_anchor = number_samples + distance_from_plot_edge
614
615
legend_xaxis_anchor_2 = legend_xaxis_anchor + width_of_color_box
615
616
x_axis_text_anchor = legend_xaxis_anchor_2 + number_samples/ 40
616
- extra_right_margin_space = number_samples/ 5
617
+ extra_right_margin_space = number_samples/ 3
617
618
618
619
619
620
position_1 = number_rows/ 3
0 commit comments