7ec945c514178edf4a609753dd28102f98e2f786
braney
  Sat Jul 11 10:02:25 2020 -0700
some fixes in response to code review

diff --git src/hg/hgGene/gencodeSection.c src/hg/hgGene/gencodeSection.c
index d8d1d99..379a027 100644
--- src/hg/hgGene/gencodeSection.c
+++ src/hg/hgGene/gencodeSection.c
@@ -17,32 +17,30 @@
 #include "gencodeToUniProt.h"
 #include "gencodeTranscriptionSupportLevel.h"
 #include "gencodeTag.h"
 #include "gencodeGeneSource.h"
 #include "gencodeToPdb.h"
 #include "gencodeToPubMed.h"
 #include "gencodeToRefSeq.h"
 #include "gencodeTranscriptSource.h"
 #include "gencodeTranscriptSupport.h"
 #include "gencodeExonSupport.h"
 #include "gencodeToUniProt.h"
 #include "gencodeToEntrezGene.h"
 #include "gencodeAnnotationRemark.h"
 #include "gencodeTranscriptionSupportLevel.h"
 
-extern struct trackDb *globalTdb;
-
 char *entrezUidFormat = "https://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Retrieve&db=%s&list_uids=%d&dopt=%s&tool=genome.ucsc.edu";
 
 static void printEntrezPubMedUidUrl(FILE *f, int pmid)
 /* Print URL for Entrez browser on a PubMed search. */
 {
 fprintf(f, entrezUidFormat, "PubMed", pmid, "Summary");
 }
 
 static void printEntrezGeneUrl(FILE *f, int geneid)
 /* Print URL for Entrez browser on a gene details page. */
 {
 fprintf(f, entrezUidFormat, "gene", geneid, "Graphics");
 }
 
 static void printCcdsExtUrl(char *ccdsId)
@@ -105,33 +103,34 @@
 if (dot != NULL)
     *dot = '\0';
 return accBuf;
 }
 
 static bool haveGencodeTable(struct trackDb *tdb, char *tableBase)
 /* determine if table is in settings and thus in this gencode release */
 {
 return trackDbSetting(tdb, tableBase) != NULL;
 }
 
 static char *getGencodeTable(struct trackDb *tdb, char *tableBase)
 /* get a table name from the settings. */
 {
 char buffer[strlen(tableBase) + 10];
-safef(buffer, sizeof buffer, "%sV35",tableBase);
+// the version number is after the table name base
+char *tableVersion = &tdb->table[strlen("gencodeAnnot")];
+safef(buffer, sizeof buffer, "%s%s",tableBase,tableVersion);
 return cloneString(buffer);
-//return trackDbRequiredSetting(tdb, tableBase);
 }
 
 static char* getGencodeVersion(struct trackDb *tdb)
 /* get the GENCODE version or NULL for < V7, which is not supported
  * by this module. */
 {
 return trackDbSetting(tdb, "gencodeVersion");
 }
 
 static boolean isGrcH37Native(struct trackDb *tdb)
 /* Is this GENCODE GRCh37 native build, which requires a different Ensembl site. */
 {
 // check for non-lifted GENCODE on GRCh37/hg19
 if (sameString(database, "hg19"))
     return stringIn("lift37", getGencodeVersion(tdb)) == NULL;