From d883f2e9e6151d0bc5c1e25924253221312b4959 Mon Sep 17 00:00:00 2001 From: Hao Chen Date: Sun, 19 May 2019 18:03:32 -0500 Subject: top gene results display method --- ratspub.png | Bin 257828 -> 0 bytes server.py | 11 +++++++---- 2 files changed, 7 insertions(+), 4 deletions(-) delete mode 100644 ratspub.png diff --git a/ratspub.png b/ratspub.png deleted file mode 100644 index 345e40a..0000000 Binary files a/ratspub.png and /dev/null differ diff --git a/server.py b/server.py index 3dc7f9c..62a959e 100755 --- a/server.py +++ b/server.py @@ -194,16 +194,19 @@ def gene_gene(): with open(gg_file, "w+") as gg: gg.write(out) gg.close() - results="

Gene vs top addiction genes

Click on the number of sentences will show those sentences. Click on the top addiction genes will show an archived search for that gene.
" + results="

"+query+" vs top addiction genes

Click on the number of sentences will show those sentences. Click on the top addiction genes will show an archived search for that gene.
" topGeneHits={} for key in hitGenes.keys(): url=gg_file+"|"+query+"|"+key - topGeneHits["
  • "+query+" and "+key+" : " + str(hitGenes[key]) + " sentences. \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[ "
  • " + "Show " + str(hitGenes[key]) + " " + sentword +" about "+query+" and "+key+"" ]=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+"


    ") ## generate a page that lists all the top 150 addiction genes with links to cytoscape graph. @app.route("/allTopGenes") -- cgit v1.2.3