2 new commits in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/changeset/869c72ce37e6/ changeset: 869c72ce37e6 user: jgoecks date: 2012-05-21 18:10:30 summary: Update comments and coding conventions in Trackster code. affected #: 2 files diff -r 41f3a789037ed5a8785a8531567871d904cf25f2 -r 869c72ce37e67eb4daf44a4a6d6b8cbb5400b616 lib/galaxy/visualization/tracks/summary.py --- a/lib/galaxy/visualization/tracks/summary.py +++ b/lib/galaxy/visualization/tracks/summary.py @@ -1,5 +1,4 @@ ''' -2010, Kanwei Li Summary tree data structure for aggregation 10/20/2010: Changed version to 2 as we no longer look at bottom level, for better performance @@ -12,7 +11,7 @@ MIN_LEVEL = 2 class SummaryTree: - def __init__(self, block_size, levels, draw_cutoff, detail_cutoff): + def __init__( self, block_size, levels, draw_cutoff, detail_cutoff ): self.version = VERSION self.chrom_blocks = {} self.levels = levels @@ -21,73 +20,73 @@ self.block_size = block_size self.chrom_stats = {} - def find_block(self, num, level): - return (num / self.block_size ** level) + def find_block( self, num, level ): + return ( num / self.block_size ** level ) - def insert_range(self, chrom, start, end): + def insert_range( self, chrom, start, end ): if chrom in self.chrom_blocks: - blocks = self.chrom_blocks[chrom] + blocks = self.chrom_blocks[ chrom ] else: - blocks = self.chrom_blocks[chrom] = {} - self.chrom_stats[chrom] = {} - for level in range(MIN_LEVEL, self.levels+1): - blocks[level] = {} + blocks = self.chrom_blocks[ chrom ] = {} + self.chrom_stats[ chrom ] = {} + for level in range( MIN_LEVEL, self.levels+1 ): + blocks[ level ] = {} - for level in range(MIN_LEVEL, self.levels+1): - block_level = blocks[level] - starting_block = self.find_block(start, level) - ending_block = self.find_block(end, level) - for block in range(starting_block, ending_block+1): + for level in range( MIN_LEVEL, self.levels+1 ): + block_level = blocks[ level ] + starting_block = self.find_block( start, level ) + ending_block = self.find_block( end, level ) + for block in range( starting_block, ending_block+1 ): if block in block_level: - block_level[block] += 1 + block_level[ block ] += 1 else: - block_level[block] = 1 + block_level[ block ] = 1 - def finish(self): + def finish( self ): ''' Checks for cutoff and only stores levels above it ''' for chrom, blocks in self.chrom_blocks.iteritems(): cur_best = 999 - for level in range(self.levels, MIN_LEVEL-1, -1): - max_val = max(blocks[level].values()) + for level in range( self.levels, MIN_LEVEL-1, -1 ): + max_val = max( blocks[ level ].values() ) if max_val < self.draw_cutoff: - if "draw_level" not in self.chrom_stats[chrom]: - self.chrom_stats[chrom]["draw_level"] = level + if "draw_level" not in self.chrom_stats[ chrom ]: + self.chrom_stats[ chrom ][ "draw_level" ] = level elif max_val < self.detail_cutoff: - self.chrom_stats[chrom]["detail_level"] = level + self.chrom_stats[ chrom ][ "detail_level" ] = level break else: - self.chrom_stats[chrom][level] = {} - self.chrom_stats[chrom][level]["delta"] = self.block_size ** level - self.chrom_stats[chrom][level]["max"] = max_val - self.chrom_stats[chrom][level]["avg"] = float(max_val) / len(blocks[level]) + self.chrom_stats[ chrom ][ level ] = {} + self.chrom_stats[ chrom ][ level ][ "delta" ] = self.block_size ** level + self.chrom_stats[ chrom ][ level ][ "max" ] = max_val + self.chrom_stats[ chrom ][ level ][ "avg" ] = float( max_val ) / len( blocks[ level ] ) cur_best = level - self.chrom_blocks[chrom] = dict([ (key, value) for key, value in blocks.iteritems() if key >= cur_best ]) + self.chrom_blocks[ chrom ] = dict( [ ( key, value ) for key, value in blocks.iteritems() if key >= cur_best ] ) - def query(self, chrom, start, end, level): + def query( self, chrom, start, end, level ): if chrom in self.chrom_blocks: - stats = self.chrom_stats[chrom] - if "detail_level" in stats and level <= stats["detail_level"]: + stats = self.chrom_stats[ chrom ] + if "detail_level" in stats and level <= stats[ "detail_level" ]: return "detail" - elif "draw_level" in stats and level <= stats["draw_level"]: + elif "draw_level" in stats and level <= stats[ "draw_level" ]: return "draw" - blocks = self.chrom_blocks[chrom] - results = [] + blocks = self.chrom_blocks[ chrom ] + results = [ ] multiplier = self.block_size ** level - starting_block = self.find_block(start, level) - ending_block = self.find_block(end, level) - for block in range(starting_block, ending_block+1): - if block in blocks[level]: - results.append( (block * multiplier, blocks[level][block]) ) + starting_block = self.find_block( start, level ) + ending_block = self.find_block( end, level ) + for block in range( starting_block, ending_block+1 ): + if block in blocks[ level ]: + results.append( ( block * multiplier, blocks[ level ][ block ] ) ) return results return None - def write(self, filename): + def write( self, filename ): self.finish() - cPickle.dump(self, open(filename, 'wb'), 2) + cPickle.dump( self, open( filename, 'wb' ), 2 ) -def summary_tree_from_file(filename): - return cPickle.load(open(filename, "rb")) +def summary_tree_from_file( filename ): + return cPickle.load( open( filename, "rb" ) ) diff -r 41f3a789037ed5a8785a8531567871d904cf25f2 -r 869c72ce37e67eb4daf44a4a6d6b8cbb5400b616 static/scripts/trackster.js --- a/static/scripts/trackster.js +++ b/static/scripts/trackster.js @@ -1,6 +1,7 @@ -/* Trackster - 2010-2011: James Taylor, Kanwei Li, Jeremy Goecks -*/ +/** + * Trackster visualization. Trackster is both a genome browser and a visual + * analysis environment that combines both visualization and analysis tools. + */ var class_module = function(require, exports) { https://bitbucket.org/galaxy/galaxy-central/changeset/5096491eaff7/ changeset: 5096491eaff7 user: jgoecks date: 2012-05-21 18:10:55 summary: Add missing import. affected #: 1 file diff -r 869c72ce37e67eb4daf44a4a6d6b8cbb5400b616 -r 5096491eaff782116eed1640e350ab9fe1444460 lib/galaxy/visualization/tracks/genomes.py --- a/lib/galaxy/visualization/tracks/genomes.py +++ b/lib/galaxy/visualization/tracks/genomes.py @@ -1,4 +1,4 @@ -import os, re +import os, re, sys from bx.seq.twobit import TwoBitFile from galaxy.util.json import from_json_string from galaxy import model Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.