be4311c07e14feb728abc6425ee606ffaa611a58 markd Fri Jan 22 06:46:58 2021 -0800 merge with master diff --git src/hg/hgTracks/hgTracks.c src/hg/hgTracks/hgTracks.c index 3eaf710..a49db1c 100644 --- src/hg/hgTracks/hgTracks.c +++ src/hg/hgTracks/hgTracks.c @@ -4221,30 +4221,35 @@ errCatchFree(&errCatch); bed->chrom=cloneString(bed->chrom); // loadAndValidateBed does not do it for speed. but bedFree needs it. struct chromInfo *ci = hGetChromInfo(database, bed->chrom); if (ci == NULL) { warn("Couldn't find chromosome/scaffold %s in database", bed->chrom); return FALSE; } if (bed->chromEnd > ci->size) { warn("BED chromEnd %u > size %u for chromosome/scaffold %s", bed->chromEnd, ci->size, bed->chrom); return FALSE; } + if (!(bed->chromEnd > bed->chromStart)) // do not allow empty regions + { + warn("BED chromEnd %u must be greater than chromStart %u %s", bed->chromEnd, bed->chromStart, bed->chrom); + return FALSE; + } slAddHead(&bedList, bed); struct virtRegion *v; if (numFields < 12) { AllocVar(v); v->chrom = cloneString(bed->chrom); v->start = bed->chromStart; v->end = bed->chromEnd; slAddHead(&virtRegionList, v); } else { int e; @@ -8847,43 +8852,43 @@ hButtonWithOnClick("hgt.setWidth", "resize", "Resize image width to browser window size", "hgTracksSetWidth()"); hPrintf(" "); hButtonWithMsg("hgt.refresh", "refresh","Refresh image"); hPrintf("<BR>\n"); if( chromosomeColorsMade ) { hPrintf("<B>Chromosome Color Key:</B><BR> "); hPrintf("<IMG SRC = \"../images/new_colorchrom.gif\" BORDER=1 WIDTH=596 HEIGHT=18 ><BR>\n"); } if (doPliColors) { - hPrintf("<B>gnomAD Loss-of-Function Constraint (pLI) Color Key:</B><BR> "); + hPrintf("<B>gnomAD Loss-of-Function Constraint (LOEUF) Color Key:</B><BR> "); hPrintf("<table style=\"border: 1px solid black\"><tr>\n"); - hPrintf("<td style=\"background-color:rgb(0,244,153)\">< 0.1</td>\n"); - hPrintf("<td style=\"background-color:rgb(74,240,94)\">< 0.2</td>\n"); - hPrintf("<td style=\"background-color:rgb(127,233,58)\">< 0.3</td>\n"); - hPrintf("<td style=\"background-color:rgb(165,224,26)\">< 0.4</td>\n"); - hPrintf("<td style=\"background-color:rgb(191,210,22)\">< 0.5</td>\n"); - hPrintf("<td style=\"background-color:rgb(210,191,13)\">< 0.6</td>\n"); - hPrintf("<td style=\"background-color:rgb(224,165,8)\">< 0.7</td>\n"); - hPrintf("<td style=\"background-color:rgb(233,127,5)\">< 0.8</td>\n"); - hPrintf("<td style=\"background-color:rgb(240,74,3)\">< 0.9</td>\n"); - hPrintf("<td style=\"background-color:rgb(244,0,2)\">< 1</td>\n"); - hPrintf("<td style=\"color: white; background-color:rgb(160,160,160)\">No pLI score</td>\n"); + hPrintf("<td style=\"background-color:rgb(244,0,2)\">< 0.1</td>\n"); + hPrintf("<td style=\"background-color:rgb(240,74,3)\">< 0.2</td>\n"); + hPrintf("<td style=\"background-color:rgb(233,127,5)\">< 0.3</td>\n"); + hPrintf("<td style=\"background-color:rgb(224,165,8)\">< 0.4</td>\n"); + hPrintf("<td style=\"background-color:rgb(210,191,13)\">< 0.5</td>\n"); + hPrintf("<td style=\"background-color:rgb(191,210,22)\">< 0.6</td>\n"); + hPrintf("<td style=\"background-color:rgb(165,224,26)\">< 0.7</td>\n"); + hPrintf("<td style=\"background-color:rgb(127,233,58)\">< 0.8</td>\n"); + hPrintf("<td style=\"background-color:rgb(74,240,94)\">< 0.9</td>\n"); + hPrintf("<td style=\"background-color:rgb(0,244,153)\">≥ 0.9</td>\n"); + hPrintf("<td style=\"color: white; background-color:rgb(160,160,160)\">No LOEUF score</td>\n"); hPrintf("</tr></table>\n"); } if (showTrackControls) { /* Display viewing options for each track. */ /* Chuck: This is going to be wrapped in a table so that * the controls don't wrap around randomly */ hPrintf("<table border=0 cellspacing=1 cellpadding=1 width=%d>\n", CONTROL_TABLE_WIDTH); hPrintf("<tr><td align='left'>\n"); hButtonWithOnClick("hgt.collapseGroups", "collapse all", "collapse all track groups", "return vis.expandAllGroups(false)"); hPrintf("</td>"); @@ -10555,63 +10560,67 @@ } extern boolean issueBotWarning; void doMiddle(struct cart *theCart) /* Print the body of an html file. */ { cart = theCart; measureTiming = hPrintStatus() && isNotEmpty(cartOptionalString(cart, "measureTiming")); if (measureTiming) measureTime("Startup (bottleneck %d ms) ", botDelayMillis); char *mouseOverEnabled = cfgOption("mouseOverEnabled"); if (sameWordOk(mouseOverEnabled, "on")) { + /* can not use mouseOver in any virtual mode */ + char *isMultiRegion = cartUsualString(cart, "virtModeType", "default"); + if (sameWordOk(isMultiRegion, "default")) + { enableMouseOver = TRUE; /* mouseOverJsonFile will be initializes and created at the same * time as the browser .png image file */ mouseOverJson = jsonWriteNew(); jsonWriteObjectStart(mouseOverJson, NULL); /* this jsonWrite structure will finish off upon successful exit. * each track will start a list with the track name: * jsonWriteListStart(mouseOverJson, tg->track); */ } + } else enableMouseOver = FALSE; if (issueBotWarning) { char *ip = getenv("REMOTE_ADDR"); botDelayMessage(ip, botDelayMillis); } char *debugTmp = NULL; /* Uncomment this to see parameters for debugging. */ /* struct dyString *state = NULL; */ /* Initialize layout and database. */ if (measureTiming) measureTime("Get cart of %d for user:%s session:%s", theCart->hash->elCount, theCart->userId, theCart->sessionId); /* #if 1 this to see parameters for debugging. */ /* Be careful though, it breaks if custom track * is more than 4k */ #if 0 -state = cgiUrlString(); -printf("State: %s\n", state->string); +printf("State: %s\n", cgiUrlString()->string); #endif getDbAndGenome(cart, &database, &organism, oldVars); genomeIsRna = !isHubTrack(database) && hgPdbOk(database); initGenbankTableNames(database); protDbName = hPdbFromGdb(database); debugTmp = cartUsualString(cart, "hgDebug", "off"); if(sameString(debugTmp, "on")) hgDebug = TRUE; else hgDebug = FALSE;