b30cdeb86d8532e8a41afa61aef02f988d957aeb
max
Fri May 9 14:46:48 2014 -0700
making some changes to bacEnds tracks code to allow change of tablename. Removing some code which is not necessary anymore as a result.
diff --git src/hg/hgc/hgc.c src/hg/hgc/hgc.c
index 7efcbaa..e369051 100644
--- src/hg/hgc/hgc.c
+++ src/hg/hgc/hgc.c
@@ -432,30 +432,36 @@
/* Print URL for GDB browser for an id
* GDB currently inoperative, so have temporarily disabled this function
*
static void printGdbUrl(FILE *f, char *id)
{
fprintf(f, "%s", id);
}
*/
static void printCloneDbUrl(FILE *f, char *clone)
/* Print URL for Clone Registry at NCBI for a clone */
{
fprintf(f, "\"%s%s\"", cloneDbScript, clone);
}
+static void printTraceTiUrl(FILE *f, char *name)
+/* Print URL for Trace Archive at NCBI for a trace id (TI) */
+{
+fprintf(f, "\"%s%s\"", traceScript, name);
+}
+
static void printTraceUrl(FILE *f, char *idType, char *name)
/* Print URL for Trace Archive at NCBI for an identifier specified by type */
{
fprintf(f, "\"%s%s%%3D%%27%s%%27\"", traceScript, idType, name);
}
static void printGenMapDbUrl(FILE *f, char *clone)
/* Print URL for GenMapDb at UPenn for a clone */
{
fprintf(f, "\"%s%s\"", genMapDbScript, clone);
}
static void printFlyBaseUrl(FILE *f, char *fbId)
/* Print URL for FlyBase browser. */
{
@@ -18434,105 +18440,118 @@
gbProtAnn->proteinId);
printf(" TARGET=_blank>%s
\n", gbProtAnn->proteinId);
htmlHorizontalLine();
showSAM_T02(gbProtAnn->proteinId);
printPos(seqName, gbProtAnn->chromStart, gbProtAnn->chromEnd, "+", TRUE,
gbProtAnn->name);
}
printTrackHtml(tdb);
sqlFreeResult(&sr);
hFreeConn(&conn);
}
+bool matchTableOrHandler(char *word, struct trackDb *tdb)
+/* return true if word matches either the table name or the trackHandler setting of the tdb struct */
+{
+char* handler = trackDbSetting(tdb, "trackHandler");
+return (sameWord(word, tdb->table) || (handler==NULL || sameWord(word, handler)));
+}
+
void doLinkedFeaturesSeries(char *track, char *clone, struct trackDb *tdb)
/* Create detail page for linked features series tracks */
{
char query[256];
char title[256];
struct sqlConnection *conn = hAllocConn(database), *conn1 = hAllocConn(database);
struct sqlResult *sr = NULL, *sr2 = NULL, *srb = NULL;
char **row, **row1, **row2, **rowb;
char *lfLabel = NULL;
char *table = NULL;
char *intName = NULL;
char pslTable[64];
int start = cartInt(cart, "o");
int end = cartInt(cart, "t");
int length = end - start;
int i;
struct lfs *lfs;
struct psl *pslList = NULL, *psl;
boolean hasBin = hOffsetPastBin(database, seqName, track);
/* Determine type */
-if (sameString("bacEndPairs", track))
+if (matchTableOrHandler("bacEndPairs", tdb))
{
safef(title, sizeof title, "Location of %s using BAC end sequences", clone);
lfLabel = "BAC ends";
table = track;
}
-if (sameString("bacEndSingles", track))
+if (matchTableOrHandler("bacEndSingles", tdb))
{
safef(title, sizeof title, "Location of %s using BAC end sequences", clone);
lfLabel = "BAC ends";
table = track;
}
-if (sameString("bacEndPairsBad", track))
+if (matchTableOrHandler("bacEndPairsBad", tdb))
{
safef(title, sizeof title, "Location of %s using BAC end sequences", clone);
lfLabel = "BAC ends";
table = track;
}
-if (sameString("bacEndPairsLong", track))
+if (matchTableOrHandler("bacEndPairsLong", tdb))
{
safef(title, sizeof title, "Location of %s using BAC end sequences", clone);
lfLabel = "BAC ends";
table = track;
}
-if (sameString("fosEndPairs", track))
+if (matchTableOrHandler("fosEndPairs", tdb))
{
safef(title, sizeof title, "Location of %s using fosmid end sequences", clone);
lfLabel = "Fosmid ends";
table = track;
}
-if (sameString("fosEndPairsBad", track))
+if (matchTableOrHandler("fosEndPairsBad", tdb))
{
safef(title, sizeof title, "Location of %s using fosmid end sequences", clone);
lfLabel = "Fosmid ends";
table = track;
}
-if (sameString("fosEndPairsLong", track))
+if (matchTableOrHandler("fosEndPairsLong", tdb))
{
safef(title, sizeof title, "Location of %s using fosmid end sequences", clone);
lfLabel = "Fosmid ends";
table = track;
}
-if (sameString("earlyRep", track))
+if (matchTableOrHandler("earlyRep", tdb))
{
safef(title, sizeof title, "Location of %s using cosmid end sequences", clone);
lfLabel = "Early Replication Cosmid Ends";
table = track;
}
-if (sameString("earlyRepBad", track))
+if (matchTableOrHandler("earlyRepBad", tdb))
{
safef(title, sizeof title, "Location of %s using cosmid end sequences", clone);
lfLabel = "Early Replication Cosmid Ends";
table = track;
}
+if (trackDbSetting(tdb, "lfPslTable"))
+ {
+ safef(title, sizeof title, "Location of %s using clone end sequences", clone);
+ lfLabel = "Clone ends";
+ table = track;
+ }
/* Print out non-sequence info */
cartWebStart(cart, database, "%s", title);
/* Find the instance of the object in the bed table */
sqlSafef(query, sizeof query, "SELECT * FROM %s WHERE name = '%s' "
"AND chrom = '%s' AND chromStart = %d "
"AND chromEnd = %d",
table, clone, seqName, start, end);
sr = sqlMustGetResult(conn, query);
row = sqlNextRow(sr);
if (row != NULL)
{
lfs = lfsLoad(row+hasBin);
if (sameString("bacEndPairs", track) || sameString("bacEndSingles", track))
@@ -18561,49 +18580,61 @@
}
else
printf("
Chromosome: | %s |
---|---|
Start: | %d |
End: | %d |
Length: | %d |
Strand: | %s |
Score: | %d |
Sanger FPC Name: | "); if (intName != NULL) printf("%s |