Exemplo n.º 1
0
 def __init__(self, file, **kwargs):
     properties = GTF.DEFAULT_PROPERTIES.copy()
     properties.update({'file': file, **kwargs})
     super().__init__(properties)
     self.bgz_file = build_gtf_index(file)
     color = self.properties['color']
     if (type(color) is str) and (color.startswith('#')):
         self.colors = [color]
     elif type(color) is list:
         self.colors = [
             c for c in color if (type(c) is str) and c.startswith('#')
         ]
         if not self.colors:
             self.colors = GTF.RANDOM_COLORS
     else:
         self.colors = GTF.RANDOM_COLORS
Exemplo n.º 2
0
 def __init__(self, file_, **kwargs):
     properties_dict = {
         "file": file_,
         "row_filter": 'feature == "gene"',
         "length_ratio_thresh": 0.005,
         "height": GTF.DEFAULT_HEIGHT,
         "title": '',
         "color": 'random',
     }
     properties_dict.update(kwargs)
     super().__init__(properties_dict)
     self.bgz_file = build_gtf_index(file_)
     color = self.properties['color']
     if (type(color) is str) and (color.startswith('#')):
         self.colors = [color]
     elif type(color) is list:
         self.colors = [
             c for c in color if (type(c) is str) and c.startswith('#')
         ]
         if len(self.colors) == 0:
             self.colors = GTF.RANDOM_COLORS
     else:
         self.colors = GTF.RANDOM_COLORS