Mercurial > repos > yating-l > jbrowsearchivecreator
comparison tracks/BigwigFeatures.py @ 25:31a41ce128cc draft
planemo upload for repository https://github.com/Yating-L/jbrowse-archive-creator.git commit 691e5366893905d30943a3cb8cdfb6341f0f5362-dirty
| author | yating-l |
|---|---|
| date | Fri, 13 Oct 2017 12:44:31 -0400 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| 24:bb6fdccef474 | 25:31a41ce128cc |
|---|---|
| 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 |
