コード例 #1
0
static void showWiggleMergeOptions()
/* Show subtrack merge operation options for wiggle/bedGraph tables. */
{
char *setting = cartUsualString(cart, hgtaNextSubtrackMergeWigOp, "average");
makeWigOpButton("average", setting);
printf("Average (at each position) of all selected subtracks' scores<BR>\n");
makeWigOpButton("sum", setting);
printf("Sum (at each position) of all selected subtracks' scores<BR>\n");
makeWigOpButton("product", setting);
printf("Product (at each position) of all selected subtracks' scores<BR>\n");
makeWigOpButton("min", setting);
printf("Minimum (at each position) of all selected subtracks' scores<BR>\n");
makeWigOpButton("max", setting);
printf("Maximum (at each position) of all selected subtracks' scores<P>\n");

cgiMakeCheckBox(hgtaNextSubtrackMergeRequireAll,
		cartUsualBoolean(cart, hgtaSubtrackMergeRequireAll, FALSE));
printf("Discard scores for positions at which one or more selected subtracks "
       "have no data.<BR>\n");
cgiMakeCheckBox(hgtaNextSubtrackMergeUseMinScore,
		cartUsualBoolean(cart, hgtaSubtrackMergeUseMinScore, FALSE));
printf("Discard scores less than \n");
setting = cartCgiUsualString(cart, hgtaNextSubtrackMergeMinScore, "0.0");
cgiMakeTextVar(hgtaNextSubtrackMergeMinScore, setting, 5);
printf(" after performing the above operation.<P>\n");
}
コード例 #2
0
void doMiddle(struct cart *cart)
/* Print out middle parts. */
{
char *old;

printf("<FORM ACTION=\"../cgi-bin/testCart\" METHOD=GET>\n");
cartSaveSession(cart, "testCart");

printf("<H3>Just a Test</H3>\n");
printf("<B>Filter:</B> ");
old = cartUsualString(cart, "filter", "red");
cgiMakeRadioButton("filter", "red", sameString(old, "red"));
printf("red ");
cgiMakeRadioButton("filter", "green", sameString(old, "green"));
printf("green ");
cgiMakeRadioButton("filter", "blue", sameString(old, "blue"));
printf("blue ");
cgiMakeButton("submit", "Submit");
printf("<BR>\n");

printf("<B>Font Attributes:</B> ");
cgiMakeCheckBox("fBold", cartUsualBoolean(cart, "fBold", FALSE, "testCart"));
printf("bold ");
cgiMakeCheckBox("fItalic", cartUsualBoolean(cart, "fItalic", FALSE, "testCart"));
printf("italic ");
cgiMakeCheckBox("fUnderline", cartUsualBoolean(cart, "fUnderline", FALSE, "testCart"));
printf("underline ");
printf("<BR>\n");

printf("</FORM>");
printf("<TT><PRE>");
cartDump(cart);
}
コード例 #3
0
static void hgSeqDisplayOptions(struct cart *cart, boolean canDoUTR,
                                boolean canDoIntrons, boolean offerRevComp)
/* Print out HTML FORM entries for sequence display options. */
{
    char *casing, *repMasking;

    puts("\n<H3> Sequence Formatting Options: </H3>\n");

    casing = cartCgiUsualString(cart, "hgSeq.casing", "exon");
    if (canDoIntrons)
    {
        cgiMakeRadioButton("hgSeq.casing", "exon", sameString(casing, "exon"));
        if (canDoUTR)
            puts("Exons in upper case, everything else in lower case. <BR>");
        else
            puts("Blocks in upper case, everything else in lower case. <BR>");
    }
    if (canDoUTR)
    {
        if (sameString(casing, "exon") && !canDoIntrons)
            casing = "cds";
        cgiMakeRadioButton("hgSeq.casing", "cds", sameString(casing, "cds"));
        puts("CDS in upper case, UTR in lower case. <BR>");
    }
    if ((sameString(casing, "exon") && !canDoIntrons) ||
            (sameString(casing, "cds") && !canDoUTR))
        casing = "upper";
    cgiMakeRadioButton("hgSeq.casing", "upper", sameString(casing, "upper"));
    puts("All upper case. <BR>");
    cgiMakeRadioButton("hgSeq.casing", "lower", sameString(casing, "lower"));
    puts("All lower case. <BR>");

    cgiMakeCheckBox("hgSeq.maskRepeats",
                    cartCgiUsualBoolean(cart, "hgSeq.maskRepeats", FALSE));
    puts("Mask repeats: ");

    repMasking = cartCgiUsualString(cart, "hgSeq.repMasking", "lower");
    cgiMakeRadioButton("hgSeq.repMasking", "lower",
                       sameString(repMasking, "lower"));
    puts(" to lower case ");
    cgiMakeRadioButton("hgSeq.repMasking", "N", sameString(repMasking, "N"));
    puts(" to N <BR>");
    if (offerRevComp)
    {
        cgiMakeCheckBox("hgSeq.revComp",
                        cartCgiUsualBoolean(cart, "hgSeq.revComp", FALSE));
        puts("Reverse complement (get \'-\' strand sequence)");
    }
}
コード例 #4
0
ファイル: filterFields.c プロジェクト: noelnamai/kent
static void showTableFieldsOnList(char *db, char *rootTable,
                                  struct asObject *asObj, struct slName *fieldList,
                                  boolean showItemRgb, boolean withGetButton)
/* Put up html table with check box, name, description, etc for each field. */
{
hTableStart();
struct slName *fieldName;
for (fieldName = fieldList; fieldName != NULL; fieldName = fieldName->next)
    {
    char *field = fieldName->name;
    char *var = checkVarName(db, rootTable, field);
    struct asColumn *asCol;
    hPrintf("<TR>");
    hPrintf("<TD>");
    cgiMakeCheckBox(var, varOn(var));
    hPrintf("</TD>");
    hPrintf("<TD>");
    if (showItemRgb && sameWord(field,"reserved"))
	hPrintf("itemRgb");
    else
	hPrintf("%s", field);
    hPrintf("</TD>");
    if (asObj != NULL)
	{
	asCol = asColumnFind(asObj, field);
	if (asCol != NULL)
	    hPrintf("<TD>%s</TD>", asCol->comment);
	else
	    hPrintf("<TD>&nbsp;</TD>");
	}
    hPrintf("</TR>");
    }
hTableEnd();
showTableButtons(db, rootTable, withGetButton);
}
コード例 #5
0
static void xyzConfigControls(struct column *col)
/* Print out configuration column */
{
    hPrintf("<TD>");
    char *italicsVarName = configVarName(col, "italics");
    cgiMakeCheckBox(italicsVarName, cartUsualBoolean(cart, italicsVarName, TRUE));
    hPrintf("italics");
    hPrintf("</TD>");
}
コード例 #6
0
ファイル: snakeUi.c プロジェクト: ucsc-mus-strain-cactus/kent
static void showInsertionsCfg(struct cart *cart, struct trackDb *tdb,
                              char *name, boolean parentLevel) {
printf("<BR><B>Show size of inserted sequence in other genome:</B>\n");

char codeVarName[1024];
safef(codeVarName, sizeof codeVarName, "%s." SNAKE_SHOW_INSERTION_SIZE, name);
boolean showInsertionSize = cartUsualBoolean(cart, codeVarName,
                                             SNAKE_DEFAULT_SHOW_INSERTION_SIZE);
cgiMakeCheckBox(codeVarName, showInsertionSize);
puts("<BR>");
}
コード例 #7
0
ファイル: edwWebSubmit.c プロジェクト: bowhan/kent
void getUrl(struct sqlConnection *conn)
/* Put up URL. */
{
edwMustGetUserFromEmail(conn, userEmail);
printf("Please enter a URL for a validated manifest file:<BR>");
printf("URL ");
cgiMakeTextVar("url", emptyForNull(cgiOptionalString("url")), 80);
cgiMakeButton("submitUrl", "submit");
printf("<BR>\n");
cgiMakeCheckBox("update", FALSE);
printf(" Update information associated with files that have already been uploaded.");
printf("<BR>Submission by %s", userEmail);
edwPrintLogOutButton();
}
コード例 #8
0
ファイル: edwWebDeprecate.c プロジェクト: bowhan/kent
void getFileListAndReason(struct sqlConnection *conn)
/* Put up URL. */
{
edwMustGetUserFromEmail(conn, userEmail);
printf("Please enter in accessions (ENCFF identifiers) for files to deprecate:<BR>");
cgiMakeTextArea("fileList", fileList, 4, 60);
printf("<BR>");
printf("Please enter in reason for deprecating files:<BR>");
cgiMakeTextArea("reason", reason, 4, 60);
printf("<BR>");
printf("Allow me to deprecate files not uploaded by me:  ");
cgiMakeCheckBox("allowBox", FALSE);
printf("<BR>");
cgiMakeButton("submit", "submit");
edwPrintLogOutButton();
}
コード例 #9
0
ファイル: filterFields.c プロジェクト: noelnamai/kent
static void showBedTableFields(char *db, char *table, int fieldCount, boolean withGetButton)
/* Put up html table with a check box for each field of custom
 * track. */
{
struct slName *field, *fieldList = getBedFields(fieldCount);

hTableStart();
for (field = fieldList; field != NULL; field = field->next)
    {
    char *var = checkVarName(db, table, field->name);
    hPrintf("<TR><TD>");
    cgiMakeCheckBox(var, varOn(var));
    hPrintf("</TD><TD>");
    hPrintf(" %s<BR>\n", field->name);
    hPrintf("</TD></TR>");
    }
hTableEnd();
showTableButtons(db, table, withGetButton);
}
コード例 #10
0
ファイル: bedList.c プロジェクト: Nicholas-NVS/kentUtils
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();
}
コード例 #11
0
ファイル: configure.c プロジェクト: bowhan/kent
static void configTable(struct column *colList, struct sqlConnection *conn)
/* Write out configuration table */
{
struct column *col;
char varName[128];
boolean isVis;

hPrintf("<center>");
hPrintf("<TABLE BORDER=1 CELLSPACING=0 CELLPADDING=1 BGCOLOR=\"#"HG_COL_INSIDE"\">\n");

/* Write out first row - labels. */
hPrintf("<TR BGCOLOR=\"#"HG_COL_HEADER"\">");
hPrintf("<TH ALIGN=left>Name</TH>");
hPrintf("<TH ALIGN=left>On</TH>");
//hPrintf("<TH ALIGN=left>Position</TH>");
hPrintf("<TH ALIGN=left>Description</TH>");
//hPrintf("<TH ALIGN=left>Configuration</TH>");

/* Print out configuration controls. */
hPrintf("</TR>");

/* Write out other rows. */
for (col = colList; col != NULL; col = col->next)
    {
    hPrintf("<TR>");

    /* Do small label. */
    hPrintf("<TD>%s</TD>", col->shortLabel);

    /* Do on/off dropdown. */
    hPrintf("<TD>");
    safef(varName, sizeof(varName), "%s%s.vis", colConfigPrefix, col->name);
    isVis = cartUsualBoolean(cart, varName, col->on);
    cgiMakeCheckBox(varName, isVis);
    hPrintf("</TD>");

    ///* Do left/right button */
    //hPrintf("<TD ALIGN=CENTER>");
    //safef(varName, sizeof(varName), "gisaidTable.do.up.%s", col->name);
    //if (col != colList)
    //    {
    //    hPrintf("<INPUT NAME=\"%s\" TYPE=\"IMAGE\" VALUE=\"up\" ", varName);
    //    hPrintf("SRC=\"../images/up.gif\">");
    //    }
    //safef(varName, sizeof(varName), "gisaidTable.do.down.%s", col->name);
    //if (col->next != NULL)
    //    {
    //    hPrintf("<INPUT NAME=\"%s\" TYPE=\"IMAGE\" VALUE=\"down\" ", varName);
    //    hPrintf("SRC=\"../images/down.gif\">");
    //    }
    //hPrintf("</TD>");

    /* Do long label. */
    hPrintf("<TD>%s</TD>", col->longLabel);

    ///* Do configuration controls. */
    //if (col->configControls != NULL)
    //     col->configControls(col);
    //else
    //     hPrintf("<TD>n/a</TD>");

    hPrintf("</TR>\n");
    }
hPrintf("</TABLE>\n");
hPrintf("</center>");
}
コード例 #12
0
ファイル: filterFields.c プロジェクト: noelnamai/kent
static void showLinkedTables(struct joiner *joiner, struct dbTable *inList,
	char *varPrefix, char *buttonName, char *buttonText)
/* Print section with list of linked tables and check boxes to turn them
 * on. */
{
struct dbTable *outList = NULL, *out, *in;
char dtName[256];
struct hash *uniqHash = newHash(0);
struct hash *inHash = newHash(8);

/* Build up list of tables we link to in outList. */
for (in = inList; in != NULL; in = in->next)
    {
    struct sqlConnection *conn = NULL;
    if (!trackHubDatabase(database))
	conn = hAllocConn(in->db);
    struct joinerPair *jpList, *jp;

    /* Keep track of tables in inList. */
    safef(dtName, sizeof(dtName), "%s.%s", inList->db, inList->table);
    hashAdd(inHash, dtName, NULL);

    /* First table in input is not allowed in output. */
    if (in == inList)
        hashAdd(uniqHash, dtName, NULL);

    /* Scan through joining information and add tables,
     * avoiding duplicate additions. */
    jpList = joinerRelate(joiner, in->db, in->table);
    for (jp = jpList; jp != NULL; jp = jp->next)
        {
	safef(dtName, sizeof(dtName), "%s.%s",
		jp->b->database, jp->b->table);
	if (!hashLookup(uniqHash, dtName) &&
	   !cartTrackDbIsAccessDenied(jp->b->database, jp->b->table))
	    {
	    hashAdd(uniqHash, dtName, NULL);
	    out = dbTableNew(jp->b->database, jp->b->table);
	    slAddHead(&outList, out);
	    }
	}
    joinerPairFreeList(&jpList);
    hFreeConn(&conn);
    }
slSort(&outList, dbTableCmp);

/* Print html. */
if (outList != NULL)
    {
    webNewSection("Linked Tables");
    hTableStart();
    for (out = outList; out != NULL; out = out->next)
	{
	struct sqlConnection *conn = hAllocConn(out->db);
	struct asObject *asObj = asForTable(conn, out->table);
	char *var = dbTableVar(varPrefix, out->db, out->table);
	hPrintf("<TR>");
	hPrintf("<TD>");
	cgiMakeCheckBox(var, varOn(var));
	hPrintf("</TD>");
	hPrintf("<TD>%s</TD>", out->db);
	hPrintf("<TD>%s</TD>", out->table);
	hPrintf("<TD>");
	if (asObj != NULL)
	    hPrintf("%s", asObj->comment);
	else
	    hPrintf("&nbsp;");
	hPrintf("</TD>");
	hPrintf("</TR>");
	hFreeConn(&conn);
	}
    hTableEnd();
    hPrintf("<BR>");

    cgiMakeButton(buttonName, buttonText);
    }
}
コード例 #13
0
static void hgSeqFeatureRegionOptions(struct cart *cart, boolean canDoUTR,
                                      boolean canDoIntrons)
/* Print out HTML FORM entries for feature region options. */
{
    char *exonStr = canDoIntrons ? " Exons" : "";
    char *setting;

    puts("\n<H3> Sequence Retrieval Region Options: </H3>\n");

    if (canDoIntrons || canDoUTR)
    {
        cgiMakeCheckBox("hgSeq.promoter",
                        cartCgiUsualBoolean(cart, "hgSeq.promoter", FALSE));
        puts("Promoter/Upstream by ");
        setting = cartCgiUsualString(cart, "hgSeq.promoterSize", "1000");
        cgiMakeTextVar("hgSeq.promoterSize", setting, 5);
        puts("bases <BR>");
    }

    if (canDoUTR)
    {
        cgiMakeCheckBox("hgSeq.utrExon5",
                        cartCgiUsualBoolean(cart, "hgSeq.utrExon5", TRUE));
        printf("5' UTR%s <BR>\n", exonStr);
    }

    if (canDoIntrons)
    {
        cgiMakeCheckBox("hgSeq.cdsExon",
                        cartCgiUsualBoolean(cart, "hgSeq.cdsExon", TRUE));
        if (canDoUTR)
            printf("CDS Exons <BR>\n");
        else
            printf("Blocks <BR>\n");
    }
    else if (canDoUTR)
    {
        cgiMakeCheckBox("hgSeq.cdsExon",
                        cartCgiUsualBoolean(cart, "hgSeq.cdsExon", TRUE));
        printf("CDS <BR>\n");
    }
    else
    {
        cgiMakeHiddenVar("hgSeq.cdsExon", "1");
    }

    if (canDoUTR)
    {
        cgiMakeCheckBox("hgSeq.utrExon3",
                        cartCgiUsualBoolean(cart, "hgSeq.utrExon3", TRUE));
        printf("3' UTR%s <BR>\n", exonStr);
    }

    if (canDoIntrons)
    {
        cgiMakeCheckBox("hgSeq.intron",
                        cartCgiUsualBoolean(cart, "hgSeq.intron", TRUE));
        if (canDoUTR)
            puts("Introns <BR>");
        else
            puts("Regions between blocks <BR>");
    }

    if (canDoIntrons || canDoUTR)
    {
        cgiMakeCheckBox("hgSeq.downstream",
                        cartCgiUsualBoolean(cart, "hgSeq.downstream", FALSE));
        puts("Downstream by ");
        setting = cartCgiUsualString(cart, "hgSeq.downstreamSize", "1000");
        cgiMakeTextVar("hgSeq.downstreamSize", setting, 5);
        puts("bases <BR>");
    }

    if (canDoIntrons || canDoUTR)
    {
        setting = cartCgiUsualString(cart, "hgSeq.granularity", "gene");
        cgiMakeRadioButton("hgSeq.granularity", "gene",
                           sameString(setting, "gene"));
        if (canDoUTR)
            puts("One FASTA record per gene. <BR>");
        else
            puts("One FASTA record per item. <BR>");
        cgiMakeRadioButton("hgSeq.granularity", "feature",
                           sameString(setting, "feature"));
        if (canDoUTR)
            puts("One FASTA record per region (exon, intron, etc.) with ");
        else
            puts("One FASTA record per region (block/between blocks) with ");
    }
    else
    {
        puts("Add ");
    }
    setting = cartCgiUsualString(cart, "hgSeq.padding5", "0");
    cgiMakeTextVar("hgSeq.padding5", setting, 5);
    puts("extra bases upstream (5') and ");
    setting = cartCgiUsualString(cart, "hgSeq.padding3", "0");
    cgiMakeTextVar("hgSeq.padding3", setting, 5);
    puts("extra downstream (3') <BR>");
    if (canDoIntrons && canDoUTR)
    {
        puts("&nbsp;&nbsp;&nbsp;");
        cgiMakeCheckBox("hgSeq.splitCDSUTR",
                        cartCgiUsualBoolean(cart, "hgSeq.splitCDSUTR", FALSE));
        puts("Split UTR and CDS parts of an exon into separate FASTA records");
    }
    puts("<BR>\n");
    puts("Note: if a feature is close to the beginning or end of a chromosome \n"
         "and upstream/downstream bases are added, they may be truncated \n"
         "in order to avoid extending past the edge of the chromosome. <P>");
}
コード例 #14
0
void webMain(struct liftOverChain *chain, char *dataFormat, boolean multiple)
/* set up page for entering data */
{
struct dbDb *dbList;
char *fromOrg = hArchiveOrganism(chain->fromDb), *toOrg = hArchiveOrganism(chain->toDb);
cgiParagraph(
    "This tool converts genome coordinates and genome annotation files "
    "between assemblies.&nbsp;&nbsp;"
    "The input data can be pasted into the text box, or uploaded from a file.&nbsp;&nbsp;"
    "If a pair of assemblies cannot be selected from the pull-down menus,"
    " a direct lift between them is unavailable.&nbsp;&nbsp;"
    "However, a sequential lift may be possible.&nbsp;&nbsp;"
    "Example: lift from Mouse, May 2004, to Mouse, Feb. 2006, and then from Mouse, "
    "Feb. 2006 to Mouse, July 2007 to achieve a lift from mm5 to mm9.&nbsp;&nbsp;"
    "");

/* create HMTL form */
puts("<FORM ACTION=\"../cgi-bin/hgLiftOver\" METHOD=\"POST\" "
       " ENCTYPE=\"multipart/form-data\" NAME=\"mainForm\">\n");
cartSaveSession(cart);

/* create HTML table for layout purposes */
puts("\n<TABLE WIDTH=\"100%%\">\n");

/* top two rows -- genome and assembly menus */
cgiSimpleTableRowStart();
cgiTableField("Original Genome: ");
cgiTableField("Original Assembly: ");
cgiTableField("New Genome: ");
cgiTableField("New Assembly: ");
cgiTableRowEnd();

cgiSimpleTableRowStart();

/* genome */
cgiSimpleTableFieldStart();
dbList = hGetLiftOverFromDatabases();
printSomeGenomeListHtmlNamed(HGLFT_FROMORG_VAR, chain->fromDb, dbList, onChange);
cgiTableFieldEnd();

/* from assembly */
cgiSimpleTableFieldStart();
printAllAssemblyListHtmlParm(chain->fromDb, dbList, HGLFT_FROMDB_VAR, 
			     TRUE, onChange);
cgiTableFieldEnd();

/* to assembly */

cgiSimpleTableFieldStart();
dbDbFreeList(&dbList);
dbList = hGetLiftOverToDatabases(chain->fromDb);
printLiftOverGenomeList(HGLFT_TOORG_VAR, chain->toDb, dbList, onChange);
cgiTableFieldEnd();

cgiSimpleTableFieldStart();
printAllAssemblyListHtmlParm(chain->toDb, dbList, HGLFT_TODB_VAR, TRUE, "");
cgiTableFieldEnd();

cgiTableRowEnd();
cgiTableEnd();

cgiParagraph("&nbsp;");
cgiSimpleTableStart();
cgiSimpleTableRowStart();
cgiSimpleTableFieldStart();
cgiTableField("Minimum ratio of bases that must remap:");
cgiTableFieldEnd();
cgiSimpleTableFieldStart();
cgiMakeDoubleVar(HGLFT_MINMATCH,chain->minMatch,6);
cgiTableFieldEnd();
cgiTableRowEnd();
cgiSimpleTableRowStart();
cgiSimpleTableFieldStart();
cgiTableField("Minimum chain size in target:");
cgiTableFieldEnd();
cgiSimpleTableFieldStart();
cgiMakeIntVar(HGLFT_MINSIZET,chain->minSizeT,4);
cgiTableFieldEnd();
cgiTableRowEnd();
cgiSimpleTableRowStart();
cgiSimpleTableFieldStart();
cgiTableField("Minimum hit size in query:");
cgiTableFieldEnd();
cgiSimpleTableFieldStart();
cgiMakeIntVar(HGLFT_MINSIZEQ,chain->minSizeQ,4);
cgiTableFieldEnd();
cgiTableRowEnd();
cgiSimpleTableRowStart();
cgiSimpleTableFieldStart();
cgiTableField("Allow multiple output regions:");
cgiTableFieldEnd();
cgiSimpleTableFieldStart();
cgiMakeCheckBox(HGLFT_MULTIPLE,multiple);
cgiTableFieldEnd();
cgiTableRowEnd();
cgiSimpleTableRowStart();
cgiSimpleTableFieldStart();
cgiTableField("Min ratio of alignment blocks/exons that must map:");
cgiTableFieldEnd();
cgiSimpleTableFieldStart();
cgiMakeDoubleVar(HGLFT_MINBLOCKS,chain->minBlocks,6);
cgiTableFieldEnd();
cgiTableRowEnd();
cgiSimpleTableRowStart();
cgiSimpleTableFieldStart();
cgiTableField("If thickStart/thickEnd is not mapped, use the closest mapped base:");
cgiTableFieldEnd();
cgiSimpleTableFieldStart();
cgiMakeCheckBox(HGLFT_FUDGETHICK,(chain->fudgeThick[0]=='Y') ? TRUE : FALSE);
cgiTableFieldEnd();
cgiTableRowEnd();
cgiTableEnd();

/* next row -- file format menu */
cgiParagraph(
         "&nbsp;For descriptions of the supported data formats, see the bottom of this page.");
cgiSimpleTableStart();
cgiSimpleTableRowStart();
cgiTableField("Data Format: ");
cgiSimpleTableFieldStart();
cgiMakeDropList(HGLFT_DATAFORMAT_VAR, 
                formatList, sizeof(formatList)/sizeof (char*) - 1, dataFormat);
cgiTableFieldEnd();
cgiTableRowEnd();
cgiTableEnd();

/* text box and two buttons (submit, reset) */
cgiParagraph("&nbsp;Paste in data:\n");
cgiSimpleTableStart();
cgiSimpleTableRowStart();

cgiSimpleTableFieldStart();
cgiMakeTextArea(HGLFT_USERDATA_VAR, cartCgiUsualString(cart, HGLFT_USERDATA_VAR, NULL), 10, 80);
cgiTableFieldEnd();

/* right element of table is a nested table
 * with two buttons stacked on top of each other */
cgiSimpleTableFieldStart();
cgiSimpleTableStart();

cgiSimpleTableRowStart();
cgiSimpleTableFieldStart();
cgiMakeSubmitButton();
cgiTableFieldEnd();
cgiTableRowEnd();

cgiSimpleTableRowStart();
cgiSimpleTableFieldStart();
cgiMakeClearButton("mainForm", HGLFT_USERDATA_VAR);
cgiTableFieldEnd();
cgiTableRowEnd();

cgiTableEnd();
cgiTableFieldEnd();

cgiTableRowEnd();
cgiTableEnd();

/* next  row -- file upload controls */
cgiParagraph("&nbsp;Or upload data from a file:");
cgiSimpleTableStart();
cgiSimpleTableRowStart();
printf("<TD><INPUT TYPE=FILE NAME=\"%s\"></TD>\n", HGLFT_DATAFILE_VAR);
puts("<TD><INPUT TYPE=SUBMIT NAME=SubmitFile VALUE=\"Submit File\"></TD>\n");
cgiTableRowEnd();
cgiTableEnd();
printf("<input type=\"hidden\" name=\"%s\" value=\"0\">\n",
                        HGLFT_REFRESHONLY_VAR);
puts("</FORM>\n");

cartSaveSession(cart);
puts("</FORM>");
freeMem(fromOrg);
freeMem(toOrg);
}
コード例 #15
0
ファイル: hPrint.c プロジェクト: bowhan/kent
void hCheckBox(char *varName, boolean checked)
/* Make check box if not suppressed. */
{
if (!suppressHtml)
    cgiMakeCheckBox(varName, checked);
}
コード例 #16
0
ファイル: hgPcr.c プロジェクト: ucsc-mus-strain-cactus/kent
void doGetPrimers(char *db, char *organism, struct pcrServer *serverList,
                  char *fPrimer, char *rPrimer, int maxSize, int minPerfect, int minGood,
                  boolean flipReverse)
/* Put up form to get primers. */
{
    redoDbAndOrgIfNoServer(serverList, &db, &organism);
    struct sqlConnection *conn = hConnectCentral();
    boolean gotTargetDb = sqlTableExists(conn, "targetDb");
    hDisconnectCentral(&conn);

    printf("<FORM ACTION=\"../cgi-bin/hgPcr\" METHOD=\"GET\" NAME=\"mainForm\">\n");
    cartSaveSession(cart);

    printf("<TABLE BORDER=0 WIDTH=\"96%%\" COLS=7><TR>\n");

    printf("%s", "<TD><CENTER>\n");
    printf("Genome:<BR>");
    showGenomes(organism, serverList);
    printf("%s", "</TD>\n");

    printf("%s", "<TD><CENTER>\n");
    printf("Assembly:<BR>");
    showAssemblies(organism, db, serverList, gotTargetDb);
    printf("%s", "</TD>\n");

    if (gotTargetDb)
    {
        struct targetPcrServer *targetServerList = getTargetServerList(db, NULL);
        if (targetServerList != NULL)
        {
            char *target = cartUsualString(cart, "wp_target", "genome");
            printf("%s", "<TD><CENTER>\n");
            printf("Target:<BR>");
            showTargets(target, targetServerList);
            printf("%s", "</TD>\n");
        }
        else
            cgiMakeHiddenVar("wp_target", "genome");
    }
    else
        cgiMakeHiddenVar("wp_target", "genome");

    printf("%s", "<TD COLWIDTH=2><CENTER>\n");
    printf("Forward Primer:<BR>");
    cgiMakeTextVar("wp_f", fPrimer, 22);
    printf("%s", "</TD>\n");

    printf("%s", "<TD><CENTER COLWIDTH=2>\n");
    printf(" Reverse Primer:<BR>");
    cgiMakeTextVar("wp_r", rPrimer, 22);
    printf("%s", "</TD>\n");

    printf("%s", "<TD><CENTER>\n");
    printf("&nbsp;<BR>");
    cgiMakeButton("Submit", "submit");
    printf("%s", "</TD>\n");

    printf("</TR></TABLE><BR>");

    printf("<TABLE BORDER=0 WIDTH=\"96%%\" COLS=4><TR>\n");
    printf("%s", "<TD><CENTER>\n");
    printf("Max Product Size: ");
    cgiMakeIntVar("wp_size", maxSize, 5);
    printf("%s", "</TD>\n");

    printf("%s", "<TD><CENTER>\n");
    printf(" Min Perfect Match: ");
    cgiMakeIntVar("wp_perfect", minPerfect, 2);
    printf("%s", "</TD>\n");

    printf("%s", "<TD><CENTER>\n");
    printf(" Min Good Match: ");
    cgiMakeIntVar("wp_good", minGood, 2);
    printf("%s", "</TD>\n");

    printf("%s", "<TD><CENTER>\n");
    printf(" Flip Reverse Primer: ");
    cgiMakeCheckBox("wp_flipReverse", flipReverse);
    printf("%s", "</TD>\n");
    printf("</TR></TABLE><BR>");

    printf("</FORM>\n");

    /* Put up a second form who's sole purpose is to preserve state
     * when the user flips the genome button. */
    printf("<FORM ACTION=\"../cgi-bin/hgPcr\" METHOD=\"GET\" NAME=\"orgForm\">"
           "<input type=\"hidden\" name=\"wp_target\" value=\"\">\n"
           "<input type=\"hidden\" name=\"db\" value=\"\">\n"
           "<input type=\"hidden\" name=\"org\" value=\"\">\n"
           "<input type=\"hidden\" name=\"wp_f\" value=\"\">\n"
           "<input type=\"hidden\" name=\"wp_r\" value=\"\">\n"
           "<input type=\"hidden\" name=\"wp_size\" value=\"\">\n"
           "<input type=\"hidden\" name=\"wp_perfect\" value=\"\">\n"
           "<input type=\"hidden\" name=\"wp_good\" value=\"\">\n"
           "<input type=\"hidden\" name=\"wp_showPage\" value=\"true\">\n");
    cartSaveSession(cart);
    printf("</FORM>\n");
    webNewSection("About In-Silico PCR");
    doHelp();
    printf("%s", "<P><H3>Author</H3>\n");
    printf("%s", "<P>In-Silico PCR was written by "
           "<A HREF=\"mailto:[email protected]\">Jim Kent</A>.\n"
           "Interactive use on this web server is free to all.\n"
           "Sources and executables to run batch jobs on your own server are available free\n"
           "for academic, personal, and non-profit purposes.  Non-exclusive commercial\n"
           "licenses are also available.  Contact Jim for details.</P>\n");
}