d3c4dd4f1df4b3919520794bfcaac0a7d0935a7f angie Tue Dec 19 12:07:23 2017 -0800 Replace hgTracks' links to NCBI's obsolete Map Viewer with the new & improved Genome Data Viewer. GDV has only the latest RefSeq assembly for all species except human; it wants GCF_... IDs, which we will have to keep updating in hdb.c. It's possible that someday NCBI may accept our db IDs instead of GCF_. refs #18671 diff --git src/hg/hgTracks/extTools.c src/hg/hgTracks/extTools.c index b01cb0d..e25493e 100644 --- src/hg/hgTracks/extTools.c +++ src/hg/hgTracks/extTools.c @@ -223,70 +223,79 @@ printf("Sorry, this tool accepts only a sequence with less than %d base pairs
\n" "Please zoom in some more.
\n", et->maxSize);
return;
}
printf("You're being redirected from the UCSC Genome Browser to the site %s
\n", url);
if (et->email)
printf("Please contact %s for questions on this tool.
\n", et->email);
boolean submitDone = FALSE;
for (slp=et->params; slp!=NULL; slp=slp->next)
{
char* val = slp->val;
if (sameWord(val, "$db"))
val = db;
- if (sameWord(val, "$position"))
+ else if (sameWord(val, "$position"))
val = pos;
- if (sameWord(val, "$start1"))
+ else if (sameWord(val, "$start1"))
val = start1;
- if (sameWord(val, "$returnUrl"))
+ else if (sameWord(val, "$returnUrl"))
{
// get the full URL of this hgTracks page, so external page can construct a custom track
// and link back to us
char* host = getenv("HTTP_HOST");
char* reqUrl = getenv("REQUEST_URI");
// remove everything after ? in URL
char *e = strchr(reqUrl, '?');
if (e) *e = 0;
char url[4000];
// cannot find a way to find out if the request came in via http or https
safef(url, sizeof(url), "http://%s%s", host, reqUrl);
val = url;
}
// half the current window size
- if (stringIn("$halfLen", val))
+ else if (stringIn("$halfLen", val))
{
char buf[64];
safef(buf, sizeof(buf), "%d", len/2);
val = replaceChars(val, "$halfLen", buf);
}
- if (sameWord(val, "$seq") || sameWord(val, "$faSeq"))
+ else if (sameWord(val, "$seq") || sameWord(val, "$faSeq"))
{
static struct dnaSeq *seq = NULL;
seq = hDnaFromSeq(db, chromName, winStart, winEnd, dnaLower);
if (sameWord(val, "$seq"))
val = seq->dna;
else
{
val = catTwoStrings(">sequence\n",seq->dna);
freez(&seq);
}
}
+ else if (sameWord(val, "$ncbiGcf"))
+ {
+ char *gcf = hNcbiGcfId(db);
+ if (gcf)
+ val = gcf;
+ else
+ // Really we shouldn't be making this entire form... pass db as hail-mary
+ val = db;
+ }
// any remaining $-expression might be one of the general ones
- if (stringIn("$", val))
+ else if (stringIn("$", val))
{
val = replaceInUrl(val, "", cart, db, chromName, winStart, winEnd, NULL, TRUE);
}
// output
if (debug)
{
printf("%s: ", slp->name);
printf("
\n", slp->name, val); } else { // parameter named submit is a special case if (sameWord(slp->name, "submit")) {