8ae222adb54c0234afbe72e49a50da755c272352
kate
Wed Mar 17 17:30:41 2021 -0700
1. Add checkbox to multi-region config custom regions panel that causes display to show all regions. This is under same hg.conf control as multi-region button move 2. Change multiRegionBedUrl track setting to match existing cart var (multiRegionsBedUrl). Tweak help text on MR config panel, as per QA input. refs #26385
diff --git src/hg/hgTracks/hgTracks.c src/hg/hgTracks/hgTracks.c
index efdb52f..4cb4ebd 100644
--- src/hg/hgTracks/hgTracks.c
+++ src/hg/hgTracks/hgTracks.c
@@ -7979,64 +7979,60 @@
// get track-related vars from current cart
struct dyString *dsCgiVars = newDyString(0);
cartEncodeState(cart, dsCgiVars);
outDefaultTracks(cart, dsCgiVars);
char *this = dyStringCannibalize(&dsCgiVars);
// TODO: again, better parsing
char *this2 = replaceChars(this, "%2D", "-");
char *thisSessVars = replaceChars(this2, "%2B", "+");
char *thisSessVisTracks = cgiTrackVisString(thisSessVars);
//freeMem(curSessCart);
boolean isSessChanged = FALSE;
if (differentString(curSessVisTracks, thisSessVisTracks))
{
isSessChanged = TRUE;
- #ifdef DEBUG
- uglyf("
curSess vis tracks: %s", curSessVisTracks);
- uglyf("
thsSess vis tracks: %s", thisSessVisTracks);
- #endif
}
return isSessChanged;
}
static void printMultiRegionButton()
/* Print button that launches multi-region configuration pop-up */
{
boolean isPressed = FALSE;
if (differentString(virtModeType, "default"))
isPressed = TRUE;
char buf[256];
safef(buf, sizeof buf, "configure %s multi-region display mode",
isPressed ? "or exit" : "");
hButtonNoSubmitMaybePressed("hgTracksConfigMultiRegionPage", "multi-region", buf,
"popUpHgt.hgTracks('multi-region config'); return false;", isPressed);
}
void doTrackForm(char *psOutput, struct tempName *ideoTn)
/* Make the tracks display form with the zoom/scroll buttons and the active
* image. If the ideoTn parameter is not NULL, it is filled in if the
* ideogram is created. */
{
struct group *group;
struct track *track;
char *freezeName = NULL;
boolean hideAll = cgiVarExists("hgt.hideAll");
boolean defaultTracks = cgiVarExists("hgt.reset");
boolean showedRuler = FALSE;
boolean showTrackControls = cartUsualBoolean(cart, "trackControlsOnMain", TRUE);
-boolean multiRegionButtonTop = (cfgOption("multiRegionButtonTop") != NULL);
+boolean multiRegionButtonTop = cfgOptionBooleanDefault(MULTI_REGION_CFG_BUTTON_TOP, FALSE);
long thisTime = 0, lastTime = 0;
basesPerPixel = ((float)virtWinBaseCount) / ((float)fullInsideWidth);
zoomedToBaseLevel = (virtWinBaseCount <= fullInsideWidth / tl.mWidth);
zoomedToCodonLevel = (ceil(virtWinBaseCount/3) * tl.mWidth) <= fullInsideWidth;
zoomedToCodonNumberLevel = (ceil(virtWinBaseCount/3) * tl.mWidth * 5) <= fullInsideWidth;
zoomedToCdsColorLevel = (virtWinBaseCount <= fullInsideWidth*3);
if (psOutput != NULL)
{
hPrintDisable();
hideControls = TRUE;
withNextItemArrows = FALSE;
withNextExonArrows = FALSE;
hgFindMatches = NULL;
@@ -9736,49 +9732,48 @@
}
else
{
if (positionIsVirt)
errAbort("positionIsVirt=%d but virtMode=%d", positionIsVirt, virtMode);
}
}
else
{
if (sameString(virtModeType,"default")) // we are leaving virtMode
{
virtMode = FALSE;
- cartRemove(cart, "virtWinFull");
cartRemove(cart, "virtShortDesc");
}
else
{
// ENTERING VIRTMODE
// First time initialization
findNearest = TRUE;
// For now, do this manually here:
// sets window to full genome size, which for these demos should be small except for allChroms
if (sameString(virtModeType, "exonMostly") ||
sameString(virtModeType, "geneMostly") ||
sameString(virtModeType, "kcGenes") ||
(sameString(virtModeType, "customUrl") &&
- !cartUsualBoolean(cart, "virtWinFull", FALSE)))
+ !cartUsualBoolean(cart, MULTI_REGION_BED_WIN_FULL, FALSE)))
{
// trying to find best vchrom location corresponding to chromName, winStart, winEnd);
// try to find the nearest match
if (!(chromName && findNearestVirtMatch(chromName, winStart, winEnd, findNearest, &virtWinStart, &virtWinEnd)))
{ // create 10k window near middle of vchrom
warn("Your new regions are not near previous location. Using middle of new coordinates.");
virtWinStart = virtSeqBaseCount / 2;
virtWinEnd = virtWinStart + 10000;
if (virtWinEnd > virtSeqBaseCount)
virtWinEnd = virtSeqBaseCount;
}
virtMode = TRUE;
}
else if (sameString(virtModeType, "singleAltHaplo"))
{