comparison tracks/CanvasFeatures.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 5d5fdcb798da
comparison
equal deleted inserted replaced
5:e762f4b9e4bd 6:237707a6b74d
1 #!/usr/bin/env python
2 import json
3 import logging
4
5 from TrackDb import TrackDb
6 from util import subtools
7
8
9 class CanvasFeatures(TrackDb):
10 def __init__(self, trackName, trackLabel, trackDataURL, trackType, dataType, extraSettings=None):
11 super(CanvasFeatures, self).__init__(trackName, trackLabel, trackDataURL, trackType, dataType, extraSettings)
12
13 def prepareExtraSetting(self):
14 """ set CanvasFeatures configuration options """
15 extraConfigs = dict()
16 self.extraSettings["clientConfig"] = dict()
17 self.extraSettings["config"] = dict()
18 if 'color' not in self.extraSettings or not self.extraSettings['color']:
19 self.extraSettings["clientConfig"]['color'] = "#daa520"
20 else:
21 self.extraSettings["clientConfig"]['color'] = self.extraSettings['color']
22 if 'category' not in self.extraSettings or not self.extraSettings['category']:
23 self.extraSettings["config"]['category'] = "Default group"
24 else:
25 self.extraSettings["config"]['category'] = self.extraSettings['category']
26 if 'glyph' in self.extraSettings:
27 self.extraSettings["config"]['glyph'] = self.extraSettings['glyph']
28 if 'transcriptType' in self.extraSettings:
29 self.extraSettings['config']['transcriptType'] = self.extraSettings['transcriptType']
30 extraConfigs["config"] = json.dumps(self.extraSettings["config"])
31 extraConfigs["clientConfig"] = json.dumps(self.extraSettings["clientConfig"])
32 return extraConfigs