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/hgGene/mrnaDescriptions.c src/hg/hgGene/mrnaDescriptions.c index 5305288..b92479c 100644 --- src/hg/hgGene/mrnaDescriptions.c +++ src/hg/hgGene/mrnaDescriptions.c @@ -1,29 +1,30 @@ /* mRNA descriptions. */ /* Copyright (C) 2013 The Regents of the University of California * See README in this or parent directory for licensing information. */ #include "common.h" #include "hash.h" #include "linefile.h" #include "dystring.h" #include "spDb.h" #include "hdb.h" #include "genePred.h" #include "bed.h" #include "hgGene.h" +#include "genbank.h" static boolean mrnaDescriptionsExists(struct section *section, struct sqlConnection *conn, char *geneId) /* Return TRUE if mrna on this one. */ { struct psl *list = NULL; if (hTableExists(sqlGetDatabase(conn), "all_mrna")) { struct sqlResult *sr; char **row; struct psl *psl; int rowOffset; char extra[64]; safef(extra, sizeof(extra), "strand='%c'", curGenePred->strand[0]); @@ -57,33 +58,33 @@ return intersect; } static void mrnaDescriptionsPrint(struct section *section, struct sqlConnection *conn, char *geneId) /* Print out mrna descriptions annotations. */ { struct psl *psl, *pslList = section->items; for (psl = pslList; psl != NULL; psl = psl->next) { if (basesShared(curGenePred, psl) > 12) /* Filter out possible little noisy flecks. */ { char query[512]; char *description; sqlSafef(query, sizeof(query), - "select description.name from gbCdnaInfo,description" - " where gbCdnaInfo.acc='%s' and gbCdnaInfo.description = description.id" - , psl->qName); + "select d.name from %s g,%s d" + " where g.acc='%s' and g.description = d.id" + , gbCdnaInfoTable, descriptionTable, psl->qName); description = sqlQuickString(conn, query); if (description != NULL) { char *url = "http://www.ncbi.nlm.nih.gov/entrez/query.fcgi" "?cmd=Search&db=Nucleotide&term=%s&doptcmdl=GenBank" "&tool=genome.ucsc.edu"; hPrintf("<A HREF=\""); hPrintf(url, psl->qName); hPrintf("\" TARGET=_blank>"); hPrintf("%s</A> - ", psl->qName); hPrintf("%s<BR>", description); } freeMem(description); } }