def GetColor(self, v): seq_id = self.clonal_tree.GetSequenceByVertex(v).id aa_seq = self.id_aa_dict[seq_id] norm_value = 0 if self.max_aa_freq > 0: norm_value = float(len(self.aa_dict[aa_seq]) - 1) / self.max_aa_freq return utils.GetColorByNormalizedValue('PuRd', norm_value)
def GetColor(self, v): vertex_mult = self._GetVertexMultiplicity(v) level_ind = len(self.levels) for i in range(len(self.levels)): if vertex_mult <= self.levels[i]: level_ind = i break return utils.GetColorByNormalizedValue('Reds', float(level_ind) / len(self.levels))
def _SetColors(self): if self.colors_set: return self.color_dict = dict() index = 0 for label in sorted(self.individual_labels): self.color_dict[label] = utils.GetColorByNormalizedValue(self.cmap_name, float(index) / len(self.individual_labels)) index += 1 self.colors_set = True
def GetColor(self, v): seq_id = self.clonal_tree.GetSequenceByVertex(v).id rel_value = 0 if self.max_num_shms - self.min_num_shms != 0: rel_value = float(self.seq_shm_dict[seq_id] - self.min_num_shms) / (self.max_num_shms - self.min_num_shms) return utils.GetColorByNormalizedValue('Greens', rel_value)
def GetColor(self, v): vertex_cdr3 = self._GetVertexCDR3(v) return utils.GetColorByNormalizedValue('jet', float(self.cdr3s.index(vertex_cdr3)) / len(self.cdr3s))
def GetColor(self, v): vertex_div = self.clonal_graph.GetVertexDiversity(v) return utils.GetColorByNormalizedValue('coolwarm', float(vertex_div) / self.max_diversity)
def GetColor(self, v): vertex_mult = min(self.max_mult, self._GetVertexMultiplicity(v)) return utils.GetColorByNormalizedValue('Greens', float(vertex_mult - self.min_mult) / (self.max_mult - self.min_mult))
def GetColor(self, v): vertex_aa = self._GetVertexAA(v) return utils.GetColorByNormalizedValue('jet', float(self.aa_seqs.index(vertex_aa)) / len(self.aa_seqs))
def GetColor(self, v): num_shms = min(self.clonal_graph.GetNumVSHMsByVertex(v)) mun_shms = min(num_shms, self.max_num_shms) return utils.GetColorByNormalizedValue( 'Blues', float(mun_shms) / self.max_num_shms)