diff options
author | Hao Chen | 2019-05-08 01:55:31 -0500 |
---|---|---|
committer | Hao Chen | 2019-05-08 01:55:31 -0500 |
commit | efaf3a4abe2f6ae5b67578182085d18d05f25c5f (patch) | |
tree | 00ee6bb45907e03cc192e469892c06c30e0f2e6b /server.py | |
parent | 577515fb8afdf7fa535a3b16d13f261696bb6ce0 (diff) | |
download | genecup-efaf3a4abe2f6ae5b67578182085d18d05f25c5f.tar.gz |
multiple genes allowed
Diffstat (limited to 'server.py')
-rw-r--r-- | server.py | 25 |
1 files changed, 16 insertions, 9 deletions
@@ -19,14 +19,21 @@ def network(): nodes_list=[] if request.method == 'POST': term = request.form - gene=term['query'] - nodes="{ data: { id: '" + gene + "', nodecolor:'#FADBD8'} },\n" + default_nodes - tmp0=gene_addiction(gene) - e0=generate_edges(tmp0) - tmp1=gene_functional(gene) - e1=generate_edges(tmp1) - tmp2=gene_anatomical(gene) - e2=generate_edges(tmp2) - return render_template('network.html', elements=nodes+e0+e1+e2) + genes=term['query'] + genes=genes.replace(",", " ") + genes=genes.replace(";", " ") + genes=genes.split() + nodes=default_nodes + edges=str() + for gene in genes: + nodes+="{ data: { id: '" + gene + "', nodecolor:'#FADBD8', fontweight:700} },\n" + tmp0=gene_addiction(gene) + e0=generate_edges(tmp0) + tmp1=gene_functional(gene) + e1=generate_edges(tmp1) + tmp2=gene_anatomical(gene) + e2=generate_edges(tmp2) + edges+=e0+e1+e2 + return render_template('network.html', elements=nodes+edges) if __name__ == '__main__': app.run(debug=True) |