void genomicFormatPage(struct sqlConnection *conn) /* Put up page asking for what sort of genomic sequence. */ { struct hTableInfo *hti = getHti(database, curTable, conn); htmlOpen("%s Genomic Sequence", curTableLabel()); if (doGalaxy()) startGalaxyForm(); else hPrintf("<FORM ACTION=\"%s\" METHOD=GET>\n", getScriptName()); cartSaveSession(cart); hgSeqOptionsHtiCart(hti, cart); hPrintf("<BR>\n"); if (doGalaxy()) { /* pass parameter to get sequence to Galaxy */ cgiMakeHiddenVar(hgtaDoGenomicDna, "get sequence"); printGalaxySubmitButtons(); } else { cgiMakeButton(hgtaDoGenomicDna, "get sequence"); hPrintf(" "); cgiMakeButton(hgtaDoMainPage, "cancel"); hPrintf("</FORM>"); } cgiDown(0.9); htmlClose(); }
void doGenePredPal(struct sqlConnection *conn) /* Output genePred protein alignment. */ { if (doGalaxy() && !cgiOptionalString(hgtaDoGalaxyQuery)) { sendParamsToGalaxy(hgtaDoPalOut, "submit"); return; } /* get rid of pesky cookies that would bring us back here */ cartRemove(cart, hgtaDoPal); cartRemove(cart, hgtaDoPalOut); if (anyIntersection() && intersectionIsBpWise()) errAbort("Can't do CDS FASTA output when bit-wise intersection is on. " "Please go back and select another output type, or clear the intersection."); checkNoGenomeDisabled(database, curTable); struct lm *lm = lmInit(64*1024); int fieldCount; struct bed *bedList = cookedBedsOnRegions(conn, curTable, getRegions(), lm, &fieldCount); //lmCleanup(&lm); textOpen(); int outCount = palOutPredsInBeds(conn, cart, bedList, curTable); /* Do some error diagnostics for user. */ if (outCount == 0) explainWhyNoResults(NULL); }
void doGenePredSequence(struct sqlConnection *conn) /* Output genePred sequence. */ { char *type = cartString(cart, hgtaGeneSeqType); if (sameWord(type, "protein")) { if (doGalaxy() && !cgiOptionalString(hgtaDoGalaxyQuery)) sendParamsToGalaxy(hgtaDoGenePredSequence, "submit"); else doGenePredNongenomic(conn, 1); } else if (sameWord(type, "mRNA")) { if (doGalaxy() && !cgiOptionalString(hgtaDoGalaxyQuery)) sendParamsToGalaxy(hgtaDoGenePredSequence, "submit"); else doGenePredNongenomic(conn, 2); } else genomicFormatPage(conn); }
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"); }
static void showTableButtons(char *db, char *table, boolean withGetButton) /* Put up the last buttons in a showTable section. */ { hPrintf("<BR>\n"); if (withGetButton) { if (doGalaxy()) /* need form fields here and Galaxy so add step to Galaxy */ cgiMakeButton(hgtaDoGalaxySelectedFields, "done with selections"); else cgiMakeButton(hgtaDoPrintSelectedFields, "get output"); hPrintf(" "); cgiMakeButton(hgtaDoMainPage, "cancel"); hPrintf(" "); } jsInit(); cgiMakeOnClickSubmitButton(jsSetVerticalPosition("mainForm"), setClearAllVar(hgtaDoSetAllFieldPrefix,db,table), "check all"); hPrintf(" "); cgiMakeOnClickSubmitButton(jsSetVerticalPosition("mainForm"), setClearAllVar(hgtaDoClearAllFieldPrefix,db,table), "clear all"); cgiDown(0.7); // Extra spacing below the buttons }
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(); }