aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHao Chen2019-05-21 16:36:07 -0500
committerHao Chen2019-05-21 16:36:07 -0500
commit2ad607c82756d39749056cf68a6b57cde50d5d3c (patch)
tree0b70e2cca7b653ea8468ccc53028ecae9b53b532
parente87aa54962f20d93e3cea18f425bb3f820768e63 (diff)
downloadgenecup-2ad607c82756d39749056cf68a6b57cde50d5d3c.tar.gz
url for GWAS nodes
-rwxr-xr-xratspub.py4
-rwxr-xr-xserver.py9
2 files changed, 7 insertions, 6 deletions
diff --git a/ratspub.py b/ratspub.py
index 9b24e9d..8ee1f74 100755
--- a/ratspub.py
+++ b/ratspub.py
@@ -86,11 +86,13 @@ def searchArchived(sets, query):
for key in catCnt.keys():
if sets=='gwas':
nc=nodecolor["gwas"]
+ nodes += "{ data: { id: '" + key + "', nodecolor: '" + nc + "', url:'https://www.ebi.ac.uk/gwas/search?query="+key.replace("_GWAS","")+"' } },\n"
elif key in drug_d.keys():
nc=nodecolor["drug"]
+ nodes += "{ data: { id: '" + key + "', nodecolor: '" + nc + "', url:'/shownode?node="+key+"' } },\n"
else:
nc=nodecolor["addiction"]
- nodes += "{ data: { id: '" + key + "', nodecolor: '" + nc + "', nodetype: 'top150', url:'/shownode?node="+key+"' } },\n"
+ nodes += "{ data: { id: '" + key + "', nodecolor: '" + nc + "', url:'/shownode?node="+key+"' } },\n"
edgeID=dataFile+"|"+query+"|"+key
edges+="{ data: { id: '" + edgeID+ "', source: '" + query + "', target: '" + key + "', sentCnt: " + str(catCnt[key]) + ", url:'/sentences?edgeID=" + edgeID + "' } },\n"
return(nodes+edges)
diff --git a/server.py b/server.py
index 24476c6..79ab2ca 100755
--- a/server.py
+++ b/server.py
@@ -63,14 +63,14 @@ def search():
sent0=gene_category(gene, addiction_d, addiction, "addiction")
e0=generate_edges(sent0, tf_name)
#
- function=undic(function_d)
- sent1=gene_category(gene, function_d, function, "function")
+ drug=undic(drug_d)
+ sent1=gene_category(gene, drug_d, drug, "drug")
progress+=percent
yield "data:"+str(progress)+"\n\n"
e1=generate_edges(sent1, tf_name)
#
- drug=undic(drug_d)
- sent2=gene_category(gene, drug_d, drug, "drug")
+ function=undic(function_d)
+ sent2=gene_category(gene, function_d, function, "function")
progress+=percent
yield "data:"+str(progress)+"\n\n"
e2=generate_edges(sent2, tf_name)
@@ -224,7 +224,6 @@ def showGeneTopGene ():
results=result_f.read()
return render_template('sentences.html', sentences=results+"<p><br>")
-
## generate a page that lists all the top 150 addiction genes with links to cytoscape graph.
@app.route("/allTopGenes")
def top150genes():