void configPageSetTrackVis(int vis) /* Do config page after setting track visibility. If vis is -2, then visibility * is unchanged. If -1 then set visibility to default, otherwise it should * be tvHide, tvDense, etc. */ { char *groupTarget; struct track *trackList; struct track *ideoTrack; struct group *groupList; configInitTrackList(vis, &groupTarget, &trackList, &ideoTrack, &groupList); struct dyString *title = dyStringNew(0); dyStringPrintf(title, "Configure Image"); hPrintf("<FORM ACTION=\"%s\" NAME=\"mainForm\" METHOD=%s>\n", hgTracksName(), cartUsualString(cart, "formMethod", "POST")); webStartWrapperDetailedNoArgs(cart, database, "", title->string, FALSE, FALSE, FALSE, FALSE); cartSaveSession(cart); hPrintf("<INPUT TYPE=HIDDEN NAME=\"hgTracksConfigPage\" VALUE=\"\">"); /* do not want all the submit buttons named the same thing, this one is: */ cgiMakeButton("topSubmit", "submit"); // 3 column table hPrintf("<TABLE style=\"border:0px; \">\n"); hPrintf("<TR><TD>image width:"); hPrintf("<TD style=\"text-align: right\">"); hIntVar("pix", tl.picWidth, 4); hPrintf("<TD>pixels</TR>"); hPrintf("<TR><TD>label area width:"); hPrintf("<TD style=\"text-align: right\">"); hIntVar("hgt.labelWidth", leftLabelWidthChars, 2); hPrintf("<TD>characters<TD></TR>"); hPrintf("<TR><TD>text size:"); hPrintf("<TD style=\"text-align: right\">"); textSizeDropDown(); hPrintf("</TD>"); if (trackLayoutInclFontExtras()) { hPrintf("<TD>"); char *defaultStyle = cartUsualString(cart, "fontType", "medium"); cartMakeRadioButton(cart, "fontType", "medium", defaultStyle); hPrintf(" medium "); cartMakeRadioButton(cart, "fontType", "fixed", defaultStyle); hPrintf(" fixed "); cartMakeRadioButton(cart, "fontType", "bold", defaultStyle); hPrintf(" bold "); hPrintf(" "); hPrintf("</TD>"); } hPrintf("</TR>"); themeDropDown(cart); hTableStart(); if (ideoTrack != NULL) { hPrintf("<TR><TD>"); hCheckBox("ideogram", cartUsualBoolean(cart, "ideogram", TRUE)); hPrintf("</TD><TD>"); hPrintf("Display chromosome ideogram above main graphic"); hPrintf("</TD></TR>\n"); } hPrintf("<TR><TD>"); hCheckBox("guidelines", cartUsualBoolean(cart, "guidelines", TRUE)); hPrintf("</TD><TD>"); hPrintf("Show light blue vertical guidelines, or light red vertical window separators in multi-region view"); hPrintf("</TD></TR>\n"); hPrintf("<TR><TD>"); hCheckBox("leftLabels", cartUsualBoolean(cart, "leftLabels", TRUE)); hPrintf("</TD><TD>"); hPrintf("Display labels to the left of items in tracks"); hPrintf("</TD></TR>\n"); hPrintf("<TR><TD>"); hCheckBox("centerLabels", cartUsualBoolean(cart, "centerLabels", TRUE)); hPrintf("</TD><TD>"); hPrintf("Display description above each track"); hPrintf("</TD></TR>\n"); hPrintf("<TR><TD>"); hCheckBox("trackControlsOnMain", cartUsualBoolean(cart, "trackControlsOnMain", TRUE)); hPrintf("</TD><TD>"); hPrintf("Show track controls under main graphic"); hPrintf("</TD></TR>\n"); hPrintf("<TR><TD>"); hCheckBox("nextItemArrows", cartUsualBoolean(cart, "nextItemArrows", FALSE)); hPrintf("</TD><TD>"); hPrintf("Next/previous item navigation"); hPrintf("</TD></TR>\n"); hPrintf("<TR><TD>"); hCheckBox("nextExonArrows", cartUsualBoolean(cart, "nextExonArrows", TRUE)); hPrintf("</TD><TD>"); hPrintf("Next/previous exon navigation"); hPrintf("</TD></TR>\n"); hPrintf("<TR><TD>"); hCheckBox("exonNumbers", cartUsualBoolean(cart, "exonNumbers", TRUE)); hPrintf("</TD><TD>"); hPrintf("Show exon numbers"); hPrintf("</TD></TR>\n"); hPrintf("<TR><TD>"); hCheckBox("enableHighlightingDialog", cartUsualBoolean(cart, "enableHighlightingDialog", TRUE)); hPrintf("</TD><TD>"); hPrintf("Enable highlight with drag-and-select " "(if unchecked, drag-and-select always zooms to selection)"); hPrintf("</TD></TR>\n"); hTableEnd(); cgiDown(0.9); char buf[256]; char *freeze = hFreezeFromDb(database); if (freeze == NULL) safef(buf, sizeof buf, "Configure Tracks on %s %s: %s", organization, browserName, trackHubSkipHubName(organism)); else if (stringIn(database, freeze)) safef(buf, sizeof buf, "Configure Tracks on %s %s: %s %s", organization, browserName, trackHubSkipHubName(organism), freeze); else safef(buf, sizeof buf, "Configure Tracks on %s %s: %s %s (%s)", organization, browserName, trackHubSkipHubName(organism), freeze, trackHubSkipHubName(database)); webNewSection("%s",buf); hPrintf("Tracks: "); if (isSearchTracksSupported(database,cart)) { cgiMakeButtonWithMsg(TRACK_SEARCH, TRACK_SEARCH_BUTTON,TRACK_SEARCH_HINT); hPrintf(" "); } cgiMakeButtonWithMsg(configHideAll, "hide all","Hide all tracks in this genome assembly"); hPrintf(" "); cgiMakeButtonWithMsg(configShowAll, "show all","Show all tracks in this genome assembly"); hPrintf(" "); cgiMakeButtonWithMsg(configDefaultAll, "default","Display only default tracks"); hPrintf(" Groups: "); hButtonWithOnClick("hgt.collapseGroups", "collapse all", "Collapse all track groups", "return vis.expandAllGroups(false)"); hPrintf(" "); hButtonWithOnClick("hgt.expandGroups", "expand all", "Expand all track groups", "return vis.expandAllGroups(true)"); hPrintf("<div style='margin-top:.2em; margin-bottom:.9em;'>Control track and group visibility " "more selectively below.</div>"); trackConfig(trackList, groupList, groupTarget, vis); dyStringFree(&title); freez(&groupTarget); webEndSectionTables(); hPrintf("</FORM>"); }
void configMultiRegionPage() /* Do multi-region config page after setting track visibility. If vis is -2, then visibility * is unchanged. If -1 then set visibility to default, otherwise it should * be tvHide, tvDense, etc. */ { char *groupTarget; struct track *trackList; struct track *ideoTrack; struct group *groupList; int vis = -2; configInitTrackList(vis, &groupTarget, &trackList, &ideoTrack, &groupList); hPrintf("<FORM ACTION=\"%s\" NAME=\"mainForm\" METHOD=%s>\n", hgTracksName(), cartUsualString(cart, "formMethod", "POST")); webStartWrapperDetailedNoArgs(cart, database, "", "", FALSE, FALSE, FALSE, FALSE); cartSaveSession(cart); hPrintf("<BR>\n"); hTableStart(); virtModeType = cartUsualString(cart, "virtModeType", virtModeType); hPrintf("<TR><TD>"); cgiMakeRadioButton("virtModeType", "default", sameWord("default", virtModeType)); hPrintf("</TD><TD>"); hPrintf("Exit multi-region mode"); hPrintf("</TD></TR>\n"); struct sqlConnection *conn = NULL; if (!trackHubDatabase(database)) // no db conn for assembly hubs conn = hAllocConn(database); // Do we have a gene table for exonMostly? findBestEMGeneTable(trackList); if (emGeneTable) { hPrintf("<TR><TD>"); cgiMakeRadioButton("virtModeType", "exonMostly", sameWord("exonMostly", virtModeType)); hPrintf("</TD><TD>"); hPrintf("Show exons using %s. Use padding of: ", emGeneTrack->shortLabel); hIntVar("emPadding", cartUsualInt(cart, "emPadding", emPadding), 3); hPrintf(" bases."); hPrintf("</TD></TR>\n"); } if (emGeneTable) { hPrintf("<TR><TD>"); cgiMakeRadioButton("virtModeType", "geneMostly", sameWord("geneMostly", virtModeType)); hPrintf("</TD><TD>"); hPrintf("Show genes using %s. Use padding of: ", emGeneTrack->shortLabel); hIntVar("gmPadding", cartUsualInt(cart, "gmPadding", gmPadding), 3); hPrintf(" bases."); hPrintf("</TD></TR>\n"); } /* obsolete if (conn && sqlTableExists(conn,"knownCanonical")) { hPrintf("<TR><TD>"); cgiMakeRadioButton("virtModeType", "kcGenes", sameWord("kcGenes", virtModeType)); hPrintf("</TD><TD>"); hPrintf("Show gene regions genome-wide."); hPrintf("</TD></TR>\n"); } */ hPrintf("<TR><TD>"); cgiMakeRadioButton("virtModeType", "customUrl", sameWord("customUrl", virtModeType)); hPrintf("</TD><TD>"); hPrintf("Enter Custom regions as BED, or a URL to them:<br>"); multiRegionsBedUrl = cartUsualString(cart, "multiRegionsBedUrl", multiRegionsBedUrl); struct dyString *dyMultiRegionsBedInput = dyStringNew(256); if (strstr(multiRegionsBedUrl,"://")) { dyStringAppend(dyMultiRegionsBedInput, multiRegionsBedUrl); } else { if (fileExists(multiRegionsBedUrl)) { struct lineFile *lf = lineFileMayOpen(multiRegionsBedUrl, TRUE); char *line; int lineSize; while (lineFileNext(lf, &line, &lineSize)) { dyStringPrintf(dyMultiRegionsBedInput, "%s\n", line); } lineFileClose(&lf); } } hPrintf("<TEXTAREA NAME='multiRegionsBedInput' ID='multiRegionsBedInput' rows='4' cols='58' style='white-space: pre;'>%s</TEXTAREA>", dyMultiRegionsBedInput->string); hPrintf("</TD></TR>\n"); /* The AllChroms option will be released in future if (emGeneTable && sqlTableExists(conn, emGeneTable)) { hPrintf("<TR><TD>"); cgiMakeRadioButton("virtModeType", "singleTrans", sameWord("singleTrans", virtModeType)); hPrintf("</TD><TD>"); hPrintf("Show only one transcript using an ID from %s : ", emGeneTrack->shortLabel); char *trans = cartUsualString(cart, "singleTransId", singleTransId); char sql[1024]; sqlSafef(sql, sizeof sql, "select name from %s where name='%s'", emGeneTable, trans); char *result = sqlQuickString(conn, sql); if (!result) { sqlSafef(sql, sizeof sql, "select name from %s limit 1", emGeneTable); trans = sqlQuickString(conn, sql); } hTextVar("singleTransId", trans, 20); hPrintf("</TD></TR>\n"); } */ if (conn) { boolean altLocExists = sqlTableExists(conn, "altLocations"); boolean fixLocExists = sqlTableExists(conn, "fixLocations"); if (altLocExists || fixLocExists) { hPrintf("<TR><TD>"); cgiMakeRadioButton("virtModeType", "singleAltHaplo", sameWord("singleAltHaplo", virtModeType)); hPrintf("</TD><TD>"); hPrintf("Show one alternate haplotype"); if (fixLocExists) hPrintf(" or fix patch"); hPrintf(", placed on its chromosome, using ID: "); char *haplo = cartUsualString(cart, "singleAltHaploId", singleAltHaploId); char *foundHaplo = NULL; char sql[1024]; if (altLocExists) { sqlSafef(sql, sizeof sql, "select name from altLocations where name rlike '^%s(:[0-9-]+)?'", haplo); foundHaplo = sqlQuickString(conn, sql); } if (!foundHaplo && fixLocExists) { sqlSafef(sql, sizeof sql, "select name from fixLocations where name rlike '^%s(:[0-9-]+)?'", haplo); foundHaplo = sqlQuickString(conn, sql); } if (!foundHaplo) { if (altLocExists) sqlSafef(sql, sizeof sql, "select name from altLocations limit 1"); else sqlSafef(sql, sizeof sql, "select name from fixLocations limit 1"); haplo = sqlQuickString(conn, sql); chopSuffixAt(haplo, ':'); } hTextVar("singleAltHaploId", haplo, 60); hPrintf("</TD></TR>\n"); } } /* disable demo for now if (sameString(database,"hg19") || sameString(database, "hg38")) { hPrintf("<TR><TD>"); cgiMakeRadioButton("virtModeType", "demo1", sameWord("demo1", virtModeType)); hPrintf("</TD><TD>"); hPrintf("demo1 two windows on two chroms (default pos on chr21, and same loc on chr22)"); hPrintf("</TD></TR>\n"); } */ /* Disabled for now hPrintf("<TR><TD>"); cgiMakeRadioButton("virtModeType", "demo2", sameWord("demo2", virtModeType)); hPrintf("</TD><TD>"); hPrintf("demo2 multiple "); hIntVar("demo2NumWindows", cartUsualInt(cart, "demo2NumWindows", demo2NumWindows), 3); hPrintf(" windows on one chrom chr21 def posn, window size "); hIntVar("demo2WindowSize", cartUsualInt(cart, "demo2WindowSize", demo2WindowSize), 3); hPrintf(" and step size "); hIntVar("demo2StepSize", cartUsualInt(cart, "demo2StepSize", demo2StepSize), 3); hPrintf(" exon-like"); hPrintf("</TD></TR>\n"); */ /* The AllChroms option will be released in future if (conn) // requires chromInfo from database. { // TODO allow it to use assembly hubs via trackHubAllChromInfo() ? hPrintf("<TR><TD>"); cgiMakeRadioButton("virtModeType", "allChroms", sameWord("allChroms", virtModeType)); hPrintf("</TD><TD>"); hPrintf("<br>Show all chromosomes.<br><span style='color:red'>Warning:</span> Turn off all tracks except bigBed, bigWig, and very sparse tracks.<br>Press Hide All to hide all tracks."); hPrintf("</TD></TR>\n"); } */ /* Disabled for now hPrintf("<TR><TD>"); cgiMakeRadioButton("virtModeType", "demo4", sameWord("demo4", virtModeType)); hPrintf("</TD><TD>"); hPrintf("demo4 multiple (311) windows showing exons from TITIN gene uc031rqd.1."); hPrintf("</TD></TR>\n"); */ /* Disabled for now hPrintf("<TR><TD>"); cgiMakeRadioButton("virtModeType", "demo5", sameWord("demo5", virtModeType)); hPrintf("</TD><TD>"); hPrintf("demo5 alt locus on hg38. Shows alt chrom surrounded by regions of same size from reference genome."); hPrintf("</TD></TR>\n"); */ /* Disabled for now hPrintf("<TR><TD>"); cgiMakeRadioButton("virtModeType", "demo6", sameWord("demo6", virtModeType)); hPrintf("</TD><TD>"); hPrintf("demo6 shows zoomed in exon-exon junction from SOD1 gene, between exon1 and exon2."); hPrintf("</TD></TR>\n"); */ hTableEnd(); hPrintf("<BR>\n"); hPrintf("<TABLE style=\"border:0px; \">\n"); hPrintf("<TR><TD>"); hCheckBox("emAltHighlight", cartUsualBoolean(cart, "emAltHighlight", FALSE)); hPrintf("</TD><TD>"); hPrintf("Highlight alternating regions in multi-region view"); hPrintf("</TD></TR>\n"); hPrintf("</TABLE>\n"); hPrintf("<BR>\n"); hPrintf("<TABLE style=\"border:0px;width:650px \">\n"); hPrintf("<TR><TD>"); cgiMakeButton("topSubmit", "submit"); hPrintf("</TD><TD align=right>"); hPrintf("<A HREF=\"../goldenPath/help/multiRegionHelp.html\" target=_blank>Help</A>\n"); hPrintf("</TD></TR>\n"); hPrintf("</TABLE>\n"); hFreeConn(&conn); cgiDown(0.9); freez(&groupTarget); webEndSectionTables(); hPrintf("</FORM>"); }
void configPageSetTrackVis(int vis) /* Do config page after setting track visibility. If vis is -2, then visibility * is unchanged. If -1 then set visibility to default, otherwise it should * be tvHide, tvDense, etc. */ { struct dyString *title = dyStringNew(0); char *groupTarget = NULL; struct track *trackList = NULL; struct track *ideoTrack = NULL; struct group *groupList = NULL; withPriorityOverride = cartUsualBoolean(cart, configPriorityOverride, FALSE); /* Get track list and group them. */ ctList = customTracksParseCart(database, cart, &browserLines, &ctFileName); trackList = getTrackList(&groupList, vis); /* The ideogram for some reason is considered a track. * We don't really want to process it as one though, so * we see if it's there, and if necessary remove it. */ ideoTrack = chromIdeoTrack(trackList); if (ideoTrack != NULL) removeTrackFromGroup(ideoTrack); /* Fetch group to change on if any from CGI, * and remove var so it doesn't get used again. */ groupTarget = cloneString(cartUsualString(cart, configGroupTarget, "")); cartRemove(cart, configGroupTarget); if (sameString(groupTarget, "none")) freez(&groupTarget); dyStringPrintf(title, "Configure Image"); hPrintf("<FORM ACTION=\"%s\" NAME=\"mainForm\" METHOD=%s>\n", hgTracksName(), cartUsualString(cart, "formMethod", "POST")); webStartWrapperDetailedNoArgs(cart, database, "", title->string, FALSE, FALSE, FALSE, FALSE); cartSaveSession(cart); hPrintf("<INPUT TYPE=HIDDEN NAME=\"hgTracksConfigPage\" VALUE=\"\">"); /* do not want all the submit buttons named the same thing, this one is: */ cgiMakeButton("topSubmit", "submit"); // 3 column table hPrintf("<TABLE style=\"border:0px; \">\n"); hPrintf("<TR><TD>image width:"); hPrintf("<TD style=\"text-align: right\">"); hIntVar("pix", tl.picWidth, 4); hPrintf("<TD>pixels</TR>"); hPrintf("<TR><TD>label area width:"); hPrintf("<TD style=\"text-align: right\">"); hIntVar("hgt.labelWidth", leftLabelWidthChars, 2); hPrintf("<TD>characters<TD></TR>"); hPrintf("<TR><TD>text size:"); hPrintf("<TD style=\"text-align: right\">"); textSizeDropDown(); hPrintf("<TD>"); if (trackLayoutInclFontExtras()) { char *defaultStyle = cartUsualString(cart, "fontType", "medium"); cartMakeRadioButton(cart, "fontType", "medium", defaultStyle); hPrintf(" medium "); cartMakeRadioButton(cart, "fontType", "fixed", defaultStyle); hPrintf(" fixed "); cartMakeRadioButton(cart, "fontType", "bold", defaultStyle); hPrintf(" bold "); hPrintf(" "); } hPrintf("<TR><BR>"); hTableStart(); if (ideoTrack != NULL) { hPrintf("<TR><TD>"); hCheckBox("ideogram", cartUsualBoolean(cart, "ideogram", TRUE)); hPrintf("</TD><TD>"); hPrintf("Display chromosome ideogram above main graphic"); hPrintf("</TD></TR>\n"); } hPrintf("<TR><TD>"); hCheckBox("guidelines", cartUsualBoolean(cart, "guidelines", TRUE)); hPrintf("</TD><TD>"); hPrintf("Show light blue vertical guidelines"); hPrintf("</TD></TR>\n"); hPrintf("<TR><TD>"); hCheckBox("leftLabels", cartUsualBoolean(cart, "leftLabels", TRUE)); hPrintf("</TD><TD>"); hPrintf("Display labels to the left of items in tracks"); hPrintf("</TD></TR>\n"); hPrintf("<TR><TD>"); hCheckBox("centerLabels", cartUsualBoolean(cart, "centerLabels", TRUE)); hPrintf("</TD><TD>"); hPrintf("Display description above each track"); hPrintf("</TD></TR>\n"); hPrintf("<TR><TD>"); hCheckBox("trackControlsOnMain", cartUsualBoolean(cart, "trackControlsOnMain", TRUE)); hPrintf("</TD><TD>"); hPrintf("Show track controls under main graphic"); hPrintf("</TD></TR>\n"); hPrintf("<TR><TD>"); hCheckBox("nextItemArrows", cartUsualBoolean(cart, "nextItemArrows", FALSE)); hPrintf("</TD><TD>"); hPrintf("Next/previous item navigation"); hPrintf("</TD></TR>\n"); hPrintf("<TR><TD>"); hCheckBox("nextExonArrows", cartUsualBoolean(cart, "nextExonArrows", TRUE)); hPrintf("</TD><TD>"); hPrintf("Next/previous exon navigation"); hPrintf("</TD></TR>\n"); #ifdef PRIORITY_CHANGES_IN_CONFIG_UI hPrintf("<TR><TD>"); char *javascript="onClick=\"document.mainForm.hgTracksConfigPage.value='configure';document.mainForm.submit();\""; hCheckBoxJS(configPriorityOverride, cartUsualBoolean(cart, configPriorityOverride , FALSE), javascript); hPrintf("</TD><TD>"); hPrintf("Enable track re-ordering"); hPrintf("</TD></TR>\n"); #endif///def PRIORITY_CHANGES_IN_CONFIG_UI hPrintf("<TR><TD>"); hCheckBox("enableAdvancedJavascript", advancedJavascriptFeaturesEnabled(cart)); hPrintf("</TD><TD>"); hPrintf("Enable advanced javascript features"); hPrintf("</TD></TR>\n"); hTableEnd(); char *freeze = hFreezeFromDb(database); char buf[128]; if (stringIn(database, freeze)) safef(buf, sizeof buf, "Configure Tracks on %s %s: %s %s", organization, browserName, organism, freeze); else safef(buf, sizeof buf, "Configure Tracks on %s %s: %s %s (%s)", organization, browserName, organism, freeze, database); webNewSection(buf); hPrintf("Tracks: "); if(isSearchTracksSupported(database,cart)) { cgiMakeButtonWithMsg(TRACK_SEARCH, TRACK_SEARCH_BUTTON,TRACK_SEARCH_HINT); hPrintf(" "); } cgiMakeButtonWithMsg(configHideAll, "hide all","Hide all tracks in this genome assembly"); hPrintf(" "); cgiMakeButtonWithMsg(configShowAll, "show all","Show all tracks in this genome assembly"); hPrintf(" "); cgiMakeButtonWithMsg(configDefaultAll, "default","Display only default tracks"); hPrintf(" Groups: "); hButtonWithOnClick("hgt.collapseGroups", "collapse all", "Collapse all track groups", "return setAllTrackGroupVisibility(false)"); hPrintf(" "); hButtonWithOnClick("hgt.expandGroups", "expand all", "Expand all track groups", "return setAllTrackGroupVisibility(true)"); hPrintf("<P STYLE=\"margin-top:5;\">Control track and group visibility more selectively below.<P>"); trackConfig(trackList, groupList, groupTarget, vis); dyStringFree(&title); freez(&groupTarget); webEndSectionTables(); hPrintf("</FORM>"); }