Mercurial > repos > iuc > jbrowse
comparison jbrowse.py @ 11:4cbceec1d6b4 draft
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse commit 172014e3f03ea00dfd5fcd689e1246d001e82288
author | iuc |
---|---|
date | Wed, 14 Dec 2016 09:19:48 -0500 |
parents | 1a6d882d340d |
children | db5fe5a3176a |
comparison
equal
deleted
inserted
replaced
10:1a6d882d340d | 11:4cbceec1d6b4 |
---|---|
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 import argparse | 2 import argparse |
3 import codecs | |
3 import copy | 4 import copy |
4 import hashlib | 5 import hashlib |
5 import json | 6 import json |
6 import logging | 7 import logging |
7 import os | 8 import os |
125 def __init__(self): | 126 def __init__(self): |
126 self.brewer_colour_idx = 0 | 127 self.brewer_colour_idx = 0 |
127 | 128 |
128 def rgb_from_hex(self, hexstr): | 129 def rgb_from_hex(self, hexstr): |
129 # http://stackoverflow.com/questions/4296249/how-do-i-convert-a-hex-triplet-to-an-rgb-tuple-and-back | 130 # http://stackoverflow.com/questions/4296249/how-do-i-convert-a-hex-triplet-to-an-rgb-tuple-and-back |
130 return struct.unpack('BBB', hexstr.decode('hex')) | 131 return struct.unpack('BBB', codecs.decode(hexstr, 'hex')) |
131 | 132 |
132 def min_max_gff(self, gff_file): | 133 def min_max_gff(self, gff_file): |
133 min_val = None | 134 min_val = None |
134 max_val = None | 135 max_val = None |
135 with open(gff_file, 'r') as handle: | 136 with open(gff_file, 'r') as handle: |