@@ -683,10 +683,10 @@ def plot_interactive(anchor_name, chrom, start_coord, end_coord, step, pancounts
683
683
hasexon = "exon" in anno_types
684
684
685
685
c = np .arange (len (anno_types ) + (not hasexon ))
686
- ann_colors = np .array (px .colors .qualitative .Dark24 )
686
+ ann_colors = np .array (px .colors .qualitative .Prism )
687
687
ann_colors = ann_colors [c % len (ann_colors )]
688
688
689
- linewidth = 5 if hasexon else 15
689
+ linewidth = 1 if hasexon else 15
690
690
print ("WIDHT" , linewidth )
691
691
692
692
fig .append_trace (go .Scattergl (
@@ -711,14 +711,14 @@ def plot_interactive(anchor_name, chrom, start_coord, end_coord, step, pancounts
711
711
anno ["break" ] = np .nan
712
712
for t , df in anno .groupby ("type_id" ):
713
713
xs = df [["start" ,"end" ,"break" ]].to_numpy ().flatten ()
714
- ys = np .full (len (xs ),- t )
714
+ ys = np .full (len (xs ),- t * 2 )
715
715
name = df ["type" ].iloc [0 ]
716
716
717
717
if name == "exon" :
718
718
linewidth = 15
719
719
else :
720
720
anno_names .append (name )
721
- linewidth = 10
721
+ linewidth = 1
722
722
723
723
fig .append_trace (go .Scattergl (x = xs , y = ys ,
724
724
line = dict (width = linewidth ,color = ann_colors [t ]),
@@ -727,13 +727,21 @@ def plot_interactive(anchor_name, chrom, start_coord, end_coord, step, pancounts
727
727
hovertemplate = '<br>x:%{x}<br>m:%{text}' ,
728
728
text = np .repeat (df ["name" ],3 ),
729
729
showlegend = False ,
730
- marker = {"symbol" :"line-ns" ,"line_color" :ann_colors [t ],"line_width" :1 ,"size" :6 },
730
+ opacity = 0.7 ,
731
+ marker = {"symbol" :"line-ns" ,"line_color" :ann_colors [t ],"line_width" :1 ,"size" :2 },
731
732
mode = "lines+markers"
732
733
), row = 2 , col = 1 )
733
734
735
+ ys = np .arange (- len (ann_colors ),0 )+ 1
736
+ names = anno_names [::- 1 ]
737
+ if len (ys ) > 10 :
738
+ n = len (ys )// 10
739
+ ys = ys [::n ]
740
+ names = names [::n ]
741
+
734
742
fig .update_yaxes (
735
- tickvals = np . arange ( - len ( ann_colors ), 0 ) + 1 , ticktext = anno_names [:: - 1 ] ,
736
- range = [- len (ann_colors )+ 0.5 ,0 .5 ], #title="Annotation",
743
+ tickvals = ys , ticktext = names ,
744
+ range = [- len (ann_colors )- 0.5 ,1 .5 ], #title="Annotation",
737
745
row = 2 , col = 1
738
746
)
739
747
0 commit comments