diff options
author | Hao Chen | 2019-05-19 18:03:32 -0500 |
---|---|---|
committer | Hao Chen | 2019-05-19 18:03:32 -0500 |
commit | d883f2e9e6151d0bc5c1e25924253221312b4959 (patch) | |
tree | 346264e463438e43034ee5b783e9cf24822ec96e | |
parent | 6e90fb4af7b6163b1687910f416be89901a69731 (diff) | |
download | genecup-d883f2e9e6151d0bc5c1e25924253221312b4959.tar.gz |
top gene results display method
-rw-r--r-- | ratspub.png | bin | 257828 -> 0 bytes | |||
-rwxr-xr-x | server.py | 11 |
2 files changed, 7 insertions, 4 deletions
diff --git a/ratspub.png b/ratspub.png Binary files differdeleted file mode 100644 index 345e40a..0000000 --- a/ratspub.png +++ /dev/null @@ -194,16 +194,19 @@ def gene_gene(): with open(gg_file, "w+") as gg: gg.write(out) gg.close() - results="<h4>Gene vs top addiction genes</h4> Click on the number of sentences will show those sentences. Click on the <span style=\"background-color:#FcF3cf\">top addiction genes</span> will show an archived search for that gene.<hr>" + results="<h4>"+query+" vs top addiction genes</h4> Click on the number of sentences will show those sentences. Click on the <span style=\"background-color:#FcF3cf\">top addiction genes</span> will show an archived search for that gene.<hr>" topGeneHits={} for key in hitGenes.keys(): url=gg_file+"|"+query+"|"+key - topGeneHits["<li>"+query+" and <a href=/showTopGene?topGene="+key+" target=_gene><span style=\"background-color:#FcF3cf\">"+key+"</span></a> : <a href=/sentences?edgeID=" + url+ " target=_new>" + str(hitGenes[key]) + " sentences.</a> \n"]=hitGenes[key] - #yyps = [(k, d[k]) for k in sorted(d, key=d.get, reverse=True)] + if hitGenes[key]==1: + sentword="sentence" + else: + sentword="sentences" + topGeneHits[ "<li> <a href=/sentences?edgeID=" + url+ " target=_new>" + "Show " + str(hitGenes[key]) + " " + sentword +" </a> about "+query+" and <a href=/showTopGene?topGene="+key+" target=_gene><span style=\"background-color:#FcF3cf\">"+key+"</span></a>" ]=hitGenes[key] topSorted = [(k, topGeneHits[k]) for k in sorted(topGeneHits, key=topGeneHits.get, reverse=True)] for k,v in topSorted: results+=k - return render_template("sentences.html", sentences=results) + 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") |