static void showOutDropDown(struct outputType *otList, struct outputType *otDefault) /* Display output drop-down. */ { struct outputType *ot; char *outputType = cartUsualString(cart, hgtaOutputType, otList->name); if (otDefault != NULL && otDefault != otList) { boolean otInOtList = FALSE; for (ot = otList; ot != NULL; ot = ot->next) if (sameString(ot->name, outputType)) { otInOtList = TRUE; break; } if (! otInOtList) outputType = otDefault->name; } hPrintf("<SELECT NAME=\"%s\">", hgtaOutputType); for (ot = otList; ot != NULL; ot = ot->next) { hPrintf(" <OPTION VALUE=%s", ot->name); if (sameString(ot->name, outputType)) hPrintf(" SELECTED"); if (sameString(ot->name, outBed) || sameString(ot->name, outWigBed)) hPrintf(" id=\"outBed\""); hPrintf(">%s\n", ot->label); } hPrintf("</SELECT>\n"); hPrintf(" "); hPrintf(" Send output to "); cgiMakeCheckBoxIdAndJS("sendToGalaxy", doGalaxy(), "checkboxGalaxy", "onclick=\"document.getElementById('checkboxGreat').checked=false; return true;\""); hPrintf("<A HREF=\""GALAXY_URL_BASE"\" target=_BLANK>Galaxy</A>\n"); nbSpaces(2); cgiMakeCheckBoxIdAndJS("sendToGreat", doGreat(), "checkboxGreat", "onclick=\"return onSelectGreat();\""); hPrintf(" <A HREF=\"http://great.stanford.edu\" target=_BLANK>GREAT</A>"); hPrintf("</TD></TR>\n"); }
void doBedOrCtOptions(char *table, struct sqlConnection *conn, boolean doCt) /* Put up form to get options on BED or custom track output. */ /* (Taken from hgText.c/doBedCtOptions) */ { char *table2 = NULL; /* For now... */ struct hTableInfo *hti = getHti(database, table, conn); char buf[256]; char *setting; htmlOpen("Output %s as %s", table, (doCt ? "Custom Track" : "BED")); if (doGalaxy()) startGalaxyForm(); else if (doGreat()) { verifyGreatAssemblies(); startGreatForm(); } else hPrintf("<FORM ACTION=\"%s\" METHOD=GET>\n", getScriptName()); cartSaveSession(cart); if (!doGreat()) { hPrintf("%s\n", "<TABLE><TR><TD>"); if (doCt) { hPrintf("%s\n", "</TD><TD>" "<A HREF=\"../goldenPath/help/customTrack.html\" TARGET=_blank>" "Custom track</A> header: </B>"); } else { cgiMakeCheckBox(hgtaPrintCustomTrackHeaders, cartCgiUsualBoolean(cart, hgtaPrintCustomTrackHeaders, FALSE)); hPrintf("%s\n", "</TD><TD> <B> Include " "<A HREF=\"../goldenPath/help/customTrack.html\" TARGET=_blank>" "custom track</A> header: </B>"); } hPrintf("%s\n", "</TD></TR><TR><TD></TD><TD>name="); safef(buf, sizeof(buf), "tb_%s", hti->rootName); setting = cgiUsualString(hgtaCtName, buf); cgiMakeTextVar(hgtaCtName, setting, 16); hPrintf("%s\n", "</TD></TR><TR><TD></TD><TD>description="); safef(buf, sizeof(buf), "table browser query on %s%s%s", table, (table2 ? ", " : ""), (table2 ? table2 : "")); setting = cgiUsualString(hgtaCtDesc, buf); cgiMakeTextVar(hgtaCtDesc, setting, 50); hPrintf("%s\n", "</TD></TR><TR><TD></TD><TD>visibility="); if (isWiggle(database, table) || isBigWigTable(table)) { setting = cartCgiUsualString(cart, hgtaCtVis, ctVisWigMenu[2]); cgiMakeDropList(hgtaCtVis, ctVisWigMenu, ctVisWigMenuSize, setting); } else { setting = cartCgiUsualString(cart, hgtaCtVis, ctVisMenu[3]); cgiMakeDropList(hgtaCtVis, ctVisMenu, ctVisMenuSize, setting); } hPrintf("%s\n", "</TD></TR><TR><TD></TD><TD>url="); setting = cartCgiUsualString(cart, hgtaCtUrl, ""); cgiMakeTextVar(hgtaCtUrl, setting, 50); hPrintf("%s\n", "</TD></TR><TR><TD></TD><TD>"); hPrintf("%s\n", "</TD></TR></TABLE>"); } if (isWiggle(database, table) || isBedGraph(table) || isBigWigTable(table) ) { char *setting = NULL; hPrintf("<P> <B> Select type of data output: </B> <BR>\n"); setting = cartCgiUsualString(cart, hgtaCtWigOutType, outWigData); cgiMakeRadioButton(hgtaCtWigOutType, outWigBed, sameString(setting, outWigBed)); hPrintf("BED format (no data value information, only position)<BR>\n"); cgiMakeRadioButton(hgtaCtWigOutType, outWigData, sameString(setting, outWigData)); hPrintf("DATA VALUE format (position and real valued data)</P>\n"); } else { cgiDown(0.9); hPrintf("<B> Create one BED record per: </B>\n"); if ((anyIntersection() && intersectionIsBpWise()) || (anySubtrackMerge(database, table) && subtrackMergeIsBpWise())) { /* The original table may have blocks/CDS, described in hti, but * that info will be lost after base pair-wise operations. So make * a temporary copy of hti with its flags tweaked: */ struct hTableInfo simplifiedHti; memcpy(&simplifiedHti, hti, sizeof(simplifiedHti)); simplifiedHti.hasBlocks = FALSE; simplifiedHti.hasCDS = FALSE; fbOptionsHtiCart(&simplifiedHti, cart); } else fbOptionsHtiCart(hti, cart); } if (doCt) { if (doGalaxy()) { /* send the action parameter with the form as well */ cgiMakeHiddenVar(hgtaDoGetCustomTrackFile, "get custom track in file"); printGalaxySubmitButtons(); } else { cgiMakeButton(hgtaDoGetCustomTrackTb, "get custom track in table browser"); hPrintf(" "); cgiMakeButton(hgtaDoGetCustomTrackFile, "get custom track in file"); hPrintf("<BR>\n"); cgiMakeButton(hgtaDoGetCustomTrackGb, "get custom track in genome browser"); } } else { if (doGalaxy()) { cgiMakeHiddenVar(hgtaDoGetBed, "get BED"); printGalaxySubmitButtons(); } else if (doGreat()) { cgiMakeHiddenVar(hgtaDoGetBed, "get BED"); printGreatSubmitButtons(); } else cgiMakeButton(hgtaDoGetBed, "get BED"); } if (!doGalaxy() && !doGreat()) { hPrintf(" "); cgiMakeButton(hgtaDoMainPage, "cancel"); hPrintf("</FORM>\n"); } cgiDown(0.9); htmlClose(); }