7a3a9c41b9f6b37c339f5b79cb8140fb16025b5d max Thu Oct 5 15:11:28 2017 -0700 changing interaction viewer hgGene link, refs #19454 diff --git src/hg/hgGeneGraph/hgGeneGraph src/hg/hgGeneGraph/hgGeneGraph index e34b758..9ac9129 100755 --- src/hg/hgGeneGraph/hgGeneGraph +++ src/hg/hgGeneGraph/hgGeneGraph @@ -772,31 +772,31 @@ tooltipLines.append(" <small>Click link to show details</small>") tooltip = "".join(tooltipLines) url = makeSelfUrl({"gene" : None, "lastGene":targetGene, "link":gene2+":"+gene1}) url = url.replace("&", "&") # otherwise is invalid SVG ofh.write('"%s" -> "%s" [dir="%s"; penwidth=%d; %s edgetooltip = "%s"; URL="%s", style=%s ]; \n' % \ (gene1, gene2, arrDir, thick, addStr, tooltip, url, style)) ofh.write("}\n") ofh.close() def getPos (db, gene, pos): " print position as link " chrom, start, end = pos if (chrom!="" and start!=""): - return """ located at <A title="link to Genome Browser" HREF="../cgi-bin/hgTracks?db=%s&position=%s:%d-%s">%s:%s-%s</A><BR>""" % \ + return """(<A title="link to Genome Browser" HREF="../cgi-bin/hgTracks?db=%s&position=%s:%d-%s">%s:%s-%s</A>)""" % \ (db, chrom, start, end, chrom, start, end) else: return "" def queryPos(conn, gene): "return position of gene symbol as tuple (chrom, start, end) from kgXref, fallback to refGene " rows = sqlQuery(conn, "select chrom, chromStart, chromEnd from knownCanonical JOIN kgXref ON kgId=transcript where geneSymbol='%s'" % gene) if len(rows)==0: # "INS" is not in kgXref??? rows = sqlQuery(conn, 'select chrom, txStart, txEnd from refGene where name2="%s" limit 1;' % gene) if len(rows)==0: return "", "", "" return rows[0] @@ -1361,33 +1361,32 @@ graphLinks, lowLinks = buildGraph(conn, gene, geneCount, MINSUPP, addNeighbors) weightedLinks, minAbsCount = flattenLink(graphLinks) humanDb = getCgiVar("db", "hg19") hgGeneLink = makeHgGeneLink(gene, humanDb) # get the position of the gene humanConn = sqlConnect(humanDb) pos = queryPos(humanConn, gene) posLink = getPos (humanDb, gene, pos) # not showing literome link for now on the first page, Literome times out too often #litLink = '<a target=_blank href="http://literome.azurewebsites.net/Network?gene1=%s">(Literome)</a>' % (gene) #title = "Top %d genes that interact with %s %s %s" % (geneCount, hgGeneLink, litLink, posLink) - title = "Top %d genes that interact with %s %s" % (geneCount, hgGeneLink, posLink) + title = "%s: top %d interacting genes %s" % (hgGeneLink, geneCount, posLink) printHgcSection(title, "") - #print("<h3>Top %d genes that interact with %s mentioned in more than %d articles</h3>" % (gene, minAbsCount)) # print the interaction graph as an image map printGraph(conn, weightedLinks, alg, addNeighbors, gene, "png") print('</div>') print('</div>') printLowLinksTable(gene, lowLinks, sortByCount) #printPmidSearchForm() printHgcSection("Data information", "", id='#INFO') #printDisclaimer() printInfo() print('</div>')