Beispiel #1
0
static void prOrfeomeCloneLinks(struct sqlConnection *conn, char *acc, struct cloneInfo *ci)
/* print table of clone links */
{
webPrintLinkTableStart();
webPrintLabelCell("Links");
webPrintLinkTableNewRow();
if (ci->gi > 0)
    prOrderLink("ORFeome", ci);

#if 0
// link to ORFeome database
// FIXME: this doesn't appear to work, need to ask Christa
// http://www.orfeomecollaboration.org/bin/cloneStatus.pl
#endif

if (ci->imageId > 0)
    prImageLink(ci);
prGenbankLink(ci);
if (ci->refSeqAccv != NULL)
    prRefSeqLinks(ci);
if (sqlTableExists(conn, "ccdsGene"))
    prCcdsLinks(conn, ci);
if (sqlTableExists(conn, "knownGene"))
    prUcscGenesLinks(conn, ci);

webPrintLinkTableEnd();
}
Beispiel #2
0
static void prAligns(struct sqlConnection *conn, struct cloneInfo *ci)
/* print table of alignments */
{
struct psl* pslList = getAlignments(conn, ci->pslTbl, ci->acc);
assert(pslList != NULL);
slSort(&pslList, pslCmpMatch);

// header, print note about order only if we have multiple alignments and didn't
// come from another details page
webNewSection("Alignments");
if ((pslList->next != NULL) && (winStart < winEnd))
    printf("<span style='font-size:smaller;'><em>The alignment you clicked on is shown first.</em></span>\n");

webPrintLinkTableStart();
webPrintLabelCell("genomic (browser)");
webPrintLabelCell("span");
webPrintLabelCell("&nbsp;");
webPrintLabelCell("mRNA (alignment details)");
webPrintLabelCell("identity");
webPrintLabelCell("aligned");

// print with clicked alignment first
struct psl* psl;
int pass;
for (pass = 1; pass <= 2; pass++)
    {
    for (psl = pslList; psl != NULL; psl = psl->next)
        if ((pass == 1) == (psl->tStart == ci->start))
            {
            webPrintLinkTableNewRow();
            prAlign(conn, ci->pslTbl, psl);
            }
    }
webPrintLinkTableEnd();
}
Beispiel #3
0
static void printOtherPars(struct bed *clickedPar, struct bed *pars)
/* pirnt out other pairs of pars, keeping chroms lined up that were not
 * selected */
{
webPrintLinkTableNewRow();
webPrintWideCenteredLabelCell("Other PARs", 3);
struct bed *par1;
for (par1 = pars; par1 != NULL; par1 = par1->next->next)
    {
    webPrintLinkTableNewRow();
    if (sameString(par1->chrom, clickedPar->chrom))
        printHomPairRow(par1, par1->next);
    else
        printHomPairRow(par1->next, par1);
    }
}
Beispiel #4
0
void doParDetails(struct trackDb *tdb, char *name)
/* show details of a PAR item. */
{
// load entire PAR table (t's tiny) and partition
struct bed *pars = loadParTable(tdb);
if (slCount(pars) & 1)
    errAbort("par items not paired in %s", tdb->table);

struct bed *clickedPar = getClickedPar(name, &pars);
struct bed *homPar = getHomologousPar(clickedPar, &pars);
slSort(&pars, parCmp);

cartWebStart(cart, database, "Pseudoautosomal regions");
webPrintLinkTableStart();

// header
webPrintLabelCell("");
webPrintLabelCell("Selected PAR");
webPrintLabelCell("Homologous PAR");

// selected
webPrintLinkTableNewRow();
printHomPairRow(clickedPar, homPar);
if (pars != NULL)
    printOtherPars(clickedPar, pars);

webPrintLinkTableEnd();
printTrackHtml(tdb);
webEnd();

bedFreeList(&pars);
bedFree(&clickedPar);
bedFree(&homPar);
}
Beispiel #5
0
static void prImageLink(struct cloneInfo *ci)
/* create link to IMAGE database */
{
webPrintLinkTableNewRow();
webPrintLinkCellStart();
printf("<a href=\"");
printImageUrl(ci->imageId);
printf("\" TARGET=_blank>IMAGE clone %d</a>", ci->imageId);
webPrintLinkCellEnd();
}
Beispiel #6
0
static void prGenbankLink(struct cloneInfo *ci)
/* create link to Genbank database */
{
webPrintLinkTableNewRow();
webPrintLinkCellStart();
printf("<a href=\"");
printEntrezNucleotideUrl(stdout, ci->acc);
printf("\" TARGET=_blank>Genbank %s</a>", ci->acc);
webPrintLinkCellEnd();
}
Beispiel #7
0
static void prRefSeqLinks(struct cloneInfo *ci)
/* print link to RefSeq */
{
webPrintLinkTableNewRow();
webPrintLinkCellStart();
printf("<a href=\"");
printEntrezNucleotideUrl(stdout, ci->refSeqAccv);
printf("\" TARGET=_blank>RefSeq %s</a>", ci->refSeqAccv);
webPrintLinkCellEnd();
}
Beispiel #8
0
static void prOrderLink(char *name, struct cloneInfo *ci)
/* create link to NCBI clone order CGI */
{
webPrintLinkTableNewRow();
webPrintLinkCellStart();
printf("<a href=\"");
printOrderUrl(ci->gi);
printf("\" TARGET=_blank>Order %s clone</a>", name);
webPrintLinkCellEnd();
}
Beispiel #9
0
static void prMiscDiff(struct gbMiscDiff *gmd, unsigned miscDiffFlds)
/* print any gbMiscDiff row */
{
webPrintLinkTableNewRow();
webPrintIntCell(gmd->mrnaStart);
webPrintIntCell(gmd->mrnaEnd);
if (miscDiffFlds & gbMiscDiffGene)
    webPrintLinkCell(gmd->gene);
if (miscDiffFlds & gbMiscDiffReplace)
    webPrintLinkCell(gmd->replacement);
if (miscDiffFlds & gbMiscDiffNotes)
    webPrintLinkCell(gmd->notes);
}
Beispiel #10
0
static void prMgcCloneLinks(struct sqlConnection *conn, struct mgcDb *mgcDb, struct cloneInfo *ci)
/* print table of clone links */
{
webPrintLinkTableStart();
webPrintLabelCell("Links");
if (ci->gi > 0)
    prOrderLink(mgcDb->name, ci);

// link to MGC database
webPrintLinkTableNewRow();
webPrintLinkCellStart();
printf("<a href=\"");
printMgcUrl(ci->imageId);
printf("\" TARGET=_blank>%s clone database</a>", mgcDb->name);
webPrintLinkCellEnd();

prImageLink(ci);
prGenbankLink(ci);
if (ci->refSeqAccv != NULL)
    prRefSeqLinks(ci);
if (sqlTableExists(conn, "ccdsGene"))
    prCcdsLinks(conn, ci);
if (sqlTableExists(conn, "knownGene"))
    prUcscGenesLinks(conn, ci);

// Brent lab validation database
if (isInMBLabValidDb(ci->acc))
    {
    webPrintLinkTableNewRow();
    webPrintLinkCellStart();
    printf("<a href=\"");
    printMBLabValidDbUrl(ci->acc);
    printf("\" TARGET=_blank>Brent Lab Clone Validation</a>");
    webPrintLinkCellEnd();
    }
webPrintLinkTableEnd();
}
Beispiel #11
0
static void prUcscGenesLinks(struct sqlConnection *conn, struct cloneInfo *ci)
/* generate links to UCSC or known genes */
{
struct geneSimilarities *ucscGenes
    = geneSimilaritiesBuildAt(conn, TRUE, ci->acc, seqName, ci->start,
                              ci->gpTbl, "knownGene");
if (ucscGenes->genes != NULL)
    {
    /* just use cloest one */
    struct genePred *gene = ucscGenes->genes->gene;
    webPrintLinkTableNewRow();
    webPrintLinkCellStart();
    printf("<A href=\"../cgi-bin/hgGene?%s&db=%s&hgg_gene=%s&hgg_chrom=%s&hgg_start=%d&hgg_end=%d&hgg_type=knownGene\">UCSC Gene %s</A>",
           cartSidUrlString(cart), database, gene->name, seqName, gene->txStart, gene->txEnd, gene->name);
    webPrintLinkCellEnd();
    }
geneSimilaritiesFree(&ucscGenes);
}
Beispiel #12
0
static void prCcdsLinks(struct sqlConnection *conn, struct cloneInfo *ci)
/* generate links to CCDS gene */
{
struct geneSimilarities *ccdsGenes
    = geneSimilaritiesBuildAt(conn, TRUE, ci->acc, seqName, ci->start,
                              ci->gpTbl, "ccdsGene");
if (ccdsGenes->genes != NULL)
    {
    /* just use cloest one */
    char *ccdsId = ccdsGenes->genes->gene->name;
    webPrintLinkTableNewRow();
    webPrintLinkCellStart();
    printf("<A href=\"");
    printCcdsUrl(conn, ccdsId);
    printf("\">%s</A>", ccdsId);
    webPrintLinkCellEnd();
    }
geneSimilaritiesFree(&ccdsGenes);
}
Beispiel #13
0
static void prSeqLinks(struct sqlConnection *conn, struct cloneInfo *ci)
/* print table of sequence links */
{
webNewSection("Sequences");
webPrintLinkTableStart();

webPrintLinkCellStart();
hgcAnchorSomewhere("htcDisplayMrna", ci->acc, ci->pslTbl, seqName);
printf("mRNA</a>");
webPrintLinkCellEnd();

webPrintLinkCellStart();
hgcAnchorSomewhere("htcTranslatedMRna", ci->acc, ci->pslTbl, seqName);
printf("Protein</A><br>");
webPrintLinkCellEnd();

webPrintLinkCellStart();
hgcAnchorSomewhere("htcGeneInGenome", ci->acc, ci->gpTbl, seqName);
printf("Genomic</A>");
webPrintLinkCellEnd();

webPrintLinkTableNewRow();

webPrintLinkCellStart();
hgcAnchorSomewhere("htcDisplayMrna", ci->acc, ci->gpTbl, seqName);
printf("Reference genome mRNA</A>");
webPrintLinkCellEnd();

#if BROKEN
// FIXME: doesn't work when genePred table is not the track; not that important
webPrintLinkCellStart();
hgcAnchorSomewhereTbl("htcTranslatedPredMRna", ci->acc, ci->pslTbl, seqName, ci->gpTbl);
printf("Reference genome protein</A>");
webPrintLinkCellEnd();
webFinishPartialLinkTable(1, 2, 3);
#else
webFinishPartialLinkTable(1, 1, 3);
#endif

webPrintLinkTableEnd();
}
Beispiel #14
0
static void prRefSeqSim(struct cloneInfo *ci, struct geneSim *gs)
/* print similarity information for a given RefSeq */
{
webPrintLinkTableNewRow();
// RefSeq acc and link
webPrintLinkCellStart();
printf("<a href=\"");
printEntrezNucleotideUrl(stdout, gs->gene->name);
printf("\" TARGET=_blank>%s</a>", gs->gene->name);
webPrintLinkCellEnd();

// link to browser
webPrintLinkCellStart();
printf("<A HREF=\"%s&db=%s&position=%s%%3A%d-%d\" target=_blank>%s:%d-%d</A>",
       hgTracksPathAndSettings(), database,
       gs->gene->chrom, gs->gene->txStart+1, gs->gene->txEnd,
       gs->gene->chrom, gs->gene->txStart+1, gs->gene->txEnd);
webPrintLinkCellEnd();

// similarity
webPrintLinkCellRightStart();
printf("%0.2f%%", 100.0*gs->sim);
webPrintLinkCellEnd();
}
Beispiel #15
0
static void prCloneInfo(struct cloneInfo *ci)
/* print table of clone information */
{
webPrintLinkTableStart();
prCellLabelVal("Gene", ci->geneName);
webPrintLinkTableNewRow();
prCellLabelVal("Product", ci->productName);
webPrintLinkTableNewRow();
prCellLabelVal("Tissue", ci->tissue);
webPrintLinkTableNewRow();
prCellLabelVal("Library", ci->library);
webPrintLinkTableNewRow();
prCellLabelVal("Development", ci->development);
webPrintLinkTableNewRow();
prCellLabelVal("CDS", ci->cds);
webPrintLinkTableNewRow();
prCellLabelVal("Modification date", ci->moddate);
webPrintLinkTableEnd();
}
Beispiel #16
0
void showTxInfo(char *geneName, struct trackDb *tdb, char *txInfoTable)
/* Print out stuff from txInfo table. */
{
struct sqlConnection *conn = hAllocConn(database);
if (sqlTableExists(conn, txInfoTable))
    {
    char query[512];
    sqlSafef(query, sizeof(query), "select * from %s where name='%s'", txInfoTable, geneName);
    struct sqlResult *sr = sqlGetResult(conn, query);
    char **row;
    if ((row = sqlNextRow(sr)) != NULL)
        {
	struct txInfo *info = txInfoLoad(row);
	webNewSection("Transcript Information");
	webPrintLinkTableStart();

	webPrintLinkCell("<B>category:</B>");
	webPrintLinkCell(info->category);
	webPrintLinkCell("<B>nonsense-mediated-decay:</B>");
	webPrintLinkCell(info->nonsenseMediatedDecay  ? "yes" : "no");
	webPrintLinkCell("<B>RNA accession:</B>");
	webPrintLinkCell(info->sourceAcc);
	webPrintLinkTableNewRow();

	webPrintLinkCell("<B>exon count:</B>");
	webPrintIntCell(info->exonCount);
	webPrintLinkCell("<B>CDS single in 3' UTR:</B>");
	webPrintLinkCell(info->cdsSingleInUtr3 ? "yes" : "no");
	webPrintLinkCell("<B>RNA size:</B>");
	webPrintIntCell(info->sourceSize);
	webPrintLinkTableNewRow();

	webPrintLinkCell("<B>ORF size:</B>");
	webPrintIntCell(info->orfSize);
	webPrintLinkCell("<B>CDS single in intron:</B>");
	webPrintLinkCell(info->cdsSingleInIntron ? "yes" : "no");
	webPrintLinkCell("<B>Alignment % ID:</B>");
	webPrintDoubleCell(info->aliIdRatio*100);
	webPrintLinkTableNewRow();
	
	webPrintLinkCell("<B>txCdsPredict score:</B>");
	webPrintDoubleCell(info->cdsScore);
	webPrintLinkCell("<B>frame shift in genome:</B>");
	webPrintLinkCell(info->genomicFrameShift  ? "yes" : "no");
	webPrintLinkCell("<B>% Coverage:</B>");
	webPrintDoubleCell(info->aliCoverage*100);
	webPrintLinkTableNewRow();

	webPrintLinkCell("<B>has start codon:</B>");
	webPrintLinkCell(info->startComplete ? "yes" : "no");
	webPrintLinkCell("<B>stop codon in genome:</B>");
	webPrintLinkCell(info->genomicStop ? "yes" : "no");
	webPrintLinkCell("<B># of Alignments:</B>");
	webPrintIntCell(info->genoMapCount);
	webPrintLinkTableNewRow();

	webPrintLinkCell("<B>has end codon:</B>");
	webPrintLinkCell(info->endComplete ? "yes" : "no");
	webPrintLinkCell("<B>retained intron:</B>");
	webPrintLinkCell(info->retainedIntron ? "yes" : "no");
	webPrintLinkCell("<B># AT/AC introns</B>");
	webPrintIntCell(info->atacIntrons);
	webPrintLinkTableNewRow();

	webPrintLinkCell("<B>selenocysteine:</B>");
	webPrintLinkCell(info->selenocysteine  ? "yes" : "no");
	webPrintLinkCell("<B>end bleed into intron:</B>");
	webPrintIntCell(info->bleedIntoIntron);
	webPrintLinkCell("<B># strange splices:</B>");
	webPrintIntCell(info->strangeSplice);

	webPrintLinkTableEnd();

	txInfoFree(&info);
	}
    sqlFreeResult(&sr);
    }
hFreeConn(&conn);

printf("%s",
"The table above summarizes many aspects of this transcripts.  Here is a more \n"
"detailed description of each of the fields than can fit in the label.  Also\n"
"see the CDS Prediction Information table below for additional information\n"
"relevant to the predicted protein product if any.\n"
"\n"
"<UL>\n"
"<LI><B>category</B> - This is either <i>coding</i>, <i>noncoding</i>,\n"
"<i>antisense</i> or \n"
"<i>nearCoding</i>. A coding transcript is one where the evidence is relatively\n"
"good that it produces a protein. The nearCoding transcripts overlap coding\n"
"transcripts by at least 20 bases on the same strand, but themselves do not seem to produce \n"
"protein products.  In many cases this is because they are splicing varients\n"
"with introns after the stop codon, that therefore undergo nonsense mediated decay. \n"
"Antisense transcripts overlap coding transcripts by at least 20 bases on the oppposite\n"
"strand.\n"
"The other transcripts, which are neither coding, nor overlapping coding,\n"
"are categorized as noncoding.</LI>\n"
"<LI><B>exon count</B> - The number of exons in the gene. Single exon genes are\n"
"generally somewhat less reliable than multi-exon genes, though there are\n"
"many well-known genuine single exon genes such as the Histones and the Sox \n"
"family.</LI>\n"
"<LI><B>ORF size</B> - The size of the open reading frame in the mRNA. Divide by\n"
"three to get the size of the protein.</LI>\n"
"<LI><B>txCdsPredict score</B> - The score from the txCdsPredict program. This\n"
"program weighs a variety of evidence including the presence of a Kozak consensus\n"
"sequence at the start codon, the length of the ORF, the presense of upstream\n"
"ORFs, homology in other species, and nonsense mediated decay.  In general\n"
"a score over 1000 is almost certain to be a protein, and scores over 800 have\n"
"about a 90% chance of being a protein.</LI>\n"
"<LI><B>has start codon</B> - Indicates if the initial codon is an ATG.</LI>\n"
"<LI><B>has end codon</B> - Indicates if the last codon is TAA, TAG, or TGA.</LI>\n"
"<LI><B>selenocysteine</B> - Indicates if this is one of the special proteins where\n"
"TGA encodes the animo acid selenocysteine rather than encoding a stop codon.</LI>\n"
"<LI><B>nonsense-mediated-decay</B> - Indicates whether the final intron is more than\n"
"55 bases after the stop codon.  If true, then generally the mRNA will be degraded\n"
"before it can produce a detectable amount of protein. Therefore when this condition\n"
"is true we remove the predicted coding region  from the transcript.</LI>\n"
"<LI><B>CDS single in 3' UTR</B> - This is a strong indicator that the coding region\n"
"(CDS) is a coincedental open reading frame  rather than a true indication \n"
"that the transcript codes for protein.  This indicates that the coding sequence \n"
"resides in a single exon, and that this exon is located entirely in the 3' UTR \n"
"of another transcript that codes for a different protein not overlapping the \n"
"ORF in the same frame. We remove the CDS from non-refSeq transcripts that meet\n"
"this condition, which often results from a retained intron or from missing the\n"
"initial parts of a transcript.</LI>\n"
"<LI><B>CDS single in intron</B> - This is another strong indicator that the ORF is\n"
"not real. Here the coding region (CDS) lies entirely in the intron of another\n"
"transcript which has strong evidence of coding for a protein. We remove the CDS\n"
"from non-refSeq transcripts that meet this condition, which generally results\n"
"from a retained intron.</LI>\n"
"<LI><B>frame shift in genome</B> - This only occurs for RefSeq transcripts. Here\n"
"a frame shift is detected in the coding region when aligning the transcript against\n"
"the genome. Since RefSeq does examine these cases carefully, it is strong evidence\n"
"that the genome sequence is in error, or that the anonymous DNA doner carried\n"
"a frame-shift mutation in this gene.  In general there will be multiple independent\n"
"cDNA clones supporting the RefSeq over the genome.  In the gene display on the\n"
"browser, one or two bases will be removed from the gene to keep frame intact.</LI>\n"
"<LI><B>stop codon in genome</B> - This also only occurs for RefSeq transcripts, and\n"
"as with the frame shifts, there is generally multiple lines of evidence suggesting\n"
"sequencing error or mutation in the reference genome. In the gene display on the\n"
"browser three bases will be removed from the gene to avoid the stop.</LI>\n"
"<LI><B>retained intron</B> - The transcript contains what is an intron in \n"
"an overlapping transcript on the same strand.  In many cases this indicates\n"
"that the transcript was not completely processed. Unless specific steps are\n"
"taken to isolate cytoplasmic rather than nuclear RNA, a certain fraction of the\n"
"RNA isolated for sequencing will be incompletely processed.  Transcripts with\n"
"retained introns should be viewed suspiciously, especially if they are long.\n"
"However there are cases where fully mature mRNA transcripts are made with \n"
"and without a particular intron, so transcripts with retained introns are not\n"
"eliminated from this gene set.</LI>\n"
"<LI><B>end bleed into intron</B> - Very often when an intron is retained, it is so\n"
"long that the next exon is not reached and sequenced. In this case the retained\n"
"intron can't be detected directly.  However high values of \"end bleed\" are\n"
"strongly suggestive of a retained intron. End bleed measures how far the end of a transcript extends into an intron defined by another overlapping transcript. Note\n"
"however that alternative promoters and alternative polyadenylation sites can\n"
"create end bleeds in fully mature transcripts.</LI>\n"
"<LI><B>RNA accession</B> - The RefSeq or Genbank/EMBL/DJJ accession on which\n"
"this transcript is most closely based. Note that the splice sites when possible\n"
"are taken from a consensus of RNA alignments rather than just from a single RNA.\n"
"For non-RefSeq genes the bases are taken from the genome rather than the RNA.\n"
"However the transcript does define which introns and exons are used to build\n"
"the transcript.</LI>\n"
"<LI><B>RNA size</B> - The size of the RNA on which this transcript is most\n"
"closely based, including the poly-A tail.</LI>\n"
"<LI><B>Alignment % ID</B> - Percentage identity within of alignment of RNA\n"
"to genome.</LI>\n"
"<LI><B>% Coverage</B> - The percentage of the RNA covered by the alignment to\n"
"genome. This excludes the poly-A tail.</LI>\n"
"<LI><B># of Alignments:</B> - The number of times this RNA aligns to the genome\n"
"at very high stringency.  More care must be taken in interpreting genes based\n"
"on transcripts with multiple alignments. We do substantial filtering to avoid\n"
"pseudogenes, but extremely recent, extremely complete pseudogenes may still\n"
"pass these filters and cause multiple alignments.</LI>\n"
"<LI><B># of AT/AC introns</B> - The number of introns in this transcript with\n"
"AT/AC rather than the usual GT/AG ends. There are roughly 300 genes with\n"
"legitimate AT/AC  introns.</LI>\n"
"<LI><B># of strange splices</B> - The number of introns that have ends which are\n"
"neither GT/AG, GC/AG, nor AT/AC. Many of these are the result of sequencing\n"
"errors, or polymorphisms between the DNA donors and the RNA donors.</LI>\n"
"</UL>\n");
}
Beispiel #17
0
static struct hash *outputPublicTable(struct sqlConnection *conn, char *publicTable)
/* Put up the list of public hubs and other controls for the page. */
{
struct hash *publicHash = NULL;
char query[512];
sqlSafef(query, sizeof(query), "select hubUrl,shortLabel,longLabel,dbList from %s", 
	publicTable); 
struct sqlResult *sr = sqlGetResult(conn, query);
char **row;

boolean gotAnyRows = FALSE;
while ((row = sqlNextRow(sr)) != NULL)
    {
    char *url = row[0], *shortLabel = row[1], *longLabel = row[2], 
    	  *dbList = row[3];
    if (gotAnyRows)
	webPrintLinkTableNewRow();
    else
	{
	/* output header */
	printf("<div id=\"publicHubs\" class=\"hubList\"> \n");
	printf("<table id=\"publicHubsTable\"> "
	    "<thead><tr> "
		"<th>Display</th> "
		"<th>Hub Name</th> "
		"<th>Description</th> "
		"<th>Assemblies</th> "
		"<th>URL</th> "
	    "</tr></thead>\n");

	// start first row
	printf("<tbody> <tr>");
	gotAnyRows = TRUE;

	// allocate the hash to store hubUrl's
	publicHash = newHash(5);
	}

    char *errorMessage = NULL;
    // get an id for this hub
    unsigned id = hubFindOrAddUrlInStatusTable(database, cart, 
	url, &errorMessage);

    if ((id != 0) && isEmpty(errorMessage)) 
	{
	ourCellStart();
	char hubName[32];
	safef(hubName, sizeof(hubName), "%s%u", hgHubConnectHubVarPrefix, id);
	cartMakeCheckBox(cart, hubName, FALSE);
	ourCellEnd();
	}
    else if (!isEmpty(errorMessage))
	{
	// give user a chance to clear the error
	ourCellStart();
	printf(
	"<input name=\"hubClearButton\""
	    "onClick=\"document.resetHubForm.elements['hubUrl'].value='%s';"
		"document.resetHubForm.submit();return true;\" "
		"class=\"hubField\" type=\"button\" value=\"check hub\">"
		, url);
	ourCellEnd();
	}
    else
	errAbort("cannot get id for hub with url %s\n", url);

    ourPrintCell(shortLabel);
    if (isEmpty(errorMessage))
	ourPrintCell(longLabel);
    else
	printf("<TD><span class=\"hubError\">ERROR: %s </span>"
	    "<a href=\"../goldenPath/help/hgTrackHubHelp.html#Debug\">Debug</a></TD>", 
	    errorMessage);

    printGenomeList(slNameListFromComma(dbList)); // Leaking a bit of memory
    ourPrintCell(url);

    hashStore(publicHash, url);
    }
sqlFreeResult(&sr);

if (gotAnyRows)
    {
    printf("</TR></tbody></TABLE>\n");
    printf("</div>");
    }
return publicHash;
}
Beispiel #18
0
static void hgHubConnectUnlisted(struct hubConnectStatus *hubList, 
    struct hash *publicHash)
/* Put up the list of unlisted hubs and other controls for the page. */
/* uses publicHash to distingusih public hubs from unlisted ones */
/* NOTE: Destroys hubList */
{
// put out the top of our page
printf("<div id=\"unlistedHubs\" class=\"hubList\"> \n"
    "<table id=\"unlistedHubsTable\"> \n"
    "<thead><tr> \n"
	"<th colspan=\"6\" id=\"addHubBar\"><label for=\"hubUrl\">URL:</label> \n"
	"<input name=\"hubText\" id=\"hubUrl\" class=\"hubField\""
	    "type=\"text\" size=\"65\"> \n"
	"<input name=\"hubAddButton\""
	    "onClick=\"hubText.value=$.trim(hubText.value);if(validateUrl($('#hubUrl').val())) { document.addHubForm.elements['hubUrl'].value=hubText.value;"
		"document.addHubForm.submit();return true;} else { return false;}\" "
		"class=\"hubField\" type=\"button\" value=\"Add Hub\">\n"
	"</th> \n"
    "</tr> \n");

// count up the number of unlisted hubs we currently have
int unlistedHubCount = 0;
struct hubConnectStatus *unlistedHubList = NULL;
struct hubConnectStatus *hub, *nextHub;

for(hub = hubList; hub; hub = nextHub)
    {
    nextHub = hub->next;
    // if url is not in publicHash, it's unlisted */
    if (!((publicHash != NULL) && hashLookup(publicHash, hub->hubUrl)))
	{
	unlistedHubCount++;
	slAddHead(&unlistedHubList, hub);
	}
    }

hubList = NULL;  // hubList no longer valid

if (unlistedHubCount == 0)
    {
    // nothing to see here
    printf("<tr><td>No Unlisted Track Hubs</td></tr>");
    printf("</thead></table></div>");
    return;
    }

// time to output the big table.  First the header
printf(
    "<tr> "
	"<th>Display</th> "
	"<th>Hub Name</th> "
	"<th>Description</th> "
	"<th>Assemblies</th> "
	"<th>URL</th> "
	"<th>Disconnect</th> "
    "</tr>\n"
    "</thead>\n");

// start first row
printf("<tbody><tr>");

int count = 0;
for(hub = unlistedHubList; hub; hub = hub->next)
    {
    if (count)
	webPrintLinkTableNewRow();  // ends last row and starts a new one
    count++;

    // if there's an error message, we don't let people select it
    if (isEmpty(hub->errorMessage))
	{
	ourCellStart();
	char hubName[32];
	safef(hubName, sizeof(hubName), "%s%u", hgHubConnectHubVarPrefix, hub->id);
	cartMakeCheckBox(cart, hubName, FALSE);
	ourCellEnd();
	}
    else
	{
	// give people a chance to clear the error 
	ourCellStart();
	printf(
	"<input name=\"hubClearButton\""
	    "onClick=\"document.resetHubForm.elements['hubUrl'].value='%s';"
		"document.resetHubForm.submit();return true;\" "
		"class=\"hubField\" type=\"button\" value=\"check hub\">\n"
		, hub->hubUrl);
	ourCellEnd();
	}
    if (hub->trackHub != NULL)
	ourPrintCell(hub->trackHub->shortLabel);
    else
	ourPrintCell("");

    if (!isEmpty(hub->errorMessage))
	printf("<TD><span class=\"hubError\">ERROR: %s </span>"
	    "<a href=\"../goldenPath/help/hgTrackHubHelp.html#Debug\">Debug</a></TD>\n", 
	    hub->errorMessage);
    else if (hub->trackHub != NULL)
	ourPrintCell(hub->trackHub->longLabel);
    else
	ourPrintCell("");

    if (hub->trackHub != NULL)
	printGenomes(hub->trackHub);
    else
	ourPrintCell("");
    ourPrintCell(hub->hubUrl);

    ourCellStart();
    printf(
    "<input name=\"hubDisconnectButton\""
	"onClick=\"document.disconnectHubForm.elements['hubId'].value='%d';"
	    "document.disconnectHubForm.submit();return true;\" "
	    "class=\"hubField\" type=\"button\" value=\"X\">\n"
	    , hub->id);
    ourCellEnd();
    }

printf("</TR></tbody></TABLE>\n");
printf("</div>");
}
Beispiel #19
0
void showCdsEvidence(char *geneName, struct trackDb *tdb, char *evTable)
/* Print out stuff from cdsEvidence table. */
{
struct sqlConnection *conn = hAllocConn(database);
double bestScore = 0;
if (sqlTableExists(conn, evTable))
    {
    webNewSection("CDS Prediction Information");
    char query[512];
    sqlSafef(query, sizeof(query), 
	    "select count(*) from %s where name='%s'", evTable, geneName);
    if (sqlQuickNum(conn, query) > 0)
	{
	sqlSafef(query, sizeof(query), 
		"select * from %s where name='%s' order by score desc", evTable, geneName);
	struct sqlResult *sr = sqlGetResult(conn, query);
	char **row;

	webPrintLinkTableStart();
	webPrintLabelCell("ORF<BR>size");
	webPrintLabelCell("start in<BR>transcript");
	webPrintLabelCell("end in<BR>transcript");
	webPrintLabelCell("source");
	webPrintLabelCell("accession");
	webPrintLabelCell("ad-hoc<BR>score");
	webPrintLabelCell("start<BR>codon");
	webPrintLabelCell("end<BR>codon");
	webPrintLabelCell("piece<BR>count");
	webPrintLabelCell("piece list");
	webPrintLabelCell("frame");
	webPrintLinkTableNewRow();

	while ((row = sqlNextRow(sr)) != NULL)
	    {
	    struct cdsEvidence *ev = cdsEvidenceLoad(row);
	    webPrintIntCell(ev->end - ev->start);
	    int i;
	    webPrintIntCell(ev->start+1);
	    webPrintIntCell(ev->end);
	    webPrintLinkCell(ev->source);
	    webPrintLinkCell(ev->accession);
	    webPrintLinkCellRightStart();
	    printf("%3.2f", ev->score);
	    bestScore = max(ev->score, bestScore);
	    webPrintLinkCellEnd();
	    webPrintLinkCell(ev->startComplete ? "yes" : "no");
	    webPrintLinkCell(ev->endComplete ? "yes" : "no");
	    webPrintIntCell(ev->cdsCount);
	    webPrintLinkCellRightStart();
	    for (i=0; i<ev->cdsCount; ++i)
		{
		int start = ev->cdsStarts[i];
		int end = start + ev->cdsSizes[i];
		printf("%d-%d ", start+1, end);
		}
	    webPrintLinkCellEnd();
	    webPrintLinkCellRightStart();
	    for (i=0; i<ev->cdsCount; ++i)
	        {
		if (i>0) printf(",");
	        printf("%d", ev->cdsStarts[i]%3 + 1);
		}
	    webPrintLinkCellEnd();
	    webPrintLinkTableNewRow();
	    }
	sqlFreeResult(&sr);
	webPrintLinkTableEnd();
	printf("This table shows CDS predictions for this transcript from a number of "
	    "sources including alignments against UniProtKB proteins, alignments against Genbank "
	    "mRNAs with CDS regions annotated by the sequence submitter, and "
	    "Victor Solovyev's bestorf program. Each prediction is assigned an ad-hoc score "
	    "score is based on several factors including the quality of "
	    "any associated alignments, the quality of the source, and the length of the "
	    "prediction.  For RefSeq transcripts with annotated CDSs the ad-hoc score "
	    "is over a million unless there are severe problems mapping the mRNA to the "
	    "genome.  In other cases the score generally ranges from 0 to 50,000. "
	    "The highest scoring prediction in this table is used to define the CDS "
	    "boundaries for this transcript.<P>If no score is 2000 or more, the transcript "
	    "is considered non-coding. In cases where the CDS is subject to "
	    "nonsense-mediated decay the CDS is removed.  The CDS is also removed "
	    "from transcripts when evidence points to it being in an artifact of an "
	    "incompletely processed transcript.  Specifically if the CDS is entirely "
	    "enclosed in the 3' UTR or an intron of a refSeq or other high quality "
	    "transcript, the CDS is removed.");
	}
    else
        {
	printf("no significant CDS prediction found, likely %s is noncoding",
		geneName);
	}
    }
hFreeConn(&conn);
}