diff --git a/treeprofiler/layouts/profile_layouts.py b/treeprofiler/layouts/profile_layouts.py index 92ede11..3d2395d 100644 --- a/treeprofiler/layouts/profile_layouts.py +++ b/treeprofiler/layouts/profile_layouts.py @@ -681,6 +681,7 @@ def __init__(self, seq, value2color=None, self.seq = seq self.seqlength = len(self.seq) self.value2color = value2color + self.absence_color = '#EBEBEB' self.autoformat = True # block if 1px contains > 1 tile @@ -699,7 +700,7 @@ def __init__(self, seq, value2color=None, self.w_scale = self.width / total_width else: self.width = total_width - + # Text self.ftype = ftype @@ -813,7 +814,7 @@ def get_height(x, y): # 'ftype': 'sans-serif', # default sans-serif # } tooltip = f'

{seq}

' - yield draw_array(sm_box, [self.value2color[x] for x in seq], tooltip=tooltip) + yield draw_array(sm_box, [self.value2color[x] if x else self.absence_color for x in seq], tooltip=tooltip) #yield draw_text(sm_box, for i in seq, "jjj", style=style) if self.seq_format == "categorical": @@ -822,4 +823,4 @@ def get_height(x, y): y, h = get_height(sm_x, y) sm_box = Box(sm_x+sm_x0, y, posw * len(seq), h) tooltip = f'

{seq}

' - yield draw_array(sm_box, [self.value2color[x] for x in seq], tooltip=tooltip) \ No newline at end of file + yield draw_array(sm_box, [self.value2color[x] if x else self.absence_color for x in seq], tooltip=tooltip) \ No newline at end of file