예제 #1
0
 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)
예제 #2
0
 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))
예제 #3
0
 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 
예제 #4
0
 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)
예제 #5
0
 def GetColor(self, v):
     vertex_cdr3 = self._GetVertexCDR3(v)
     return utils.GetColorByNormalizedValue('jet', float(self.cdr3s.index(vertex_cdr3)) / len(self.cdr3s))
예제 #6
0
 def GetColor(self, v):
     vertex_div = self.clonal_graph.GetVertexDiversity(v)
     return utils.GetColorByNormalizedValue('coolwarm', float(vertex_div) / self.max_diversity)
예제 #7
0
 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))
예제 #8
0
 def GetColor(self, v):
     vertex_aa = self._GetVertexAA(v)
     return utils.GetColorByNormalizedValue('jet', float(self.aa_seqs.index(vertex_aa)) / len(self.aa_seqs))
예제 #9
0
 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)