#include "common.h" #include "hash.h" #include "portable.h" #include "bed.h" #include "htmshell.h" #include "cart.h" #include "hui.h" #include "web.h" #include "chromGraph.h" #include "hPrint.h" #include "hgGenome.h" #include "trashDir.h" static void quotedBrowserUrl(FILE *f, struct bed3 *bed, struct genoGraph *gg) /* Print URL that will open browser at bed position with genoGraph track on */ { fprintf(f, "\"../../cgi-bin/hgTracks?db=%s&position=%s:%d-%d&hgGenomeClick=browseRegions&%s=full\"", database, bed->chrom, bed->chromStart+1, bed->chromEnd, gg->name); } void browseRegions(struct sqlConnection *conn) /* Put up a frame with a list of links on the left and the * first link selected on the right. */ { struct genoGraph *gg = ggFirstVisible(); double threshold = getThreshold(); struct bed3 *bed, *bedList = regionsOverThreshold(gg); /* Define names of our two frames. */ char *browserFrame = "browser"; char *indexFrame = "index"; /* Write index html file. */ struct tempName indexTn; trashDirFile(&indexTn, "hgg", "index", ".html"); FILE *f = mustOpen(indexTn.forCgi, "w"); htmStart(f, "Region Index"); fprintf(f, ""); fprintf(f, "%s
\n", gg->shortLabel); fprintf(f, "%3.1f Mb in
\n", 0.000001*bedTotalSize((struct bed*)bedList)); fprintf(f, "%d regions > %g
\n", slCount(bedList), threshold); for (bed = bedList; bed != NULL; bed = bed->next) { fprintf(f, "", browserFrame); fprintf(f, "%s %3.1fM to %3.1fM
", bed->chrom, 0.000001*bed->chromStart, 0.000001*bed->chromEnd); } fprintf(f, "\n"); carefulClose(&f); /* Write frames */ hPrintf("\n"); hPrintf("%s Regions >= %g\n", gg->shortLabel, threshold); hPrintf("\n"); hPrintf("\n", indexTn.forCgi, indexFrame); hPrintf("\n", browserFrame); hPrintf("<BODY></BODY>\n"); hPrintf("\n"); hPrintf("\n"); }