3a4f6c4b7c479dea4d9a6ac7ed63a634b9fd1c60
markd
  Tue Apr 9 22:42:40 2019 -0700
don't generate linkes to HGNC or GeneCards if gene name is one of the fake generated names

diff --git src/hg/hgc/gencodeClick.c src/hg/hgc/gencodeClick.c
index e336337..a4d7305 100644
--- src/hg/hgc/gencodeClick.c
+++ src/hg/hgc/gencodeClick.c
@@ -1,28 +1,29 @@
 /* gencodeClick - click handling for GENCODE tracks */
 
 /* Copyright (C) 2014 The Regents of the University of California 
  * See README in this or parent directory for licensing information. */
 #include "common.h"
 #include "hgc.h"
 #include "gencodeClick.h"
 #include "ccdsClick.h"
 #include "genePred.h"
 #include "genePredReader.h"
 #include "ensFace.h"
 #include "htmshell.h"
 #include "jksql.h"
+#include "regexHelper.h"
 #include "encode/wgEncodeGencodeAttrs.h"
 #include "encode/wgEncodeGencodeGeneSource.h"
 #include "encode/wgEncodeGencodePdb.h"
 #include "encode/wgEncodeGencodePubMed.h"
 #include "encode/wgEncodeGencodeRefSeq.h"
 #include "encode/wgEncodeGencodeTag.h"
 #include "encode/wgEncodeGencodeTranscriptSource.h"
 #include "encode/wgEncodeGencodeTranscriptSupport.h"
 #include "encode/wgEncodeGencodeExonSupport.h"
 #include "encode/wgEncodeGencodeUniProt.h"
 #include "encode/wgEncodeGencodeEntrezGene.h"
 #include "encode/wgEncodeGencodeAnnotationRemark.h"
 #include "encode/wgEncodeGencodeTranscriptionSupportLevel.h"
 
 /*
@@ -87,30 +88,37 @@
  * by this module. */
 {
 return trackDbSetting(tdb, "wgEncodeGencodeVersion");
 }
 
 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;
 else
     return FALSE;
 }
 
+static boolean isFakeGeneSymbol(char* sym)
+/* is this a static gene symbol? */
+{
+static const char *regexp = "^AC[0-9]+\\.[0-9]+$";
+return regexMatch(sym, regexp);
+}
+
 static int transAnnoCmp(const void *va, const void *vb)
 /* Compare genePreds, sorting to keep select gene first.  The only cases
  * that annotations will be duplicated is if they are in the PAR and thus
  * on different chroms. */
 {
 const struct genePred *a = *((struct genePred **)va);
 const struct genePred *b = *((struct genePred **)vb);
 if (sameString(a->name, seqName))
     return -1;
 else if (sameString(b->name, seqName))
     return 1;
 else
     return strcmp(a->name, b->name);
 }
 
@@ -413,43 +421,45 @@
 
 printf("<tr><th>Strand<td>%s<td></tr>\n", transAnno->strand);
 
 printf("<tr><th><a href=\"%s\" target = _blank>Biotype</a><td>%s<td>%s</tr>\n", gencodeBiotypesUrl, transAttrs->transcriptType, transAttrs->geneType);
 
 printf("<tr><th>Annotation Level<td>%s (%d)<td></tr>\n", getLevelDesc(transAttrs->level), transAttrs->level);
 
 printf("<tr><th>Annotation Method<td>%s<td>%s</tr>\n", getMethodDesc(transcriptSource->source), getMethodDesc(geneSource->source));
 
 if (haveTsl)
     {
     char *tslDesc = getSupportLevelDesc(tsl);
     printf("<tr><th><a href=\"#tsl\">Transcription Support Level</a><td><a href=\"#%s\">%s</a><td></tr>\n", tslDesc, tslDesc);
     }
 printf("<tr><th>HGNC gene symbol<td colspan=2>");
+if (!isFakeGeneSymbol(transAttrs->geneName))
     prExtIdAnchor(transAttrs->geneName, hgncUrl);
 printf("</tr>\n");
 
 printf("<tr><th>CCDS<td>");
 if (!isEmpty(transAttrs->ccdsId))
     {
     printf("<a href=\"");
     printCcdsExtUrl(transAttrs->ccdsId);
     printf("\" target=_blank>%s</a>", transAttrs->ccdsId);
     }
 printf("<td></tr>\n");
 
 printf("<tr><th>GeneCards<td colspan=2>");
+if (!isFakeGeneSymbol(transAttrs->geneName))
     prExtIdAnchor(transAttrs->geneName, geneCardsUrl);
 printf("</tr>\n");
 
 if (isProteinCodingTrans(transAttrs))
     writeAprrisRow(conn, tdb, transAttrs, tags);
 
 // FIXME: add sequence here??
 printf("</tbody></table>\n");
 }
 
 static void writeSequenceHtml(struct trackDb *tdb, char *gencodeId, struct genePred *transAnno)
 /* write links to get sequences */
 {
 printf("<table class=\"hgcCcds\"><thead>\n");
 printf("<tr><th colspan=\"2\">Sequences</tr>\n");