diff 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
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tracks/BigwigFeatures.py	Fri Oct 13 12:44:31 2017 -0400
@@ -0,0 +1,45 @@
+#!/usr/bin/env python
+import os
+import json
+import logging
+
+from TrackDb import TrackDb
+from util import subtools
+from util import santitizer
+
+
+class BigwigFeatures(TrackDb):
+    def __init__(self, trackName, trackLabel, trackDataURL, trackType, dataType, extraSettings=None):
+        super(BigwigFeatures, self).__init__(trackName, trackLabel, trackDataURL, trackType, dataType, extraSettings)
+ 
+    def prepareExtraSetting(self):
+        if 'category' not in self.extraSettings or not self.extraSettings['category']:
+            self.extraSettings['category'] = "Default group"
+        if 'color' not in self.extraSettings or not self.extraSettings['color']:
+            self.extraSettings['style'] = {}
+            self.extraSettings['style']['pos_color'] = "#FFA600"
+        else:
+            self.extraSettings['style'] = {}
+            self.extraSettings['style']['pos_color'] = self.extraSettings['color']
+            
+            
+        '''
+        if 'style' not in self.extraSettings:
+            self.extraSettings['style'] = {}
+            if 'pos_color' not in self.extraSettings['style'] or self.extraSettings['style']['pos_color'] == '':
+                self.extraSettings['style']['pos_color'] = "#FFA600"
+            if 'neg_color' not in self.extraSettings['style'] or self.extraSettings['style']['neg_color'] == '':
+                self.extraSettings['style']['neg_color'] = "#005EFF"
+        '''
+        bigwig_track = dict()
+        bigwig_track['urlTemplate'] = os.path.join('bbi', self.trackName)
+        bigwig_track['type'] = 'JBrowse/View/Track/Wiggle/XYPlot'
+        bigwig_track['storeClass'] = 'JBrowse/Store/SeqFeature/BigWig'
+        bigwig_track['label'] = self.trackLabel
+        bigwig_track['style'] = self.extraSettings['style']
+        bigwig_track['category'] = self.extraSettings['category']
+        #extraConfigs = json.dumps(bigwig_track)
+        extraConfigs = bigwig_track
+        return extraConfigs
+
+    
\ No newline at end of file