dm.update(r, k, th) def flush(dm): print "saving ...\n" dm.save() def jump(current, limit): return current + random.randint(1, limit) p = Parameter("dsbuilder.") path = p._("contigs_path") sim_threshold = p.f("sim_threshold") k = p.i("k") css = p.i("contigs_sample_size") rss = p.i("reads_sample_size") rrj = p.i("reads_random_jump") save_frequency = p.i("save_frequency") out_path = p._("out_path") dm = DataManager(path, out_path, css) print "processing {0} contigs and {1} reads".format(css, rss) #receive reads stream count = 0 pos = 0 random_pos = jump(pos, rrj)
step = (mxs - mns) / 10 data = ''.join( ['<tr><td>{:.2f}</td></tr>'.format(mns + i * step) for i in range(10)]) return '<table height="500">{}</table>'.format(data) def html(columns, minscore, maxscore, size, p): templ = open('template/heatmap.html').read() templ = templ.replace('_DS_TITLE_DS_', title(p)) templ = templ.replace('_DS_HEATMAP_DS_', heatmap(columns, minscore, maxscore, size)) templ = templ.replace('_DS_COLOR_SCALE_DS_', colorscale(size)) templ = templ.replace('_DS_SCORE_SCALE_DS_', scorescale(minscore, maxscore, size)) return templ p = Parameter() minscore = p.f('project.wizard.heatmap.min') maxscore = p.f('project.wizard.heatmap.max') size = p.i('project.wizard.heatmap.size') next(sys.stdin).strip('\n').split('\t') #skip min,max from input columns = next(sys.stdin).strip('\n').split('\t') print(html(columns, minscore, maxscore, size, p))