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("Strand%s\n", transAnno->strand); printf("Biotype%s%s\n", gencodeBiotypesUrl, transAttrs->transcriptType, transAttrs->geneType); printf("Annotation Level%s (%d)\n", getLevelDesc(transAttrs->level), transAttrs->level); printf("Annotation Method%s%s\n", getMethodDesc(transcriptSource->source), getMethodDesc(geneSource->source)); if (haveTsl) { char *tslDesc = getSupportLevelDesc(tsl); printf("Transcription Support Level%s\n", tslDesc, tslDesc); } printf("HGNC gene symbol"); +if (!isFakeGeneSymbol(transAttrs->geneName)) prExtIdAnchor(transAttrs->geneName, hgncUrl); printf("\n"); printf("CCDS"); if (!isEmpty(transAttrs->ccdsId)) { printf("ccdsId); printf("\" target=_blank>%s", transAttrs->ccdsId); } printf("\n"); printf("GeneCards"); +if (!isFakeGeneSymbol(transAttrs->geneName)) prExtIdAnchor(transAttrs->geneName, geneCardsUrl); printf("\n"); if (isProteinCodingTrans(transAttrs)) writeAprrisRow(conn, tdb, transAttrs, tags); // FIXME: add sequence here?? printf("\n"); } static void writeSequenceHtml(struct trackDb *tdb, char *gencodeId, struct genePred *transAnno) /* write links to get sequences */ { printf("\n"); printf("\n");
Sequences