98874f1656202cd5781466a5d9b25f47da1f104d
hiram
  Mon Feb 13 16:03:53 2023 -0800
a bit closer to correct NCBI links, not perfect, but better than it was no redmine

diff --git src/hg/hgTracks/extTools.c src/hg/hgTracks/extTools.c
index 437da45..bbb2429 100644
--- src/hg/hgTracks/extTools.c
+++ src/hg/hgTracks/extTools.c
@@ -265,37 +265,43 @@
         }
     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, "$ncbiGca"))
         {
+        char *gcf = hNcbiGcfId(db);	/* GCF takes priority over GCA */
+        if (gcf)
+            val = gcf;
+        else
+	    {
 	    char *gca = hNcbiGcaId(db);
 	    if (gca)
 		val = gca;
 	    else
     // Really we shouldn't be making this entire form... pass db as hail-mary
 		val = db;
 	    }
+        }
     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
     else if (stringIn("$", val))
         {
         val = replaceInUrl(val, "", cart, db, chromName, winStart, winEnd, NULL, TRUE, NULL);
         }