", type);
if (startsWith("mrnaBlastz",tdb->table))
slSort(&pslList, pslCmpScoreDesc);
printAlignments(pslList, start, "htcCdnaAli", table, acc);
printTrackHtml(tdb);
hFreeConn(&conn);
cartWebEnd(cart);
}
-void printPslFormat(struct sqlConnection *conn, struct trackDb *tdb, char *item, int start, char *subType)
+void printPslFormat(struct sqlConnection *conn, struct trackDb *tdb, char *item, int start,
+ char *subType)
/* Handles click in affyU95 or affyU133 tracks */
{
struct psl *pslList = getAlignments(conn, tdb->table, item);
struct psl *psl;
char *face = "Times"; /* specifies font face to use */
char *fsize = "+1"; /* specifies font size */
/* check if there is an alignment available for this sequence. This checks
* both genbank sequences and other sequences in the seq table. If so,
* set it up so they can click through to the alignment. */
if (hGenBankHaveSeq(database, item, NULL))
{
printf("
%s/Genomic Alignments
", item);
printAlignments(pslList, start, "htcCdnaAli", tdb->table, item);
}
@@ -6538,32 +6529,32 @@
{
row = sqlNextRow(sr2);
if (row)
{
contigAccStaticLoad(row, &contigAcc);
printf("Genbank Accession: %s \n", contigAcc.acc);
}
sqlFreeResult(&sr2);
}
}
if (hTableExists(database, "clonePos"))
{
- sprintf(query,
- "select count(*) from clonePos where chrom = '%s' and chromEnd >= %d and chromStart <= %d",
+ sprintf(query, "select count(*) from clonePos"
+ " where chrom = '%s' and chromEnd >= %d and chromStart <= %d",
ctg->chrom, ctg->chromStart, ctg->chromEnd);
cloneCount = sqlQuickNum(conn, query);
printf("Total Clones: %d \n", cloneCount);
}
printPos(ctg->chrom, ctg->chromStart, ctg->chromEnd, NULL, TRUE, ctg->contig);
printTrackHtml(tdb);
hFreeConn(&conn);
hFreeConn(&conn2);
}
char *cloneStageName(char *stage)
/* Expand P/D/F. */
{
switch (stage[0])
@@ -8593,32 +8584,31 @@
}
genomeStrEnsembl = ensOrgNameFromScientificName(scientificName);
if (genomeStrEnsembl == NULL)
{
warn("Organism %s not found!", organism); fflush(stdout);
return;
}
/* print URL that links to Ensembl or Vega transcript details */
if (isEnsembl)
{
if (archive != NULL)
safef(dbUrl, sizeof(dbUrl), "http://%s.archive.ensembl.org/%s",
archive, genomeStrEnsembl);
else
- safef(dbUrl, sizeof(dbUrl), "http://www.ensembl.org/%s",
- genomeStrEnsembl);
+ safef(dbUrl, sizeof(dbUrl), "http://www.ensembl.org/%s", genomeStrEnsembl);
}
else if (isVega)
safef(dbUrl, sizeof(dbUrl), "http://vega.sanger.ac.uk/%s",
genomeStrEnsembl);
boolean nonCoding = FALSE;
char query[512];
safef(query, sizeof(query), "name = \"%s\"", itemName);
struct genePred *gpList = genePredReaderLoadQuery(conn, tdb->table, query);
if (gpList && (gpList->cdsStart == gpList->cdsEnd))
nonCoding = TRUE;
genePredFreeList(&gpList);
/* get gene and protein IDs */
if ((isEnsembl && hasEnsGtp) || (isVega && hasVegaGtp))
{
@@ -9582,31 +9572,32 @@
sr = sqlMustGetResult(conn, query);
row = sqlNextRow(sr);
if (row != NULL)
{
kgId = cloneString(row[0]);
}
sqlFreeResult(&sr);
/* use geneSymbols from omimMorbidMap if available */
if (geneSymbols!= NULL)
{
printf("OMIM gene or syndrome: %s", geneSymbols);
printf(" \n");
/* display disorder for genes in morbidmap */
- safef(query, sizeof(query), "select description from omimMorbidMap where omimId=%s;", itemName);
+ safef(query, sizeof(query), "select description from omimMorbidMap where omimId=%s;",
+ itemName);
sr = sqlMustGetResult(conn, query);
while ((row = sqlNextRow(sr)) != NULL)
{
printf("Disorder: %s", row[0]);
printf(" \n");
}
sqlFreeResult(&sr);
}
else
{
/* display gene symbol(s) from omimGenemap */
safef(query, sizeof(query), "select geneSymbol from omimGeneMap where omimId=%s;", itemName);
sr = sqlMustGetResult(conn, query);
row = sqlNextRow(sr);
if (row != NULL)
@@ -9693,31 +9684,32 @@
safef(query, sizeof(query),
"select i.transcript from knownIsoforms i, knownCanonical c where c.transcript='%s' and i.clusterId=c.clusterId and i.transcript <>'%s'",
kgId, kgId);
sr = sqlMustGetResult(conn, query);
if (sr != NULL)
{
int printedCnt;
printedCnt = 0;
while ((row = sqlNextRow(sr)) != NULL)
{
if (printedCnt < 1)
printf("Other UCSC Gene(s) in the same cluster: ");
else
printf(", ");
- printf("", "../cgi-bin/hgGene?hgg_gene=", row[0]);
+ printf("",
+ "../cgi-bin/hgGene?hgg_gene=", row[0]);
printf("%s", row[0]);
printedCnt++;
}
if (printedCnt >= 1) printf(" \n");
}
sqlFreeResult(&sr);
}
}
printf("");
printPosOnChrom(chrom, atoi(chromStart), atoi(chromEnd), NULL, FALSE, itemName);
}
#include "omim.h"
@@ -9845,31 +9837,32 @@
sqlFreeResult(&sr);
safef(query, sizeof(query),
"select distinct l.mrnaAcc from refLink l where locusLinkId = '%s' order by mrnaAcc asc", geneId);
sr = sqlMustGetResult(conn, query);
if (sr != NULL)
{
int printedCnt;
printedCnt = 0;
while ((row = sqlNextRow(sr)) != NULL)
{
if (printedCnt < 1)
printf("RefSeq Gene(s): ");
else
printf(", ");
- printf("", "../cgi-bin/hgc?g=refGene&i=", row[0], chromStart, chromEnd);
+ printf("", "../cgi-bin/hgc?g=refGene&i=",
+ row[0], chromStart, chromEnd);
printf("%s", row[0]);
printedCnt++;
}
if (printedCnt >= 1) printf(" \n");
}
sqlFreeResult(&sr);
}
// show Related UCSC Gene links
safef(query, sizeof(query),
"select distinct kgId from kgXref x, refLink l, omim2gene g where x.refseq = mrnaAcc and l.omimId=%s and g.omimId=l.omimId and g.entryType='gene'",
itemName);
sr = sqlMustGetResult(conn, query);
if (sr != NULL)
{
@@ -10098,31 +10091,32 @@
safef(query, sizeof(query),
"select i.transcript from knownIsoforms i, knownCanonical c where c.transcript='%s' and i.clusterId=c.clusterId and i.transcript <>'%s'",
kgId, kgId);
sr = sqlMustGetResult(conn, query);
if (sr != NULL)
{
int printedCnt;
printedCnt = 0;
while ((row = sqlNextRow(sr)) != NULL)
{
if (printedCnt < 1)
printf("Other UCSC Gene(s) in the same cluster: ");
else
printf(", ");
- printf("", "../cgi-bin/hgGene?hgg_gene=", row[0]);
+ printf("",
+ "../cgi-bin/hgGene?hgg_gene=", row[0]);
printf("%s", row[0]);
printedCnt++;
}
if (printedCnt >= 1) printf(" \n");
}
sqlFreeResult(&sr);
}
}
printf("");
printPosOnChrom(chrom, atoi(chromStart), atoi(chromEnd), NULL, FALSE, itemName);
}
void doOmimLocation(struct trackDb *tdb, char *item)
/* Put up OmimGene track info. */
@@ -10161,31 +10155,33 @@
if (chp != NULL) *chp = '\0';
safef(avString, sizeof(avString), "%s", itemName);
chp = strstr(itemName, ".");
*chp = '\0';
omimId = strdup(itemName);
chp = avString;
chp = strstr(avString, ".");
*chp = '#';
if (url != NULL && url[0] != 0)
{
safef(query, sizeof(query),
- "select title1, title2, format(seqNo/10000,4), v.description from omimGeneMap m, omimAv v where m.omimId=%s and m.omimId=v.omimId and v.avId='%s';", itemName, avId);
+ "select title1, title2, format(seqNo/10000,4), v.description"
+ " from omimGeneMap m, omimAv v"
+ " where m.omimId=%s and m.omimId=v.omimId and v.avId='%s';", itemName, avId);
sr = sqlMustGetResult(conn, query);
row = sqlNextRow(sr);
if (row != NULL)
{
seqId = strdup(row[2]);
if (row[0] != NULL)
{
title1 = cloneString(row[0]);
}
if (row[1] != NULL)
{
title2 = cloneString(row[1]);
}
avDesc = cloneString(row[3]);
@@ -11025,31 +11021,32 @@
int start = cartInt(cart, "o");
int left = cartInt(cart, "l");
int right = cartInt(cart, "r");
char *chrom = cartString(cart, "c");
/* Make sure to escape single quotes for DB parseability */
if (strchr(rnaName, '\''))
{
sqlRnaName = replaceChars(rnaName, "'", "''");
}
/* get refLink entry */
if (strstr(rnaName, "NM_") != NULL)
{
safef(query, sizeof(query), "select * from refLink where mrnaAcc = '%s'", sqlRnaName);
sr = sqlGetResult(conn, query);
if ((row = sqlNextRow(sr)) == NULL)
- errAbort("Couldn't find %s in refLink table - this accession may no longer be available.", rnaName);
+ errAbort("Couldn't find %s in refLink table - this accession may no longer be available.",
+ rnaName);
rl = refLinkLoad(row);
sqlFreeResult(&sr);
}
else
{
rlR.name = strdup(kgId);
rlR.mrnaAcc = strdup(kgId);
rlR.locusLinkId = 0;
rl = &rlR;
}
cartWebStart(cart, database, "Known Gene");
printf("
\n
\n");
prKnownGeneInfo(conn, rnaName, sqlRnaName, rl);
@@ -11612,62 +11609,64 @@
if (hTableExists(database, chainTable_chrom) )
{
/* lookup chain */
dyStringPrintf(dy,
"select id, score, qStart, qEnd, qStrand, qSize from %s_%s where ",
pg->chrom, chainTable);
hAddBinToQuery(pg->chromStart, pg->chromEnd, dy);
if (sameString(pg->gStrand,pg->strand))
dyStringPrintf(dy,
"tEnd > %d and tStart < %d and qName = '%s' and qEnd > %d and qStart < %d and qStrand = '+' ",
pg->chromStart, pg->chromEnd, pg->gChrom, pg->gStart, pg->gEnd);
else
{
dyStringPrintf(dy,
"tEnd > %d and tStart < %d and qName = '%s' and qEnd > %d and qStart < %d and qStrand = '-'",
- pg->chromStart, pg->chromEnd, pg->gChrom, hChromSize(database, pg->gChrom)-(pg->gEnd),
+ pg->chromStart, pg->chromEnd, pg->gChrom,
+ hChromSize(database, pg->gChrom)-(pg->gEnd),
hChromSize(database, pg->gChrom)-(pg->gStart));
}
dyStringAppend(dy, " order by qStart");
sr = sqlGetResult(conn, dy->string);
while ((row = sqlNextRow(sr)) != NULL)
{
int chainId, score;
unsigned int qStart, qEnd, qSize;
char qStrand;
if (first == 0)
{
printf("
Gene/PseudoGene Alignment (multiple records are a result of breaks in the human Self Chaining)
\n");
* genericBedClick(conn, tdb, item, start, 1); */
printTrackHtml(tdb);
hFreeConn(&conn);
}
void doChicken13kDetails(struct trackDb *tdb, char *item)
{
struct sqlConnection *conn = hAllocConn(database);
struct chicken13kInfo *chick = NULL;
char buff[256];
@@ -19139,31 +19149,32 @@
printf("GC Percentage: %3.1f%% \n", ((float)gc->gcPpt)/10);
gcPercentFree(&gc);
}
printTrackHtml(tdb);
sqlFreeResult(&sr);
hFreeConn(&conn);
}
void chuckHtmlStart(char *title)
/* Prints the header appropriate for the title
* passed in. Links html to chucks stylesheet for
* easier maintaince
*/
{
printf("\n\n");
-//FIXME blueStyle should not be absolute to genome-test and should bae called by: webIncludeResourceFile("blueStyle.css");
+// FIXME blueStyle should not be absolute to genome-test and should be called by:
+// webIncludeResourceFile("blueStyle.css");
printf("\n");
printf("%s\n",title);
}
void chuckHtmlContactInfo()
/* Writes out Chuck's email so people bother Chuck instead of Jim */
{
puts("
If you have comments and/or suggestions please email "
"sugnet@cse.ucsc.edu.\n");
}
void abbr(char *s, char *fluff)
/* Cut out fluff from s. */
{
@@ -19405,34 +19416,37 @@
printf("
\n");
}
struct bed *bedWScoreLoadByChrom(char *table, char *chrom, int start, int end)
{
struct sqlConnection *conn = hAllocConn(database);
struct sqlResult *sr = NULL;
struct bed *bedWS, *bedWSList = NULL;
char **row;
char query[256];
struct hTableInfo *hti = hFindTableInfo(database, seqName, table);
if(hti == NULL)
errAbort("Can't find table: (%s) %s", seqName, table);
else if(hti && sameString(hti->startField, "tStart"))
- snprintf(query, sizeof(query), "select qName,tStart,tEnd from %s where tName='%s' and tStart < %u and tEnd > %u",
+ snprintf(query, sizeof(query),
+ "select qName,tStart,tEnd from %s where tName='%s' and tStart < %u and tEnd > %u",
table, seqName, winEnd, winStart);
else if(hti && sameString(hti->startField, "chromStart"))
- snprintf(query, sizeof(query), "select name,chromStart,chromEnd from %s where chrom='%s' and chromStart < %u and chromEnd > %u",
+ snprintf(query, sizeof(query),
+ "select name,chromStart,chromEnd from %s"
+ " where chrom='%s' and chromStart < %u and chromEnd > %u",
table, seqName, winEnd, winStart);
else
errAbort("%s doesn't have tStart or chromStart", table);
sr = sqlGetResult(conn, query);
while((row = sqlNextRow(sr)) != NULL)
{
AllocVar(bedWS);
bedWS->name = cloneString(row[0]);
bedWS->chromStart = sqlUnsigned(row[1]);
bedWS->chromEnd = sqlUnsigned(row[2]);
bedWS->chrom = cloneString(seqName);
slAddHead(&bedWSList, bedWS);
}
slReverse(&bedWSList);
sqlFreeResult(&sr);
@@ -19628,31 +19642,32 @@
char query[256];
struct altGraphX *ag = NULL;
struct altGraphX *orthoAg = NULL;
char buff[128];
struct sqlConnection *conn = hAllocConn(database);
char *image = NULL;
/* Load the altGraphX record and start page. */
if(id != 0)
{
snprintf(query, sizeof(query),"select * from %s where id=%d", tdb->table, id);
ag = altGraphXLoadByQuery(conn, query);
}
else
{
- snprintf(query, sizeof(query),"select * from %s where tName like '%s' and tStart <= %d and tEnd >= %d",
+ snprintf(query, sizeof(query),
+ "select * from %s where tName like '%s' and tStart <= %d and tEnd >= %d",
tdb->table, seqName, winEnd, winStart);
ag = altGraphXLoadByQuery(conn, query);
}
if(ag == NULL)
errAbort("hgc::doAltGraphXDetails() - couldn't find altGraphX with id=%d", id);
genericHeader(tdb, ag->name);
printPosOnChrom(ag->tName, ag->tStart, ag->tEnd, ag->strand, FALSE, NULL);
/* Print a display of the Graph. */
printf("Plots of Alt-Splicing:");
printf("