comparison tracks/BigwigFeatures.py @ 6:237707a6b74d draft

planemo upload for repository https://github.com/Yating-L/jbrowse-archive-creator.git commit a500f7ab2119cc5faaf80393bd87428389d06880-dirty
author yating-l
date Thu, 15 Feb 2018 17:05:05 -0500
parents
children 62dee5369e80
comparison
equal deleted inserted replaced
5:e762f4b9e4bd 6:237707a6b74d
1 #!/usr/bin/env python
2 import os
3 import json
4 import logging
5
6 from TrackDb import TrackDb
7 from util import subtools
8 from util import santitizer
9
10
11 class BigwigFeatures(TrackDb):
12 def __init__(self, trackName, trackLabel, trackDataURL, trackType, dataType, extraSettings=None):
13 super(BigwigFeatures, self).__init__(trackName, trackLabel, trackDataURL, trackType, dataType, extraSettings)
14
15 def prepareExtraSetting(self):
16 if 'category' not in self.extraSettings or not self.extraSettings['category']:
17 self.extraSettings['category'] = "Default group"
18 if 'color' not in self.extraSettings or not self.extraSettings['color']:
19 self.extraSettings['style'] = {}
20 self.extraSettings['style']['pos_color'] = "#FFA600"
21 else:
22 self.extraSettings['style'] = {}
23 self.extraSettings['style']['pos_color'] = self.extraSettings['color']
24
25
26 '''
27 if 'style' not in self.extraSettings:
28 self.extraSettings['style'] = {}
29 if 'pos_color' not in self.extraSettings['style'] or self.extraSettings['style']['pos_color'] == '':
30 self.extraSettings['style']['pos_color'] = "#FFA600"
31 if 'neg_color' not in self.extraSettings['style'] or self.extraSettings['style']['neg_color'] == '':
32 self.extraSettings['style']['neg_color'] = "#005EFF"
33 '''
34 bigwig_track = dict()
35 bigwig_track['urlTemplate'] = os.path.join('bbi', self.trackName)
36 bigwig_track['type'] = 'JBrowse/View/Track/Wiggle/XYPlot'
37 bigwig_track['storeClass'] = 'JBrowse/Store/SeqFeature/BigWig'
38 bigwig_track['label'] = self.trackLabel
39 bigwig_track['style'] = self.extraSettings['style']
40 bigwig_track['category'] = self.extraSettings['category']
41 #extraConfigs = json.dumps(bigwig_track)
42 extraConfigs = bigwig_track
43 return extraConfigs
44
45