3af98b1d9fb1acd51ef8a6c92ecc2d1f7e4fdb8d
markd
Wed Jun 24 23:42:59 2015 -0700
fix click through on snake tracks to other genomes in mysql backed HAL browsers (no redmine)
diff --git src/hg/hgc/hgc.c src/hg/hgc/hgc.c
index 34c7317..6b58cb4 100644
--- src/hg/hgc/hgc.c
+++ src/hg/hgc/hgc.c
@@ -24449,39 +24449,46 @@
}
void doQPCRPrimers(struct trackDb *tdb, char *itemName)
/* Put up page for QPCRPrimers. */
{
genericHeader(tdb, itemName);
doBedDetail(tdb, NULL, itemName);
} /* end of doQPCRPrimers */
void doSnakeClick(struct trackDb *tdb, char *itemName)
/* Put up page for snakes. */
{
genericHeader(tdb, itemName);
char *otherSpecies = trackHubSkipHubName(tdb->table) + strlen("snake");
char *hubName = cloneString(database);
-char *ptr = strchr(hubName + 4, '_');
-*ptr = 0;
char otherDb[4096];
char *qName = cartOptionalString(cart, "qName");
int qs = atoi(cartOptionalString(cart, "qs"));
int qe = atoi(cartOptionalString(cart, "qe"));
int qWidth = atoi(cartOptionalString(cart, "qWidth"));
-safef(otherDb, sizeof otherDb, "%s_%s", hubName, otherSpecies);
+if(trackHubDatabase(database))
+ {
+ char *ptr = strchr(hubName + 4, '_');
+ *ptr = 0;
+ safef(otherDb, sizeof otherDb, "%s_%s", hubName, otherSpecies);
+ }
+else
+ {
+ safef(otherDb, sizeof otherDb, "%s", otherSpecies);
+ }
printf("Link to block in other assembly
\n", otherDb, qName, qs, qe,hubName,trackHubSkipHubName(database));
int qCenter = (qs + qe) / 2;
int newQs = qCenter - qWidth/2;
int newQe = qCenter + qWidth/2;
printf("Link to same window size in other assembly
\n", otherDb, qName, newQs, newQe,hubName,trackHubSkipHubName(database));
}
bool vsameWords(char *a, va_list args)
/* returns true if a is sameWord as any arg, all args must be char* */
{
bool found = FALSE;
char *b;
while ((b = va_arg(args, char *)) != NULL)