Skip to content

Commit 3a630a2

Browse files
authored
Merge branch 'master' into uwsgi
2 parents 13b48bd + 0f9865e commit 3a630a2

File tree

2 files changed

+12
-13
lines changed

2 files changed

+12
-13
lines changed

hicbrowser/client/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@
3636
"feature-viewer": "^0.1.44",
3737
"grunt-contrib-watch": "^1.0.0",
3838
"grunt-processhtml": "^0.3.13",
39-
"jquery": "^2.2.2"
39+
"jquery": "^2.2.2",
40+
"underscore": "^1.8.3",
41+
"handlebars": "^4.0.6"
4042
}
4143
}

hicbrowser/views.py

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
import sys
2-
import os
32
import numpy as np
43
from flask import Flask, render_template, request, send_file
54

65
import os
7-
from os.path import basename, exists
6+
from os.path import exists
87

98
import json
109

@@ -18,6 +17,7 @@
1817
hicexplorer.trackPlot.DEFAULT_WIDTH_RATIOS = (0.89, 0.11)
1918
hicexplorer.trackPlot.DEFAULT_MARGINS = {'left': 0.02, 'right': 0.98, 'bottom': 0, 'top': 1}
2019

20+
2121
def get_TAD_for_gene(gene_name):
2222
"""
2323
Returs the TAD position of a given gene name
@@ -34,8 +34,7 @@ def get_TAD_for_gene(gene_name):
3434
chrom_ = chrom_[3:]
3535
else:
3636
chrom_ = 'chr' + chrom_
37-
tad_pos = tads_intval_tree[chrom_].find(start_, end_)[0]
38-
37+
tad_pos = sorted(tads_intval_tree[chrom_][start_, end_])[0]
3938
return chrom_, tad_pos.start, tad_pos.end
4039
else:
4140
return None
@@ -148,9 +147,9 @@ def main(config_file, port, numProc, template_folder=None, debug=False):
148147

149148
# register an static path for images using Blueprint
150149
images_static = Blueprint('site', __name__,
151-
static_url_path='/images',
152-
template_folder=template_folder,
153-
static_folder=img_path)
150+
static_url_path='/images',
151+
template_folder=template_folder,
152+
static_folder=img_path)
154153
app.register_blueprint(images_static)
155154

156155
# setup up the tracks. It works as follows
@@ -190,8 +189,6 @@ def main(config_file, port, numProc, template_folder=None, debug=False):
190189
track_file = config.get('general', 'tracks')
191190
tads = hicbrowser.tracks2json.SetTracks(track_file, fig_width=40)
192191

193-
#tads = hicexplorer.trackPlot.PlotTracks(track_file, fig_width=40, dpi=70)
194-
195192
from hicexplorer.trackPlot import opener
196193
with opener(genes) as fh:
197194
for line in fh.readlines():
@@ -223,9 +220,9 @@ def get_tad(gene_name):
223220

224221
# plot
225222
outfile = "{}/{}_{}_{}.json".format(tad_img_root,
226-
chromosome,
227-
start,
228-
end)
223+
chromosome,
224+
start,
225+
end)
229226
if not exists(outfile):
230227
with open(outfile, 'w') as fh:
231228
sys.stderr.write("Saving json file: {}\n".format(outfile))

0 commit comments

Comments
 (0)