aba8125cb532df17beb7c7c9bc8467a43d09e3d6
braney
  Wed Feb 10 13:39:27 2016 -0800
changes to allow for GenBank metadata to be held in a common table.  #16809

diff --git src/hg/hgTables/seqOut.c src/hg/hgTables/seqOut.c
index 3fc7c1d..6f178c5 100644
--- src/hg/hgTables/seqOut.c
+++ src/hg/hgTables/seqOut.c
@@ -6,30 +6,31 @@
 #include "common.h"
 #include "linefile.h"
 #include "hash.h"
 #include "htmshell.h"
 #include "cheapcgi.h"
 #include "cart.h"
 #include "jksql.h"
 #include "hdb.h"
 #include "web.h"
 #include "hui.h"
 #include "hdb.h"
 #include "trackDb.h"
 #include "customTrack.h"
 #include "hgSeq.h"
 #include "hgTables.h"
+#include "genbank.h"
 
 
 static char *genePredMenu[] =
     {
     "genomic",
     "protein",
     "mRNA",
     };
 
 static void genePredTypeButton(char *val, char *selVal)
 /* Make region radio button including a little Javascript
  * to save selection state. */
 {
 cgiMakeRadioButton(hgtaGeneSeqType, val, sameString(val, selVal));
 }
@@ -92,31 +93,33 @@
 freez(&dupType);
 }
 
 
 void doRefGeneProteinSequence(struct sqlConnection *conn, struct bed *bedList)
 /* Fetch refGene proteins corresponding to names in bedList. */
 {
 struct hash *uniqHash = newHash(18);
 struct hash *protHash = newHash(18);
 struct sqlResult *sr;
 char **row;
 struct bed *bed;
 
 
 /* Get translation from mRNA to protein from refLink table. */
-sr = sqlGetResult(conn, "NOSQLINJ select mrnaAcc,protAcc from refLink");
+char query[2048];
+sqlSafef(query, sizeof query, "NOSQLINJ select mrnaAcc,protAcc from %s",refLinkTable);
+sr = sqlGetResult(conn, query);
 while ((row = sqlNextRow(sr)) != NULL)
     {
     char *protAcc = row[1];
     if (protAcc != NULL && protAcc[0] != 0)
         hashAdd(protHash, row[0], lmCloneString(protHash->lm, protAcc));
     }
 sqlFreeResult(&sr);
 
 boolean gotResults = FALSE;
 for (bed = bedList; bed != NULL; bed = bed->next)
     {
     char *protAcc = hashFindVal(protHash, bed->name);
     if (protAcc != NULL && !hashLookup(uniqHash, protAcc))
         {
 	char *fa = hGetSeqAndId(conn, protAcc, NULL);