void palOptions(struct cart *cart, struct sqlConnection *conn, void (*addButtons)(), char *extraVar) /* output the options dialog (select MAF file, output options */ { char *database = sqlGetDatabase(conn); hPrintf("<FORM ACTION=\"%s\" NAME=\"mainForm\" METHOD=POST>\n", cgiScriptName()); cartSaveSession(cart); char *mafTable = outMafTableDrop(cart, conn); char *numColumns = cartUsualString(cart, hgtaCGINumColumns, ""); printf("<BR><BR><B>Formatting options:</B><BR>\n"); jsMakeTrackingCheckBox(cart, hgtaCGIGeneExons, hgtaJSGeneExons, FALSE); printf("Separate into exons<BR>"); jsMakeTrackingCheckBox(cart, hgtaCGIGeneNoTrans, hgtaJSGeneNoTrans, FALSE); printf("Show nucleotides<BR>"); jsMakeTrackingCheckBox(cart, hgtaCGIGeneOutBlank, hgtaJSGeneOutBlank, FALSE); printf("Output lines with just dashes<BR>"); jsMakeTrackingCheckBox(cart, hgtaCGIOutTable, hgtaJSOutTable, FALSE); printf("Format output as table "); jsMakeTrackingCheckBox(cart, hgtaCGITruncHeader, hgtaJSTruncHeader, FALSE); printf("Truncate headers at "); cgiMakeTextVar(hgtaCGINumColumns, numColumns, 2); printf("characters (enter zero for no headers)<BR>"); printf("<BR>"); struct trackDb *maftdb = hTrackDbForTrack(database, mafTable); /* get maf parent (if any) */ maftdb->parent = hCompositeTrackDbForSubtrack(database,maftdb); wigMafSpeciesTable(cart, maftdb, mafTable, database); addButtons(); cartSaveSession(cart); hPrintf("</FORM>\n"); /* Hidden form - for benefit of javascript. */ { static char *saveVars[32]; int varCount = ArraySize(curVars); assert(varCount < (sizeof saveVars / sizeof(char *))); memcpy(saveVars, curVars, varCount * sizeof(saveVars[0])); if (extraVar != NULL) { assert(varCount + 1 < (sizeof saveVars / sizeof(char *))); saveVars[varCount] = extraVar; varCount++; } jsCreateHiddenForm(cart, cgiScriptName(), saveVars, varCount); } }
void mainPageAfterOpen(struct sqlConnection *conn) /* Put up main page assuming htmlOpen()/htmlClose() * will happen in calling routine. */ { hPrintf( "Use this program to retrieve the data associated with a track in text " "format, to calculate intersections between tracks, and to retrieve " "DNA sequence covered by a track. For help in using this application " "see <A HREF=\"#Help\">Using the Table Browser</A> for a description " "of the controls in this form, the " "<A HREF=\"../goldenPath/help/hgTablesHelp.html\">User's Guide</A> for " "general information and sample queries, and the OpenHelix Table Browser " "<A HREF=\"http://www.openhelix.com/cgi/tutorialInfo.cgi?id=28\" " "TARGET=_blank>tutorial</A> for a narrated presentation of the software " "features and usage. " "For more complex queries, you may want to use " "<A HREF=\""GALAXY_URL_BASE"\" target=_BLANK>Galaxy</A> or " "our <A HREF=\"../goldenPath/help/mysql.html\">public " "MySQL server</A>. " "To examine the biological function of your set through annotation " "enrichments, send the data to " "<A HREF=\"http://great.stanford.edu\" target=_BLANK>GREAT</A>. " "%s" "Refer to the " "<A HREF=\"../goldenPath/credits.html\">Credits</A> page for the list of " "contributors and usage restrictions associated with these data. " "All tables can be downloaded in their entirety from the " "<A HREF=\"http://hgdownload.cse.ucsc.edu/downloads.html\"" ">Sequence and Annotation Downloads</A> page." , getGenomeSpaceText() ); hPrintf("<script type=\"text/javascript\">\n"); // When GREAT is selected, disable the other checkboxes and force output to BED hPrintf("function onSelectGreat() {\n"); hPrintf("document.getElementById('checkboxGalaxy').checked=false;\n"); if (isGenomeSpaceEnabled()) hPrintf("document.getElementById('checkboxGenomeSpace').checked=false;\n"); hPrintf("document.getElementById('outBed').selected=true;\n"); hPrintf("return true;\n"); hPrintf("}\n"); // Disable/enable noGenome tracks depending on whether region is genome. hPrintf("function maybeDisableNoGenome() {\n" " var regionTypeSelected = $('input[name=\"hgta_regionType\"]:checked').val();\n" " var regionIsGenome = (regionTypeSelected === 'genome');\n" " var $noGenomeOptions = $('select[name=\"hgta_track\"] option.hgtaNoGenome');\n" " $noGenomeOptions.attr('disabled', regionIsGenome)\n" " .css('color', regionIsGenome ? '' : 'black');\n" "}\n" "$(document).ready(function() {\n" // once when the page loads, and every time the user changes the region type: " maybeDisableNoGenome();\n" " $('input[name=\"hgta_regionType\"]').change(maybeDisableNoGenome);\n" "});\n" "</script>\n"); /* Main form. */ hPrintf("<FORM ACTION=\"%s\" NAME=\"mainForm\" METHOD=%s>\n", getScriptName(), cartUsualString(cart, "formMethod", "POST")); cartSaveSession(cart); jsInit(); showMainControlTable(conn); hPrintf("</FORM>\n"); /* Hidden form - for benefit of javascript. */ { static char *saveVars[] = { "clade", "org", "db", hgtaGroup, hgtaTrack, hgtaTable, hgtaRegionType, hgtaRange, hgtaOutputType, hgtaOutFileName}; jsCreateHiddenForm(cart, getScriptName(), saveVars, ArraySize(saveVars)); } /* Hidden form for jumping to custom tracks CGI. */ hPrintf("<FORM ACTION='%s' NAME='customTrackForm'>", hgCustomName()); cartSaveSession(cart); hPrintf("</FORM>\n"); /* Hidden form for jumping to track hub manager CGI. */ hPrintf("<FORM ACTION='%s' NAME='trackHubForm'>", hgHubConnectName()); cartSaveSession(cart); hPrintf("</FORM>\n"); webNewSection("<A NAME=\"Help\"></A>Using the Table Browser\n"); printMainHelp(); cartFlushHubWarnings(); }
void doIntersectMore(struct sqlConnection *conn) /* Continue working in intersect page. */ { struct trackDb *iTrack; char *name = curTableLabel(); char *iName, *iTable; char *onChange = onChangeEither(); char *op, *setting; boolean wigOptions = (isWiggle(database, curTable) || isBedGraph(curTable)); // Note - bigWig is purposely left out of wigOptions. It supports more intersection options // than wig does. struct hTableInfo *hti1 = maybeGetHti(database, curTable, conn), *hti2 = NULL; htmlOpen("Intersect with %s", name); hPrintf("<FORM ACTION=\"%s\" NAME=\"mainForm\" METHOD=GET>\n", getScriptName()); cartSaveSession(cart); hPrintf("<TABLE BORDER=0>\n"); /* Print group and track line. */ hPrintf("Select a group, track and table to intersect with:\n"); iTrack = showGroupTrackRow(hgtaNextIntersectGroup, onChange, hgtaNextIntersectTrack, onChange, conn); iName = iTrack->shortLabel; hPrintf("<TR><TD>\n"); iTable = showTableField(iTrack, hgtaNextIntersectTable, FALSE); hti2 = maybeGetHti(database, iTable, conn); hPrintf("</TD></TR>\n"); hPrintf("</TABLE>\n"); if (!wigOptions) { if (hti1 && hti1->hasBlocks) hPrintf("<BR>Note: %s has gene/alignment structure. " "Only the exons/blocks will be considered.\n", name); if (hti2 && hti2->hasBlocks) hPrintf("<BR>Note: %s has gene/alignment structure. " "Only the bases covered by its exons/blocks will be " "considered.\n", iName); hPrintf("<H4>Intersect %s items with bases covered by %s:</H4>\n", name, iName); hPrintf("These combinations will maintain the names and " "gene/alignment structure (if any) of %s: <P>\n", name); } else hPrintf("<P>\n"); op = cartUsualString(cart, hgtaNextIntersectOp, "any"); jsTrackingVar("op", op); makeOpButton("any", op); printf("All %s records that have any overlap with %s <BR>\n", name, iName); makeOpButton("none", op); printf("All %s records that have no overlap with %s <BR>\n", name, iName); if (!wigOptions) { makeOpButton("more", op); printf("All %s records that have at least ", name); setting = cartCgiUsualString(cart, hgtaNextMoreThreshold, "80"); cgiMakeTextVar(hgtaNextMoreThreshold, setting, 3); printf(" %% overlap with %s <BR>\n", iName); makeOpButton("less", op); printf("All %s records that have at most ", name); setting = cartCgiUsualString(cart, hgtaNextLessThreshold, "80"); cgiMakeTextVar(hgtaNextLessThreshold, setting, 3); printf(" %% overlap with %s <P>\n", iName); } else { /* keep javaScript onClick happy */ hPrintf("<input TYPE=HIDDEN NAME=\"hgta_nextMoreThreshold\" VALUE=80>\n"); hPrintf("<input TYPE=HIDDEN NAME=\"hgta_nextLessThreshold\" VALUE=80>\n"); hPrintf(" <P>\n"); } if (!wigOptions) { boolean bigWig = isBigWigTable(curTable); hPrintf("<H4>Intersect bases covered by %s and/or %s:</H4>\n", name, iName); if (!bigWig) hPrintf("These combinations will discard the names and " "gene/alignment structure (if any) of %s and produce a simple " "list of position ranges.<P>\n", name); makeOpButton("and", op); printf("Base-pair-wise intersection (AND) of %s and %s <BR>\n", name, iName); makeOpButton("or", op); printf("Base-pair-wise union (OR) of %s and %s <P>\n", name, iName); hPrintf("Check the following boxes to complement one or both tables. " "To complement a table means to include a base pair in the " "intersection/union if it is <I>not</I> included in the table." "<P>\n"); if (!bigWig) { jsMakeTrackingCheckBox(cart, hgtaNextInvertTable, "invertTable", FALSE); printf("Complement %s before base-pair-wise intersection/union <BR>\n", name); } jsMakeTrackingCheckBox(cart, hgtaNextInvertTable2, "invertTable2", FALSE); printf("Complement %s before base-pair-wise intersection/union <P>\n", iName); } else { /* keep javaScript onClick happy */ jsTrackingVar("op", op); hPrintf("<SCRIPT>\n"); hPrintf("var invertTable=0;\n"); hPrintf("var invertTable2=0;\n"); hPrintf("</SCRIPT>\n"); hPrintf("(data track %s is not composed of gene records. Specialized intersection operations are not available.)<P>\n", name); } cgiMakeButton(hgtaDoIntersectSubmit, "submit"); hPrintf(" "); cgiMakeButton(hgtaDoMainPage, "cancel"); hPrintf("</FORM>\n"); /* Hidden form - for benefit of javascript. */ { static char *saveVars[32]; int varCount = ArraySize(nextVars); memcpy(saveVars, nextVars, varCount * sizeof(saveVars[0])); saveVars[varCount] = hgtaDoIntersectMore; jsCreateHiddenForm(cart, getScriptName(), saveVars, varCount+1); } htmlClose(); }
void mainPageAfterOpen(struct sqlConnection *conn) /* Put up main page assuming htmlOpen()/htmlClose() * will happen in calling routine. */ { hPrintf("%s", "Use this program to retrieve the data associated with a track in text " "format, to calculate intersections between tracks, and to retrieve " "DNA sequence covered by a track. For help in using this application " "see <A HREF=\"#Help\">Using the Table Browser</A> for a description " "of the controls in this form, the " "<A HREF=\"../goldenPath/help/hgTablesHelp.html\">User's Guide</A> for " "general information and sample queries, and the OpenHelix Table Browser " "<A HREF=\"http://www.openhelix.com/cgi/tutorialInfo.cgi?id=28\" " "TARGET=_blank>tutorial</A> for a narrated presentation of the software " "features and usage. " "For more complex queries, you may want to use " "<A HREF=\""GALAXY_URL_BASE"\" target=_BLANK>Galaxy</A> or " "our <A HREF=\"../goldenPath/help/mysql.html\">public " "MySQL server</A>. " "To examine the biological function of your set through annotation " "enrichments, send the data to " "<A HREF=\"http://great.stanford.edu\">GREAT</A>. Refer to the " "<A HREF=\"../goldenPath/credits.html\">Credits</A> page for the list of " "contributors and usage restrictions associated with these data. " "All tables can be downloaded in their entirety from the " "<A HREF=\"http://hgdownload.cse.ucsc.edu/downloads.html\"" ">Sequence and Annotation Downloads</A> page." ); hPrintf("<script type=\"text/javascript\">\n"); hPrintf("function onSelectGreat() {\n"); hPrintf("document.getElementById('checkboxGalaxy').checked=false;\n"); hPrintf("document.getElementById('outBed').selected=true;\n"); hPrintf("return true;\n"); hPrintf("}\n"); hPrintf("</script>\n"); /* Main form. */ hPrintf("<FORM ACTION=\"%s\" NAME=\"mainForm\" METHOD=%s>\n", getScriptName(), cartUsualString(cart, "formMethod", "POST")); cartSaveSession(cart); jsWriteFunctions(); showMainControlTable(conn); hPrintf("</FORM>\n"); /* Hidden form - for benefit of javascript. */ { static char *saveVars[] = { "clade", "org", "db", hgtaGroup, hgtaTrack, hgtaTable, hgtaRegionType, hgtaRange, hgtaOutputType, hgtaOutFileName}; jsCreateHiddenForm(cart, getScriptName(), saveVars, ArraySize(saveVars)); } /* Hidden form for jumping to custom tracks CGI. */ hPrintf("<FORM ACTION='%s' NAME='customTrackForm'>", hgCustomName()); cartSaveSession(cart); hPrintf("</FORM>\n"); /* Hidden form for jumping to track hub manager CGI. */ hPrintf("<FORM ACTION='%s' NAME='trackHubForm'>", hgHubConnectName()); cgiMakeHiddenVar(hgHubConnectCgiDestUrl, "../cgi-bin/hgTables"); cartSaveSession(cart); hPrintf("</FORM>\n"); webNewSection("<A NAME=\"Help\"></A>Using the Table Browser\n"); printMainHelp(); }