-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.py
43 lines (31 loc) · 939 Bytes
/
app.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
from flask import Flask, render_template, request, jsonify
from gevent.wsgi import WSGIServer
from colemankb.annotations import ColemanKB
app = Flask(__name__)
app.debug = True
s = ColemanKB()
@app.route("/")
def main():
s.connect_spreadsheet()
return 'Hello'
@app.route("/annotate")
def annotate():
s.protein_change = request.args.get('protein_change')
s.variant_type = request.args.get('variant_type')
s.gene = request.args.get('gene')
try:
s.exac = float(request.args.get('exac'))
except TypeError:
s.exac = ''
tier = s.annotate_variant()
data = {
'gene': s.gene,
'protein_change': s.protein_change,
'variant_type': s.variant_type,
'tier': tier,
}
return jsonify(data)
if __name__ == "__main__":
http_server = WSGIServer(('0.0.0.0', 4848), app)
http_server.serve_forever()
#app.run(host='0.0.0.0',debug=True, port=4848)