def num_mice_all_epitopes_color(num_mice_all_epitopes): if max_num_mice_all_epitopes == 1: return svg_basic.rgb_from_fraction(0.0) else: return svg_basic.rgb_from_fraction( float(num_mice_all_epitopes - 1) / (max_num_mice_all_epitopes - 1))
def get_tcr_score_color(index): score = my_color_scores_floats[index] if score == None: return 'black' if color_score_range: mn, mx = color_score_range else: mn, mx = mn_score_color, mx_score_color if mx == mn: mx = mn + 1 return svg_basic.rgb_from_fraction( max(0.0, min(1.0, (score - mn) / (mx - mn))))
def clonality_color(clone_size): return svg_basic.rgb_from_fraction(clonality_fraction(clone_size))